diff options
author | Lex Spoon <lex@lexspoon.org> | 2007-09-04 07:36:00 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2007-09-04 07:36:00 +0000 |
commit | 1a8874d4726ead817f85420f440a28e9cf68aa48 (patch) | |
tree | ba5f3fe9213a358a3ff1ca98fd50a86186f858d1 /src/compiler | |
parent | 0d022af1945b57f62dac0d8d04f933004a71ed40 (diff) | |
download | scala-1a8874d4726ead817f85420f440a28e9cf68aa48.tar.gz scala-1a8874d4726ead817f85420f440a28e9cf68aa48.tar.bz2 scala-1a8874d4726ead817f85420f440a28e9cf68aa48.zip |
allow annotations on definitions inside of blocks
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 930dbe3710..04e83a5ebe 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2388,7 +2388,7 @@ trait Parsers { /** BlockStatSeq ::= { BlockStat semi } [ResultExpr] * BlockStat ::= Import - * | [implicit] [lazy] Def + * | Annotations [implicit] [lazy] Def * | LocalModifiers TmplDef * | Expr1 * | @@ -2414,7 +2414,10 @@ trait Parsers { if (inToken != RBRACE && inToken != CASE) acceptStatSep() } else if (isDefIntro) { localDef(NoMods) - } else if (isLocalModifier) { + } else if (isLocalModifier || inToken == AT) { + val annots = annotations() + localDef(modifiers() withAnnotations annots) + } else if (!isStatSep) { localDef(localModifiers()) } else if (isStatSep) { inNextToken |