summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2015-04-16 16:22:16 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2015-04-16 16:22:16 -0700
commitb730937493f8f25c985b1a4cf5fcfb7fc16092a4 (patch)
tree4a323660cef60221841ee7a7f8f51a4b069fdc36 /src/compiler
parent64685a230fe71352bb349861c0c528b6fd9226c3 (diff)
parent498a07fcd8d922545e942b817d3fbd16ef56809b (diff)
downloadscala-b730937493f8f25c985b1a4cf5fcfb7fc16092a4.tar.gz
scala-b730937493f8f25c985b1a4cf5fcfb7fc16092a4.tar.bz2
scala-b730937493f8f25c985b1a4cf5fcfb7fc16092a4.zip
Merge pull request #4451 from som-snytt/issue/3368-remediate
SI-3368 Default to coalescing for 2.11
Diffstat (limited to 'src/compiler')
-rwxr-xr-xsrc/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala7
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala
index 99399e363f..67241ef639 100755
--- a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala
+++ b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala
@@ -126,10 +126,9 @@ abstract class SymbolicXMLBuilder(p: Parsers#Parser, preserveWS: Boolean) {
def makeTextPat(txt: Tree) = Apply(_scala_xml__Text, List(txt))
def makeText1(txt: Tree) = New(_scala_xml_Text, LL(txt))
def comment(pos: Position, text: String) = atPos(pos)( Comment(const(text)) )
- def charData(pos: Position, txt: String) = atPos(pos) {
- val t = if (isPattern) Apply(_scala_xml(xmlterms._PCData), List(const(txt)))
- else New(_scala_xml(_PCData), LL(const(txt)))
- if (coalescing) t updateAttachment TextAttache(pos, txt) else t
+ def charData(pos: Position, txt: String) = if (coalescing) text(pos, txt) else atPos(pos) {
+ if (isPattern) Apply(_scala_xml(xmlterms._PCData), List(const(txt)))
+ else New(_scala_xml(_PCData), LL(const(txt)))
}
def procInstr(pos: Position, target: String, txt: String) =
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index f217d21c35..630276e412 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -142,7 +142,7 @@ trait ScalaSettings extends AbsScalaSettings
// XML parsing options
object XxmlSettings extends MultiChoiceEnumeration {
val coalescing = Choice("coalescing", "Convert PCData to Text and coalesce sibling nodes")
- def isCoalescing = Xxml contains coalescing
+ def isCoalescing = (Xxml contains coalescing) || (!isScala212 && !Xxml.isSetByUser)
}
val Xxml = MultiChoiceSetting(
name = "-Xxml",