From f4a43858e8629180a3ccbae1202514266ea6db07 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 14 Mar 2003 11:56:02 +0000 Subject: *** empty log message *** --- sources/scalac/ast/parser/Parser.java | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'sources/scalac/ast') diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java index 45ce77899e..48c9689901 100644 --- a/sources/scalac/ast/parser/Parser.java +++ b/sources/scalac/ast/parser/Parser.java @@ -762,17 +762,18 @@ public class Parser implements Tokens { return t; } - /* SimpleExpr ::= literal + /* SimpleExpr ::= SimpleExpr1 + * | SimpleExpr ArgumentExprs + * | new Template + * | BlockExpr + * | `(' [Expr] `)' + * + * SimpleExpr1 ::= literal * | null * | StableRef * | super `.' Id * | SimpleExpr `.' Id - * | `(' [Expr] `)' - * | BlockExpr - * | SimpleExpr `@' TypeArgs - * | SimpleExpr ArgumentExprs - * | new Template - * | `_' + * | SimpleExpr TypeArgs */ Tree simpleExpr() { Tree t; @@ -835,7 +836,14 @@ public class Parser implements Tokens { t = make.Select(s.skipToken(), t, ident()); break; case LBRACKET: - t = make.TypeApply(s.pos, t, typeArgs()); + switch (t) { + case Ident(_): + case Select(_, _): + t = make.TypeApply(s.pos, t, typeArgs()); + break; + default: + return t; + } break; case LPAREN: case LBRACE: -- cgit v1.2.3