From 46f563457f9a1afe8e8b44923e279e816dcb6076 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 30 Jul 2009 11:04:21 +0000 Subject: Fixed test/positions/Empty regression. --- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 8 +++----- src/compiler/scala/tools/nsc/util/Position.scala | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 4f5be7cce0..ef9d678bd7 100755 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2568,11 +2568,9 @@ self => ts.toList } val start = in.offset max 0 - atPos(start) { - topstats() match { - case List(stat @ PackageDef(_, _)) => stat - case stats => makePackaging(start, atPos(o2p(start)) { Ident(nme.EMPTY_PACKAGE_NAME) }, stats) - } + topstats() match { + case List(stat @ PackageDef(_, _)) => stat + case stats => makePackaging(start, atPos(o2p(start)) { Ident(nme.EMPTY_PACKAGE_NAME) }, stats) } } } diff --git a/src/compiler/scala/tools/nsc/util/Position.scala b/src/compiler/scala/tools/nsc/util/Position.scala index ff2be66702..c5ad63fe2f 100644 --- a/src/compiler/scala/tools/nsc/util/Position.scala +++ b/src/compiler/scala/tools/nsc/util/Position.scala @@ -11,7 +11,7 @@ package util object Position { val tabInc = 8 } -/** The class and its subclasses represent positions of ASTs and symbols. +/** The Position class and its subclasses represent positions of ASTs and symbols. * Except for NoPosition and FakePos, every position refers to a SourceFile * and to an offset in the sourcefile (its `point'). For batch compilation, * that's all. For interactive IDE's there are also RangePositions -- cgit v1.2.3