diff options
author | Martin Odersky <odersky@gmail.com> | 2005-10-11 20:28:06 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2005-10-11 20:28:06 +0000 |
commit | 76993fa93bc39bab65e61b4fa9a3887befd48372 (patch) | |
tree | 71186c566ccdb15b5264f6e649a67212cc246feb /sources/scala/tools/nsc/ast/parser/Parsers.scala | |
parent | 899e2bf1b2aac960ba459cc1e1667ac05cf5b2cc (diff) | |
download | scala-76993fa93bc39bab65e61b4fa9a3887befd48372.tar.gz scala-76993fa93bc39bab65e61b4fa9a3887befd48372.tar.bz2 scala-76993fa93bc39bab65e61b4fa9a3887befd48372.zip |
*** empty log message ***
Diffstat (limited to 'sources/scala/tools/nsc/ast/parser/Parsers.scala')
-rwxr-xr-x | sources/scala/tools/nsc/ast/parser/Parsers.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sources/scala/tools/nsc/ast/parser/Parsers.scala b/sources/scala/tools/nsc/ast/parser/Parsers.scala index 59eaa4eb47..d8a4f9e49d 100755 --- a/sources/scala/tools/nsc/ast/parser/Parsers.scala +++ b/sources/scala/tools/nsc/ast/parser/Parsers.scala @@ -436,10 +436,10 @@ import Tokens._; if (in.token == COLON) { in.nextToken(); typ() } else TypeTree(); - /** SimpleTypedOpt ::= [`:' SimpleType] + /** RequiresTypedOpt ::= [`:' SimpleType | requires SimpleType] */ - def simpleTypedOpt(): Tree = - if (in.token == COLON) { in.nextToken(); simpleType() } + def requiresTypeOpt(): Tree = + if (in.token == COLON | in.token == REQUIRES) { in.nextToken(); simpleType() } else TypeTree(); /** Types ::= Type {`,' Type} @@ -1484,7 +1484,7 @@ import Tokens._; EmptyTree } - /** ClassDef ::= ClassSig [`:' SimpleType] ClassTemplate + /** ClassDef ::= ClassSig RequiresTypeOpt ClassTemplate * ClassSig ::= Id [TypeParamClause] {ClassParamClause} */ def classDef(mods: int): Tree = @@ -1494,7 +1494,7 @@ import Tokens._; val tparams = typeParamClauseOpt(name, implicitViews); if ((mods & Flags.CASE) != 0 && in.token != LPAREN) accept(LPAREN); val vparamss = paramClauses(name, implicitViews.toList, (mods & Flags.CASE) != 0); - val thistpe = simpleTypedOpt(); + val thistpe = requiresTypeOpt(); val template = classTemplate(mods, name, vparamss); ClassDef(mods, name, tparams, thistpe, template) } |