Skip to content
Snippets Groups Projects
Verified Commit abedb475 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

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 #43
parent 4a68f8a3
No related branches found
No related tags found
No related merge requests found
Pipeline #3239 passed
// -*- 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment