diff options
-rw-r--r-- | camlp4/compile/compile.ml | 3 | ||||
-rw-r--r-- | camlp4/etc/pa_o.ml | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/camlp4/compile/compile.ml b/camlp4/compile/compile.ml index d5f5e07fd..7e5582afe 100644 --- a/camlp4/compile/compile.ml +++ b/camlp4/compile/compile.ml @@ -551,9 +551,10 @@ value compile () = let pel = List.flatten pell in let si1 = <:str_item< value rec $list:pel$ >> in let si2 = + let list = List.sort compare keywords.val in <:str_item< List.iter (fun kw -> P.lexer.Token.using ("", kw)) - $expr_list keywords.val$ + $expr_list list$ >> in let loc = (1, 1) in diff --git a/camlp4/etc/pa_o.ml b/camlp4/etc/pa_o.ml index 92bbf33be..6b8815da2 100644 --- a/camlp4/etc/pa_o.ml +++ b/camlp4/etc/pa_o.ml @@ -157,7 +157,7 @@ value infixop0 = (parser [: `("", x) when - not (List.mem x excl) && String.length x >= 1 && + not (List.mem x excl) && String.length x >= 2 && List.mem x.[0] list && symbolchar x 1 :] -> x) ; @@ -557,6 +557,7 @@ EXTEND | e1 = SELF; "<>"; e2 = SELF -> <:expr< $e1$ <> $e2$ >> | e1 = SELF; "=="; e2 = SELF -> <:expr< $e1$ == $e2$ >> | e1 = SELF; "!="; e2 = SELF -> <:expr< $e1$ != $e2$ >> + | e1 = SELF; "$"; e2 = SELF -> <:expr< $lid:"\$"$ $e1$ $e2$ >> | e1 = SELF; op = infixop0; e2 = SELF -> <:expr< $lid:op$ $e1$ $e2$ >> ] | "^" RIGHTA [ e1 = SELF; "^"; e2 = SELF -> <:expr< $e1$ ^ $e2$ >> |