macro processor: allow for the definition of a variable without a value
- by default, set the value of the variable to `1`, as is done on the command line with the `-D` flag issue #43issue#70
parent
4a68f8a38d
commit
abedb47573
|
@ -1,6 +1,6 @@
|
|||
// -*- C++ -*-
|
||||
/*
|
||||
* Copyright © 2019 Dynare Team
|
||||
* Copyright © 2019-2020 Dynare Team
|
||||
*
|
||||
* This file is part of Dynare.
|
||||
*
|
||||
|
@ -129,6 +129,11 @@ directive_one_line : INCLUDE expr
|
|||
{ $$ = make_shared<Include>($2, driver.env, @$); }
|
||||
| INCLUDEPATH expr
|
||||
{ $$ = make_shared<IncludePath>($2, driver.env, @$); }
|
||||
| DEFINE symbol
|
||||
{
|
||||
auto tmp = make_shared<Real>("1", driver.env, @$);
|
||||
$$ = make_shared<Define>($2, tmp, driver.env, @$);
|
||||
}
|
||||
| DEFINE symbol EQUAL expr
|
||||
{ $$ = make_shared<Define>($2, $4, driver.env, @$); }
|
||||
| DEFINE function EQUAL expr
|
||||
|
|
Loading…
Reference in New Issue