This commit is contained in:
Dmitry Boulytchev 2018-05-25 09:53:10 +03:00
parent 57588f2605
commit 72c963f60f
2 changed files with 23 additions and 3 deletions

View file

@ -231,13 +231,19 @@ module Expr =
!(Ostap.Util.expr
(fun x -> x)
(Array.map (fun (a, s) -> a,
List.map (fun s -> ostap(- $(s)), (fun x y -> Binop (s, x, y))) s
List.map (fun s -> ostap(- $(s)),
(fun x y ->
match s with
"++" -> Call ("strcat", [x; y])
| _ -> Binop (s, x, y)
)
) s
)
[|
`Lefta, ["!!"];
`Lefta, ["&&"];
`Nona , ["=="; "!="; "<="; "<"; ">="; ">"];
`Lefta, ["+" ; "-"];
`Lefta, ["++"; "+" ; "-"];
`Lefta, ["*" ; "/"; "%"];
|]
)