diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2005-12-19 11:44:04 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2005-12-19 11:44:04 +0000 |
commit | d6c0efe5b4b89a0337f1cdcdabf8c607d81f4ae1 (patch) | |
tree | 561cdb3f58b8f3b964a727f5c27c2aeb0a5705f9 /sources/scala/tools/nsc/ast/parser/Parsers.scala | |
parent | 2f7430a2779cf675c21e8e6170a481dac1c88152 (diff) | |
download | scala-d6c0efe5b4b89a0337f1cdcdabf8c607d81f4ae1.tar.gz scala-d6c0efe5b4b89a0337f1cdcdabf8c607d81f4ae1.tar.bz2 scala-d6c0efe5b4b89a0337f1cdcdabf8c607d81f4ae1.zip |
Updated parser to fix ref locations.
Diffstat (limited to 'sources/scala/tools/nsc/ast/parser/Parsers.scala')
-rw-r--r-- | sources/scala/tools/nsc/ast/parser/Parsers.scala | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sources/scala/tools/nsc/ast/parser/Parsers.scala b/sources/scala/tools/nsc/ast/parser/Parsers.scala index 0fbfac53c1..0634ace4d0 100644 --- a/sources/scala/tools/nsc/ast/parser/Parsers.scala +++ b/sources/scala/tools/nsc/ast/parser/Parsers.scala @@ -324,14 +324,14 @@ import Tokens._; if (in.token == THIS) { t = atPos(in.skipToken()) { This(nme.EMPTY.toTypeName) } if (!thisOK || in.token == DOT) - t = atPos(accept(DOT)) { selectors(t, typeOK) } + t = { selectors(t, typeOK, accept(DOT)) } } else if (in.token == SUPER) { t = atPos(in.skipToken()) { Super(nme.EMPTY.toTypeName, mixinQualifierOpt()) } t = atPos(accept(DOT)) { Select(t, ident()) } if (in.token == DOT) - t = atPos(in.skipToken()) { selectors(t, typeOK) } + t = { selectors(t, typeOK, in.skipToken()) } } else { val i = atPos(in.currentPos) { Ident(ident()) } t = i; @@ -341,28 +341,28 @@ import Tokens._; in.nextToken(); t = atPos(i.pos) { This(i.name.toTypeName) } if (!thisOK || in.token == DOT) - t = atPos(accept(DOT)) { selectors(t, typeOK) } + t = { selectors(t, typeOK, accept(DOT)) } } else if (in.token == SUPER) { in.nextToken(); t = atPos(i.pos) { Super(i.name.toTypeName, mixinQualifierOpt()) } t = atPos(accept(DOT)) { Select(t, ident())} if (in.token == DOT) - t = atPos(in.skipToken()) { selectors(t, typeOK) } + t = { selectors(t, typeOK, in.skipToken()) } } else { - t = atPos(pos) { selectors(t, typeOK) } + t = { selectors(t, typeOK, pos) } } } } t } - def selectors(t: Tree, typeOK: boolean): Tree = + def selectors(t: Tree, typeOK: boolean, pos : Int): Tree = if (typeOK && in.token == TYPE) { in.nextToken(); - SingletonTypeTree(t) + atPos(pos) { SingletonTypeTree(t) } } else { - val t1 = Select(t, ident()); - if (in.token == DOT) atPos(in.skipToken()) { selectors(t1, typeOK) } + val t1 = atPos(pos) { Select(t, ident()); } + if (in.token == DOT) { selectors(t1, typeOK, in.skipToken()) } else t1 } @@ -389,7 +389,7 @@ import Tokens._; */ def qualId(): Tree = { val id = atPos(in.currentPos) { Ident(ident()) } - if (in.token == DOT) atPos(in.skipToken()) { selectors(id, false) } + if (in.token == DOT) { selectors(id, false, in.skipToken()) } else id } |