diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 5 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index c0e231de6f..f85ffc8b4e 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2088,7 +2088,8 @@ trait Parsers requires SyntaxAnalyzer { in.token == TRAIT || in.token == OBJECT || in.token == CASEOBJECT || - in.token == LBRACKET || + in.token == LBRACKET || //todo: remove + in.token == AT || isModifier) { val annots = annotations() stats ++ joinComment(List(tmplDef(modifiers() withAnnotations annots))) @@ -2114,7 +2115,7 @@ trait Parsers requires SyntaxAnalyzer { stats ++= importClause() } else if (isExprIntro) { stats += expr() - } else if (isDefIntro || isModifier || in.token == LBRACKET) { + } else if (isDefIntro || isModifier || in.token == LBRACKET /*todo: remove */ || in.token == AT) { val annots = annotations() stats ++ joinComment(defOrDcl(modifiers() withAnnotations annots)) } else if (!isStatSep) { diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index ff0309a470..9c4dc59b96 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -444,7 +444,7 @@ trait Scanners requires SyntaxAnalyzer { def inFirstOfStat(token: int) = token match { case EOF | CASE | CATCH | ELSE | EXTENDS | FINALLY | MATCH | REQUIRES | WITH | YIELD | COMMA | SEMI | NEWLINE | NEWLINES | DOT | USCORE | COLON | EQUALS | ARROW | - LARROW | SUBTYPE | VIEWBOUND | SUPERTYPE | HASH | AT | + LARROW | SUBTYPE | VIEWBOUND | SUPERTYPE | HASH | // todo: add LBRACKET RPAREN | RBRACKET | RBRACE => false case _ => |