summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-12 03:00:05 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-12 03:00:05 +0100
commit482fceb4894ca1d27099accdeb520683824defce (patch)
tree5f792c9a8704579f9305c115265cf57e62132f7f
parent85b8dd76bb90ccac6292c59fd1b989320434b897 (diff)
downloadpetitcaml-482fceb4894ca1d27099accdeb520683824defce.tar.gz
petitcaml-482fceb4894ca1d27099accdeb520683824defce.tar.bz2
[petitcaml] parser.mly : update operators and improve errors
-rw-r--r--parser.mly30
1 files changed, 15 insertions, 15 deletions
diff --git a/parser.mly b/parser.mly
index 3b2c0e3..583c381 100644
--- a/parser.mly
+++ b/parser.mly
@@ -89,7 +89,7 @@ expr:
| e = simple_expr { e }
| func = simple_expr args = nonempty_list(simple_expr)
{ match args with
- | [] -> failwith "Unreachable matching"
+ | [] -> failwith "parser.mly / expr : Unreachable matching"
| arg::args ->
List.fold_left (fun base arg -> raw_expr (Ecall (base, arg)))
(locd_expr (Ecall (func, arg))
@@ -129,21 +129,21 @@ expr:
;
unopexpr:
-| MINUS e = expr %prec UMINUS { Eunop (Neg, e) }
-| NOT e = expr { Eunop (Not, e) }
+| MINUS e = expr %prec UMINUS { Eunop (ONeg, e) }
+| NOT e = expr { Eunop (ONot, e) }
;
%inline binop:
-| PLUS { Add }
-| MINUS { Sub }
-| TIMES { Mul }
-| DIV { Div }
-| AND { And }
-| OR { Or }
-| EQ { Eq }
-| NEQ { Neq }
-| LT { Lt }
-| LE { Le }
-| GT { Gt }
-| GE { Ge }
+| PLUS { OAdd }
+| MINUS { OSub }
+| TIMES { OMul }
+| DIV { ODiv }
+| AND { OAnd }
+| OR { OOr }
+| EQ { OEq }
+| NEQ { ONeq }
+| LT { OLt }
+| LE { OLe }
+| GT { OGt }
+| GE { OGe }
;