Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Don't accept partial functions in the parser except in function calls


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18517 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 19, 2013
1 parent fd504b6 commit cd5c422
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Parser/Modelica.g
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,6 @@ expression returns [void* ast] :
( e=if_expression { ast = e; }
| e=simple_expression { ast = e; }
| e=code_expression { ast = e; }
| e=part_eval_function_expression { ast = e; }
| e=match_expression { ast = e; }
)
;
Expand Down Expand Up @@ -1368,7 +1367,7 @@ function_arguments returns [void* ast]
for_or_expression_list returns [void* ast, int isFor]
@init{ e = 0; el = 0; forind = 0; } :
( {LA(1)==IDENT || LA(1)==OPERATOR && LA(2) == EQUALS || LA(1) == RPAR || LA(1) == RBRACE}? { $ast = mk_nil(); $isFor = 0; }
| ( e=expression
| ( (e=expression | e=part_eval_function_expression)
( (COMMA el=for_or_expression_list2)
| (FOR forind=for_indices)
)?
Expand All @@ -1389,7 +1388,7 @@ for_or_expression_list returns [void* ast, int isFor]
for_or_expression_list2 returns [void* ast]
@init{ e = 0; el = 0; } :
{LA(2) == EQUALS}? { ast = mk_nil(); }
| e=expression (COMMA el=for_or_expression_list2)? { ast = mk_cons(e, or_nil(el)); }
| (e=expression | e=part_eval_function_expression) (COMMA el=for_or_expression_list2)? { ast = mk_cons(e, or_nil(el)); }
;
named_arguments returns [void* ast]
Expand All @@ -1399,7 +1398,7 @@ named_arguments returns [void* ast]
named_argument returns [void* ast]
@init{ id = 0; e = 0; } :
( id=IDENT | id=OPERATOR) EQUALS e=expression { ast = Absyn__NAMEDARG(token_to_scon(id),e); }
( id=IDENT | id=OPERATOR) EQUALS (e=expression | e=part_eval_function_expression) { ast = Absyn__NAMEDARG(token_to_scon(id),e); }
;
output_expression_list [int* isTuple] returns [void* ast]
Expand Down

0 comments on commit cd5c422

Please sign in to comment.