diff options
author | buraq <buraq@epfl.ch> | 2003-07-16 12:22:37 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-07-16 12:22:37 +0000 |
commit | 316f425492d319fe7c4769c35bee6702f43adba5 (patch) | |
tree | e6c1d92c1bd2caed059ad192b68e9796a7c44062 /sources/scalac/ast | |
parent | a5fdf3ec18bcbbe0fbc521e1820c2d7be49d4a6c (diff) | |
download | scala-316f425492d319fe7c4769c35bee6702f43adba5.tar.gz scala-316f425492d319fe7c4769c35bee6702f43adba5.tar.bz2 scala-316f425492d319fe7c4769c35bee6702f43adba5.zip |
fixed overly permissive parsing of TreePattern ...
fixed overly permissive parsing of TreePattern ( SimplePat Id SimplePat,
op2 must not be empty sequence )
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r-- | sources/scalac/ast/parser/Parser.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java index b5aa598f23..d5b3522367 100644 --- a/sources/scalac/ast/parser/Parser.java +++ b/sources/scalac/ast/parser/Parser.java @@ -1123,7 +1123,7 @@ public class Parser implements Tokens { /** TreePattern ::= varid `:' Type1 * | `_' `:' Type1 * | SimplePattern [ '*' | '?' | '+' ] - * | SimplePattern {Id SimplePattern} + * | SimplePattern {Id SimplePattern} // op2 must not be empty */ Tree treePattern() { int base = sp; @@ -1175,6 +1175,9 @@ public class Parser implements Tokens { push(top, s.pos, s.name); ident(); top = simplePattern(); + if( TreeInfo.isEmptySequence( top ) ) { + syntaxError( top.pos, "empty sequence not allowed here", false); + } } return reduceStack(false, base, top, 0, true); } |