X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fparser.mly;fp=src%2Fparser.mly;h=57a0c5cdb59b912d342b61097e385db49cb6ea69;hb=e23952e03c37201fe805ad3d1635e7d2d41e5908;hp=9d6988b28ae3a8d266eb5cb8f4f92b569ac37171;hpb=bf91d4bb90c84d360609ffb30a68cf8adb5b1448;p=goals.git diff --git a/src/parser.mly b/src/parser.mly index 9d6988b..57a0c5c 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -87,7 +87,7 @@ let do_include env loc filename optflag file = (* Start nonterminals. *) %start file -%start expr +%start expr_only %% file: @@ -176,6 +176,13 @@ params: | LEFT_PAREN separated_list(COMMA, expr) RIGHT_PAREN { $2 } ; +(* This is used by Parse.parse_expr where we have to parse + * a standalone string (eg. from the command line). + *) +expr_only: + | expr EOF { $1 } + ; + (* http://gallium.inria.fr/blog/lr-lists/ *) right_flexible_list(delim, X): | (* nothing *) { [] }