nostrict command-line option ignores extraneous assignments in initval. closes #1
parent
76714b34df
commit
f6c982c51b
|
@ -36,7 +36,7 @@ main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tm
|
|||
{
|
||||
WarningConsolidation warnings(no_warn);
|
||||
|
||||
ParsingDriver p(warnings);
|
||||
ParsingDriver p(warnings, nostrict);
|
||||
|
||||
// Do parsing and construct internal representation of mod file
|
||||
ModFile *mod_file = p.parse(in, debug);
|
||||
|
|
|
@ -401,6 +401,14 @@ ParsingDriver::init_param(string *name, expr_t rhs)
|
|||
void
|
||||
ParsingDriver::init_val(string *name, expr_t rhs)
|
||||
{
|
||||
if (nostrict)
|
||||
if (!mod_file->symbol_table.exists(*name))
|
||||
{
|
||||
warnings << "WARNING: discarding '" << *name << "' not recognized in initval statement" << endl;
|
||||
delete name;
|
||||
return;
|
||||
}
|
||||
|
||||
check_symbol_existence(*name);
|
||||
int symb_id = mod_file->symbol_table.getID(*name);
|
||||
SymbolType type = mod_file->symbol_table.getType(symb_id);
|
||||
|
|
|
@ -209,8 +209,10 @@ private:
|
|||
|
||||
WarningConsolidation &warnings;
|
||||
|
||||
bool nostrict;
|
||||
|
||||
public:
|
||||
ParsingDriver(WarningConsolidation &warnings_arg) : warnings(warnings_arg) { };
|
||||
ParsingDriver(WarningConsolidation &warnings_arg, bool nostrict_arg) : warnings(warnings_arg), nostrict(nostrict_arg) { };
|
||||
|
||||
//! Starts parsing, and constructs the MOD file representation
|
||||
/*! The returned pointer should be deleted after use */
|
||||
|
|
Loading…
Reference in New Issue