tweak: allow top level expression (e.g., a number)

This commit is contained in:
NunoSempere 2023-04-30 00:49:56 -04:00
parent c3720d0951
commit 3cb4d4eb83
2 changed files with 1 additions and 1 deletions

BIN
mumble

Binary file not shown.

View File

@ -22,7 +22,7 @@ int main(int argc, char** argv)
number : /-?[0-9]+/ ; \ number : /-?[0-9]+/ ; \
operator : '+' | '-' | '*' | '/' ; \ operator : '+' | '-' | '*' | '/' ; \
expr : <number> | '(' <operator> <expr>+ ')' ; \ expr : <number> | '(' <operator> <expr>+ ')' ; \
mumble : /^/ <operator> <expr>+ /$/ ; \ mumble : /^/ <operator> <expr>+ | <expr>/$/ ; \
", ",
Number, Operator, Expr, Mumble); Number, Operator, Expr, Mumble);