diff options
author | Martin Odersky <odersky@gmail.com> | 2007-01-30 15:17:05 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-01-30 15:17:05 +0000 |
commit | 4a64ac9c7b94b249087cd25712dfb547013f5ed4 (patch) | |
tree | aa884033db150ebde48d2027d29bbc5f3723b9f1 /src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | |
parent | 2f4c6a2eb8405eaa6d54a8d29f33f4595da7d1c7 (diff) | |
download | scala-4a64ac9c7b94b249087cd25712dfb547013f5ed4.tar.gz scala-4a64ac9c7b94b249087cd25712dfb547013f5ed4.tar.bz2 scala-4a64ac9c7b94b249087cd25712dfb547013f5ed4.zip |
fixed flathashtable.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 53314b4581..6f26578833 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -287,18 +287,20 @@ trait Parsers requires SyntaxAnalyzer { /** make closure from tree */ def makeClosure(tree: Tree): Tree = { val pname: Name = unit.fresh.newName("x$") - def insertParam(tree: Tree): Tree = tree match { - case Ident(name) => - Select(Ident(pname), name) - case Select(qual, name) => - Select(insertParam(qual), name) - case Apply(fn, args) => - Apply(insertParam(fn), args) - case TypeApply(fn, args) => - TypeApply(insertParam(fn), args) - case _ => - syntaxError(tree.pos, "cannot convert to closure", false) - errorTermTree + def insertParam(tree: Tree): Tree = atPos(tree.pos) { + tree match { + case Ident(name) => + Select(Ident(pname), name) + case Select(qual, name) => + Select(insertParam(qual), name) + case Apply(fn, args) => + Apply(insertParam(fn), args) + case TypeApply(fn, args) => + TypeApply(insertParam(fn), args) + case _ => + syntaxError(tree.pos, "cannot convert to closure", false) + errorTermTree + } } Function( @@ -507,7 +509,8 @@ trait Parsers requires SyntaxAnalyzer { atPos(pos) { var symid = scalaDot(nme.Symbol) if (isPattern) { symid = convertToTypeId(symid) } - Apply(symid, List(t)) + val symobj = Apply(symid, List(t)) + if (isPattern) symobj else Select(symobj, nme.intern) } } else { t @@ -1266,7 +1269,8 @@ trait Parsers requires SyntaxAnalyzer { if (name == nme.WILDCARD) { in.nextToken(); pattern3(seqOK) } else if (treeInfo.isVarPattern(p)) { - atPos(in.skipToken()) { Bind(name, pattern3(seqOK)) } + in.nextToken() + atPos(p.pos) { Bind(name, pattern3(seqOK)) } } else { p } |