Labels
This commit is contained in:
@@ -82,7 +82,7 @@ atomicExpression
|
||||
: literalConstant
|
||||
: functionLiteral
|
||||
: tupleLiteral
|
||||
: "this" ("<" type ">")?
|
||||
: "this" label? ("<" type ">")?
|
||||
: if
|
||||
: when
|
||||
: try
|
||||
@@ -97,6 +97,12 @@ atomicExpression
|
||||
: "namespace" // for the root namespace
|
||||
;
|
||||
|
||||
label
|
||||
: "@"
|
||||
: "@@"
|
||||
: LabelName
|
||||
;
|
||||
|
||||
literalConstant
|
||||
: "true" | "false"
|
||||
: StringWithTemplates
|
||||
@@ -163,12 +169,13 @@ prefixUnaryOperation
|
||||
: "++" : "--"
|
||||
: "!" // No ~
|
||||
: attributes // mandatory
|
||||
: label
|
||||
;
|
||||
|
||||
postfixUnaryOperation
|
||||
: "++" : "--"
|
||||
: typeArguments? valueArguments
|
||||
: typeArguments
|
||||
: typeArguments? valueArguments (label? functionLiteral)
|
||||
: typeArguments (label? functionLiteral)
|
||||
: arrayAccess
|
||||
: memberAccessOperation postfixUnaryOperation // TODO: Review
|
||||
;
|
||||
@@ -187,9 +194,9 @@ valueArguments
|
||||
|
||||
jump
|
||||
: "throw" expression
|
||||
: "return" expression?
|
||||
: "continue" stringLiteral?
|
||||
: "break" stringLiteral?
|
||||
: "return" label? expression?
|
||||
: "continue" label?
|
||||
: "break" label?
|
||||
// yield ?
|
||||
;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
SimpleName : /*java identifier*/;
|
||||
FieldName : "$" SimpleName;
|
||||
LabelName : "@" SimpleName;
|
||||
[helper] Digit : ["0".."9"];
|
||||
IntegerLiteral : Digit+ "L"?
|
||||
[helper] HexDigit : Digit | ["A"-"F", "a"-"f"];
|
||||
|
||||
Reference in New Issue
Block a user