Matches reorganized
This commit is contained in:
@@ -2,15 +2,6 @@ if
|
|||||||
: "if" "(" expression ")" expression ("else" expression)?
|
: "if" "(" expression ")" expression ("else" expression)?
|
||||||
;
|
;
|
||||||
|
|
||||||
match
|
|
||||||
: expression "match" "{" matchEntry+ "}"
|
|
||||||
;
|
|
||||||
|
|
||||||
matchEntry
|
|
||||||
: "case" pattern "=>" expression // TODO: Consider other options than "=>"
|
|
||||||
: "else" "=>" expression // TODO: keyword
|
|
||||||
;
|
|
||||||
|
|
||||||
for
|
for
|
||||||
: "for" "(" valOrVar? (SimpleName | parameter) "in" expression ")" expression
|
: "for" "(" valOrVar? (SimpleName | parameter) "in" expression ")" expression
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
match
|
||||||
|
: expression "match" "{" matchEntry+ "}"
|
||||||
|
;
|
||||||
|
|
||||||
|
matchEntry
|
||||||
|
: "case" pattern "=>" expression // TODO: Consider other options than "=>"
|
||||||
|
: "else" "=>" expression // TODO: keyword
|
||||||
|
;
|
||||||
|
|
||||||
|
pattern
|
||||||
|
: SimpleName
|
||||||
|
: expression
|
||||||
|
: // TODO: how to write the typeswitch?
|
||||||
|
;
|
||||||
Reference in New Issue
Block a user