Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
preprocessor
Commits
d36eb82b
Verified
Commit
d36eb82b
authored
2 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Macro processor: removed unused “basename” variable
parent
1f3ff760
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/MacroExpandModFile.cc
+2
-2
2 additions, 2 deletions
src/MacroExpandModFile.cc
src/macro/Directives.cc
+2
-2
2 additions, 2 deletions
src/macro/Directives.cc
src/macro/Driver.cc
+3
-4
3 additions, 4 deletions
src/macro/Driver.cc
src/macro/Driver.hh
+3
-6
3 additions, 6 deletions
src/macro/Driver.hh
with
10 additions
and
14 deletions
src/MacroExpandModFile.cc
+
2
−
2
View file @
d36eb82b
/*
/*
* Copyright © 2015-202
0
Dynare Team
* Copyright © 2015-202
3
Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -35,7 +35,7 @@ macroExpandModFile(const string &filename, const string &basename, const istream
...
@@ -35,7 +35,7 @@ macroExpandModFile(const string &filename, const string &basename, const istream
stringstream
macro_output
;
stringstream
macro_output
;
macro
::
Environment
env
=
macro
::
Environment
();
macro
::
Environment
env
=
macro
::
Environment
();
macro
::
Driver
m
;
macro
::
Driver
m
;
m
.
parse
(
filename
,
basename
,
modfile
,
debug
,
defines
,
env
,
paths
,
macro_output
);
m
.
parse
(
filename
,
modfile
,
debug
,
defines
,
env
,
paths
,
macro_output
);
if
(
save_macro
)
if
(
save_macro
)
{
{
if
(
save_macro_file
.
empty
())
if
(
save_macro_file
.
empty
())
...
...
This diff is collapsed.
Click to expand it.
src/macro/Directives.cc
+
2
−
2
View file @
d36eb82b
/*
/*
* Copyright © 2019-202
2
Dynare Team
* Copyright © 2019-202
3
Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -77,7 +77,7 @@ Include::interpret(ostream &output, Environment &env, vector<filesystem::path> &
...
@@ -77,7 +77,7 @@ Include::interpret(ostream &output, Environment &env, vector<filesystem::path> &
bug in GCC/MinGW 10.2 (shipped in Debian “Bullseye” 11), that fails
bug in GCC/MinGW 10.2 (shipped in Debian “Bullseye” 11), that fails
to accept implicit conversion to string from filename::path. See
to accept implicit conversion to string from filename::path. See
https://en.cppreference.com/w/cpp/filesystem/path/native. */
https://en.cppreference.com/w/cpp/filesystem/path/native. */
m
.
parse
(
filename
.
string
(),
filename
.
stem
().
string
(),
incfile
,
false
,
{},
env
,
paths
,
output
);
m
.
parse
(
filename
.
string
(),
incfile
,
false
,
{},
env
,
paths
,
output
);
}
}
catch
(
StackTrace
&
ex
)
catch
(
StackTrace
&
ex
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/macro/Driver.cc
+
3
−
4
View file @
d36eb82b
/*
/*
* Copyright © 2019-202
2
Dynare Team
* Copyright © 2019-202
3
Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -25,12 +25,11 @@
...
@@ -25,12 +25,11 @@
using
namespace
macro
;
using
namespace
macro
;
void
void
Driver
::
parse
(
const
string
&
file_arg
,
const
string
&
basename_arg
,
const
istream
&
modfile
,
Driver
::
parse
(
const
string
&
file_arg
,
const
istream
&
modfile
,
bool
debug
,
const
vector
<
pair
<
string
,
string
>>
&
defines
,
bool
debug
,
const
vector
<
pair
<
string
,
string
>>
&
defines
,
Environment
&
env
,
vector
<
filesystem
::
path
>
&
paths
,
ostream
&
output
)
Environment
&
env
,
vector
<
filesystem
::
path
>
&
paths
,
ostream
&
output
)
{
{
file
=
file_arg
;
file
=
file_arg
;
basename
=
basename_arg
;
if
(
!
defines
.
empty
())
if
(
!
defines
.
empty
())
{
{
...
@@ -39,7 +38,7 @@ Driver::parse(const string &file_arg, const string &basename_arg, const istream
...
@@ -39,7 +38,7 @@ Driver::parse(const string &file_arg, const string &basename_arg, const istream
command_line_defines_with_endl
<<
"@#define "
<<
var
<<
" = "
<<
val
<<
endl
;
command_line_defines_with_endl
<<
"@#define "
<<
var
<<
" = "
<<
val
<<
endl
;
Driver
m
;
Driver
m
;
istream
is
(
command_line_defines_with_endl
.
rdbuf
());
istream
is
(
command_line_defines_with_endl
.
rdbuf
());
m
.
parse
(
"command_line_defines"
,
"command_line_defines"
,
is
,
debug
,
{},
env
,
paths
,
output
);
m
.
parse
(
"command_line_defines"
,
is
,
debug
,
{},
env
,
paths
,
output
);
}
}
stringstream
file_with_endl
;
stringstream
file_with_endl
;
...
...
This diff is collapsed.
Click to expand it.
src/macro/Driver.hh
+
3
−
6
View file @
d36eb82b
/*
/*
* Copyright © 2019-202
2
Dynare Team
* Copyright © 2019-202
3
Dynare Team
*
*
* This file is part of Dynare.
* This file is part of Dynare.
*
*
...
@@ -76,16 +76,13 @@ namespace macro
...
@@ -76,16 +76,13 @@ namespace macro
//! Starts parsing a file, modifies `env`, `paths` and `output`
//! Starts parsing a file, modifies `env`, `paths` and `output`
//! as they are modified by various macro directives
//! as they are modified by various macro directives
void
parse
(
const
string
&
file
,
const
string
&
basename
,
const
istream
&
modfile
,
void
parse
(
const
string
&
file
,
const
istream
&
modfile
,
bool
debug
,
const
vector
<
pair
<
string
,
string
>>
&
defines
,
bool
debug
,
const
vector
<
pair
<
string
,
string
>>
&
defines
,
Environment
&
env
,
vector
<
filesystem
::
path
>
&
paths
,
ostream
&
output
);
Environment
&
env
,
vector
<
filesystem
::
path
>
&
paths
,
ostream
&
output
);
//! Name of main file being parsed
//! Name of main file being parsed
(for error reporting purposes)
string
file
;
string
file
;
//! Basename of main file being parsed
string
basename
;
//! Reference to the lexer
//! Reference to the lexer
unique_ptr
<
TokenizerFlex
>
lexer
;
unique_ptr
<
TokenizerFlex
>
lexer
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment