Fixed Ostap::expr interface to comply the spec

This commit is contained in:
Dmitry Boulytchev 2020-10-04 17:58:26 +03:00
parent 52281261c4
commit 0c38e4b1df
8 changed files with 8 additions and 8 deletions

View file

@ -6,7 +6,7 @@ local a = token ("a"),
sub = [token ("-"), fun (l, _, r) {Sub (l, r)}],
mul = [token ("*"), fun (l, _, r) {Mul (l, r)}],
div = [token ("/"), fun (l, _, r) {Div (l, r)}],
exp = expr ({[Left, {add, sub}], [Left, {mul, div}]}, a) (id);
exp = expr ({[Left, {add, sub}], [Left, {mul, div}]}, a);
printf ("%s\n", parseString (exp |> bypass (eof), "a").string);
printf ("%s\n", parseString (exp |> bypass (eof), "a+a").string);