diff options
author | buraq <buraq@epfl.ch> | 2003-12-03 15:40:59 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-12-03 15:40:59 +0000 |
commit | bdb4c6d897d5f5a21c530e8ee553b2d1826693db (patch) | |
tree | d6314d1c3d30f5f79a981248dae279885ce3189c /sources/scalac | |
parent | 3743c70592f744056b048f52dcab33918df19cb4 (diff) | |
download | scala-bdb4c6d897d5f5a21c530e8ee553b2d1826693db.tar.gz scala-bdb4c6d897d5f5a21c530e8ee553b2d1826693db.tar.bz2 scala-bdb4c6d897d5f5a21c530e8ee553b2d1826693db.zip |
a possible fix of bug#246
Diffstat (limited to 'sources/scalac')
-rw-r--r-- | sources/scalac/ast/parser/Parser.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java index 0f5a0b6a1f..5b698764ad 100644 --- a/sources/scalac/ast/parser/Parser.java +++ b/sources/scalac/ast/parser/Parser.java @@ -794,7 +794,6 @@ public class Parser implements Tokens { /** Exprs ::= Expr {`,' Expr} * | Expr `:' `_' `*' - */ Tree[] exprs() { TreeList ts = new TreeList(); ts.append(expr(true)); @@ -804,6 +803,19 @@ public class Parser implements Tokens { } return ts.toArray(); } + */ + + /** Exprs ::= Expr {`,' Expr} + */ + Tree[] exprs() { + TreeList ts = new TreeList(); + ts.append(expr(true)); + while (s.token == COMMA) { + s.nextToken(); + ts.append(expr(true)); + } + return ts.toArray(); + } /** Expr ::= Bindings `=>' Expr * | if `(' Expr `)' Expr [[`;'] else Expr] @@ -912,6 +924,11 @@ public class Parser implements Tokens { int pos1 = s.skipToken(); if (s.token == IDENTIFIER && s.name == Names.STAR) { s.nextToken(); + /* this hack new */ + if( s.token != RPAREN ) { + syntaxError(s.pos, " escaping sequences only allowed for last argument", true); + } + /* end hack */ t = make.Typed( pos, t, make.Ident(pos1, TypeNames.WILDCARD_STAR)); } else { |