Skip to content
Snippets Groups Projects
Verified Commit d36eb82b authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Macro processor: removed unused “basename” variable

parent 1f3ff760
No related branches found
No related tags found
No related merge requests found
/* /*
* Copyright © 2015-2020 Dynare Team * Copyright © 2015-2023 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())
......
/* /*
* Copyright © 2019-2022 Dynare Team * Copyright © 2019-2023 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)
{ {
......
/* /*
* Copyright © 2019-2022 Dynare Team * Copyright © 2019-2023 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;
......
/* /*
* Copyright © 2019-2022 Dynare Team * Copyright © 2019-2023 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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment