From 4df81aab315e587d9c7e319c7a2ece0f0f6fbaf3 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Sat, 20 Dec 2014 02:28:44 -0800 Subject: SI-3368 CDATA gets a Node XML Parser uses `scala.xml.PCData`. A compiler flag `-Yxml:coalescing`, analogous to `DocumentBuilderFactory.setCoalescing`, turns `PCData` nodes into `Text` nodes and coalesces sibling text nodes. This change also fixes parse errors such as rejecting a sequence of CDATA sections. A sequence of "top level" nodes are not coalesced. ``` scala> startworldstuff res0: scala.xml.Elem = startworldstuff scala> :replay -Yxml:coalescing Replaying: startworldstuff res0: scala.xml.Elem = starthi & byeworldstuffred & black ``` --- test/files/pos/t3368.scala | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/files/pos/t3368.scala (limited to 'test/files/pos/t3368.scala') diff --git a/test/files/pos/t3368.scala b/test/files/pos/t3368.scala new file mode 100644 index 0000000000..c8e861a899 --- /dev/null +++ b/test/files/pos/t3368.scala @@ -0,0 +1,5 @@ + +trait X { + // error: in XML literal: name expected, but char '!' cannot start a name + def x = +} -- cgit v1.2.3