Lables: break and continue accept only string literals

This commit is contained in:
Andrey Breslav
2011-01-12 19:17:27 +03:00
parent 78b5f0f2b8
commit 06a70a8a40
4 changed files with 28 additions and 17 deletions
+7 -2
View File
@@ -191,11 +191,16 @@ infixFunctionCall
jump
: "throw" expression
: "return" expression?
: "continue" SimpleName
: "break" SimpleName
: "continue" stringLiteral?
: "break" stringLiteral?
// yield ?
;
stringLiteral
: StringWithTemplates
: NoEscapeString
;
tupleLiteral // Ambiguity when after a SimpleName (infix call). In this case (e) is treated as an expression in parentheses
// to put a tuple, write write ((e))
: "(" ((SimpleName "=")? expression){","} ")"