Macro-processor: when a variable is defined without a value, set it to “true”
Previously it was set to 1. Also do the same change for variable defined on the command-line, for consistency. Closes: #43master
parent
2a68f5a3af
commit
41b1e89756
|
@ -290,7 +290,7 @@ main(int argc, char **argv)
|
|||
equal_index != string::npos)
|
||||
defines.emplace_back(s.substr(2, equal_index-2), s.substr(equal_index+1));
|
||||
else
|
||||
defines.emplace_back(s.substr(2), "1");
|
||||
defines.emplace_back(s.substr(2), "true");
|
||||
}
|
||||
else if (s.substr(0, 2) == "-I")
|
||||
{
|
||||
|
|
|
@ -135,10 +135,7 @@ directive_one_line : INCLUDE expr
|
|||
| INCLUDEPATH expr
|
||||
{ $$ = make_shared<IncludePath>($2, @$); }
|
||||
| DEFINE symbol
|
||||
{
|
||||
auto tmp = make_shared<Real>("1", @$);
|
||||
$$ = make_shared<Define>($2, tmp, @$);
|
||||
}
|
||||
{ $$ = make_shared<Define>($2, make_shared<Bool>(true, @$), @$); }
|
||||
| DEFINE symbol EQUAL expr
|
||||
{ $$ = make_shared<Define>($2, $4, @$); }
|
||||
| DEFINE function EQUAL expr
|
||||
|
|
Loading…
Reference in New Issue