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

Macroprocessor: error out when length() operator called on a string or an int

Closes DynareTeam/Dynare#1547
parent 49e1c43a
Branches
Tags
No related merge requests found
...@@ -159,7 +159,7 @@ expr : INTEGER ...@@ -159,7 +159,7 @@ expr : INTEGER
} }
| NAME LPAREN array_expr RPAREN | NAME LPAREN array_expr RPAREN
{ TYPERR_CATCH($$ = driver.eval_string_function(*$1, $3), @$); delete $1; } { TYPERR_CATCH($$ = driver.eval_string_function(*$1, $3), @$); delete $1; }
| LENGTH LPAREN array_expr RPAREN | LENGTH LPAREN expr RPAREN
{ TYPERR_CATCH($$ = $3->length(), @$); } { TYPERR_CATCH($$ = $3->length(), @$); }
| LPAREN expr RPAREN | LPAREN expr RPAREN
{ $$ = $2; } { $$ = $2; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment