From 94e1965b645475c3c7bfb3d1e3b4743fb23808d7 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 29 May 2011 18:41:11 +0000 Subject: Altered the positioning of XML literal trees. with the earliest position later than the earliest character in the source code, which was breaking some repl logic. No review. --- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index c7134ce91a..1a0409d440 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1429,11 +1429,17 @@ self => */ def simpleExpr(): Tree = { var canApply = true + val start = in.offset val t = - if (isLiteral) atPos(in.offset)(literal(false)) + if (isLiteral) atPos(start)(literal(false)) else in.token match { case XMLSTART => - xmlLiteral() + // Using setPos here because the generated tree has its position + // off by one and I'm not sure where to fix it. + // + // ^--- This was positioned at the a, not the < + val lit = xmlLiteral() + lit setPos r2p(start, start, in.offset) case IDENTIFIER | BACKQUOTED_IDENT | THIS | SUPER => path(true, false) case USCORE => -- cgit v1.2.3