Commit 0a454b95 authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Allow arrows to appear in regular expressions.

parent 2e1726d1
Pipeline #184 failed with stages
in 3 minutes and 30 seconds
......@@ -531,7 +531,17 @@ field_pat:
regexp:
| x = regexp "|" y = regexp_concat {
| x = regexp_or "->" y = regexp {
match x, y with
Elem x, Elem y -> Elem (mk $sloc (Arrow (x, y)))
| _ -> parsing_error $sloc
"arrows not allowed in regular expression"
}
| r = regexp_or { r }
;
regexp_or:
| x = regexp_or "|" y = regexp_concat {
match x, y with
|Elem x, Elem y -> Elem (mk $sloc (Or (x, y)))
| _ -> Alt (x, y)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment