diff options
author | Miles Sabin <miles@milessabin.com> | 2010-02-18 21:51:39 +0000 |
---|---|---|
committer | Miles Sabin <miles@milessabin.com> | 2010-02-18 21:51:39 +0000 |
commit | a2da1ebe6165254e6ce28bf61857e18dff8b1e7f (patch) | |
tree | e6da953842d1c669ae70582bf3c74e8b0cbc0dc4 | |
parent | f592fb05203d0213243bbc072fe47a19856d1839 (diff) | |
download | scala-a2da1ebe6165254e6ce28bf61857e18dff8b1e7f.tar.gz scala-a2da1ebe6165254e6ce28bf61857e18dff8b1e7f.tar.bz2 scala-a2da1ebe6165254e6ce28bf61857e18dff8b1e7f.zip |
Patch from Mirko Stocker correcting start posti...
Patch from Mirko Stocker correcting start postions of import AST nodes
for refactoring and other tools. Review by community.
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 117fbde419..1c5fb05a72 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1896,14 +1896,14 @@ self => /** Import ::= import ImportExpr {`,' ImportExpr} */ def importClause(): List[Tree] = { - accept(IMPORT) - commaSeparated(importExpr()) + val offset = accept(IMPORT) + commaSeparated(importExpr(offset)) } /** ImportExpr ::= StableId `.' (Id | `_' | ImportSelectors) * XXX: Hook for IDE */ - def importExpr(): Tree = { + def importExpr(importOffset: Int): Tree = { val start = in.offset var t: Tree = null if (in.token == THIS) { @@ -1930,7 +1930,7 @@ self => if (in.token == USCORE) { val uscoreOffset = in.offset in.nextToken() - Import(t, List(ImportSelector(nme.WILDCARD, uscoreOffset, null, -1))) + Import(t, List(ImportSelector(nme.WILDCARD, uscoreOffset, nme.WILDCARD, -1))) } else if (in.token == LBRACE) { Import(t, importSelectors()) } else { @@ -1947,7 +1947,7 @@ self => Import(t, List(ImportSelector(name, nameOffset, name, nameOffset))) } } - atPos(start) { loop() } + atPos(importOffset, start) { loop() } } /** ImportSelectors ::= `{' {ImportSelector `,'} (ImportSelector | `_') `}' |