From db8d5476537902760d33d29839afd813ff369ac8 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Wed, 3 Dec 2014 15:58:19 -0800 Subject: SI-9027 Parser eagerly consumes space on multi XML elements Once the parser starts looking for more , it should still lookahead speculatively, leaving any remaining whitespace, including newlines, after the last element. --- test/files/run/t9027.check | 19 +++++++++++++++++++ test/files/run/t9027.scala | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/files/run/t9027.check create mode 100644 test/files/run/t9027.scala (limited to 'test') diff --git a/test/files/run/t9027.check b/test/files/run/t9027.check new file mode 100644 index 0000000000..3429254286 --- /dev/null +++ b/test/files/run/t9027.check @@ -0,0 +1,19 @@ +{ + { + val $buf = new _root_.scala.xml.NodeBuffer(); + $buf.$amp$plus(new _root_.scala.xml.Elem(null, "a", _root_.scala.xml.Null, $scope, true)); + $buf.$amp$plus(new _root_.scala.xml.Elem(null, "b", _root_.scala.xml.Null, $scope, true)); + $buf + }; + println("hello, world.") +} +{ + { + val $buf = new _root_.scala.xml.NodeBuffer(); + $buf.$amp$plus(new _root_.scala.xml.Elem(null, "a", _root_.scala.xml.Null, $scope, true)); + $buf.$amp$plus(new _root_.scala.xml.Elem(null, "b", _root_.scala.xml.Null, $scope, true)); + $buf.$amp$plus(new _root_.scala.xml.Elem(null, "c", _root_.scala.xml.Null, $scope, true)); + $buf + }; + println("hello, world.") +} diff --git a/test/files/run/t9027.scala b/test/files/run/t9027.scala new file mode 100644 index 0000000000..26238147da --- /dev/null +++ b/test/files/run/t9027.scala @@ -0,0 +1,15 @@ + +// used to be parsed as .println +object Test extends App { + import reflect.runtime._, universe._ + + val trees = List( + q""" + println("hello, world.")""", + q""" + + + println("hello, world.")""" + ) + trees foreach println +} -- cgit v1.2.3