Commits

Sébastien Ferré committed d189db7

Addition of the 'try' construct.

  • Participants
  • Parent commits ceebc47

Comments (0)

Files changed (1)

File dcg/pa_dcg.ml

 	    | Some n -> n
 	    | None -> <:expr< ("regexp \"" ^ String.escaped $regexp$ ^ "\"") >> in
 	  <:expr< Matcher.get $name$ (Str.regexp $regexp$) Matcher.Token.repr >>
+      | "try"; e = expr LEVEL "top" ->
+	  let f = <:expr< fun () -> $e$ >> in
+	  <:expr< Dcg.trial $f$ >>
       | p = expr LEVEL "top" -> p
       ] ];