Matches reorganized

This commit is contained in:
Andrey Breslav
2010-11-25 18:21:52 +03:00
parent 96040138f5
commit ff3f7d8226
2 changed files with 14 additions and 9 deletions
-9
View File
@@ -2,15 +2,6 @@ if
: "if" "(" expression ")" expression ("else" expression)?
;
match
: expression "match" "{" matchEntry+ "}"
;
matchEntry
: "case" pattern "=>" expression // TODO: Consider other options than "=>"
: "else" "=>" expression // TODO: keyword
;
for
: "for" "(" valOrVar? (SimpleName | parameter) "in" expression ")" expression
;
+14
View File
@@ -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?
;