Match implemented. Not tested yet.
This commit is contained in:
@@ -103,8 +103,9 @@ literalConstant
|
||||
: StringWithTemplates
|
||||
: NoEscapeString
|
||||
: IntegerLiteral
|
||||
: HexadecimalLiteral
|
||||
: LongLiteral
|
||||
: CharacterLiteral
|
||||
: FloatLiteral
|
||||
: "null"
|
||||
;
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ match
|
||||
out
|
||||
ref
|
||||
try
|
||||
case
|
||||
|
||||
Soft:
|
||||
wraps -- in a class header
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
matchEntry
|
||||
: attributes "case" pattern ("if" "(" expression ")")? "=>" expression // TODO: Consider other options than "=>"
|
||||
: attributes "case" pattern ("if" "(" expression ")")? "=>" expression SEMI? // TODO: Consider other options than "=>"
|
||||
;
|
||||
|
||||
pattern
|
||||
: constantPattern // literal
|
||||
: variablePattern // variable from the context
|
||||
: SimpleName // variable from the context
|
||||
: tuplePattern
|
||||
: bindingPattern // we allow non-linear patterns
|
||||
: decomposerPattern // labeled components are allowed
|
||||
: arrowPattern
|
||||
;
|
||||
|
||||
constantPattern
|
||||
@@ -27,7 +26,3 @@ bindingPattern
|
||||
decomposerPattern
|
||||
: userType tuplePattern?
|
||||
;
|
||||
|
||||
arrowPattern
|
||||
: pattern "->" pattern
|
||||
;
|
||||
Reference in New Issue
Block a user