Commit 7784d17f authored by Julien Lopez's avatar Julien Lopez
Browse files

[TESTS][LAMBDA][MINOR] Fix GRAMMAR

parent a26c2fe2
......@@ -12,7 +12,7 @@ expr = id
| expr "*" expr
| expr "/" expr
| expr "%" expr
| expr "{" id "/" type_id sigma "}"
| expr "{" id "/" type_id sigma "}" (* type substitutions *)
| "(" expr ")"
| "[" listexpr "]"
| "match" expr ":" type_id "with" "|" match_value "->" expr branches
......@@ -41,22 +41,25 @@ params = (* empty *)
branches = (* empty *)
| "|" match_value "->" expr branches
(* Note: The first character of an id is lower case (or '_'), the first
character of a type is upper case *)
id = [a-z_][A-Za-z0-9_]*
type_id = [A-Z][A-Za-z0-9_]*
| "'"[A-Z][A-Za-z0-9_]*
| "'"[A-Z][A-Za-z0-9_]* "{" id "/" type_id sigma "}"
| "[" complex_type_id "]"
| "(" complex_type_id ")"
complex_type_id = [A-Z][A-Za-z0-9_]*
| "'"[A-Z][A-Za-z0-9_]*
(* One must precise a set of type substitutions on a type variable, at least a
empty one : α = 'A{} *)
| "'"[A-Z][A-Za-z0-9_]* "{" id "/" type_id sigma "}"
| complex_type_id "*" complex_type_id
| complex_type_id "|" complex_type_id
| complex_type_id "&" complex_type_id
| "!" complex_type_id
| complex_type_id -> complex_type_id
| complex_type_id "->" complex_type_id
| "[" complex_type_id "]"
| "(" complex_type_id ")"
......
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