Macro processor: removed unused “basename” variable
parent
1f3ff760e1
commit
d36eb82b7c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2015-2020 Dynare Team
|
||||
* Copyright © 2015-2023 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -35,7 +35,7 @@ macroExpandModFile(const string &filename, const string &basename, const istream
|
|||
stringstream macro_output;
|
||||
macro::Environment env = macro::Environment();
|
||||
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_file.empty())
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2019-2022 Dynare Team
|
||||
* Copyright © 2019-2023 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -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
|
||||
to accept implicit conversion to string from filename::path. See
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2019-2022 Dynare Team
|
||||
* Copyright © 2019-2023 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -25,12 +25,11 @@
|
|||
using namespace macro;
|
||||
|
||||
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,
|
||||
Environment &env, vector<filesystem::path> &paths, ostream &output)
|
||||
{
|
||||
file = file_arg;
|
||||
basename = basename_arg;
|
||||
|
||||
if (!defines.empty())
|
||||
{
|
||||
|
@ -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;
|
||||
Driver m;
|
||||
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;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2019-2022 Dynare Team
|
||||
* Copyright © 2019-2023 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -76,16 +76,13 @@ namespace macro
|
|||
|
||||
//! Starts parsing a file, modifies `env`, `paths` and `output`
|
||||
//! 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,
|
||||
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;
|
||||
|
||||
//! Basename of main file being parsed
|
||||
string basename;
|
||||
|
||||
//! Reference to the lexer
|
||||
unique_ptr<TokenizerFlex> lexer;
|
||||
|
||||
|
|
Loading…
Reference in New Issue