Fix operator precedence

This commit is contained in:
백현웅 2022-02-15 00:08:40 +09:00
parent bacfd64bae
commit 27457eb6e2

View file

@ -17,18 +17,18 @@ let unexpected_token t =
* precedency, but infering precedence relation from the graph is hard
* and the graph can be made to have loops, I just used plain table. *)
let precedence = [
Eq, 1;
Neq, 1;
GE, 1;
LE, 1;
GT, 1;
LT, 1;
Add, 10;
Sub, 10;
Mul, 20;
Div, 20;
Mod, 30;
Exp, 30;
Eq, 100;
Neq, 100;
GE, 100;
LE, 100;
GT, 100;
LT, 100;
] |> List.to_seq |> Hashtbl.of_seq
let precedence_of op =