Skip to content

Commit 5e696b8

Browse files
retronymadriaanm
authored andcommitted
Name boolean arguments in src/library.
1 parent d5dd410 commit 5e696b8

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

src/library/scala/xml/Attribute.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ abstract trait Attribute extends MetaData {
9494

9595
sb append key append '='
9696
val sb2 = new StringBuilder()
97-
Utility.sequenceToXML(value, TopScope, sb2, true)
97+
Utility.sequenceToXML(value, TopScope, sb2, stripComments = true)
9898
Utility.appendQuoted(sb2.toString, sb)
9999
}
100100
}

src/library/scala/xml/Equality.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ trait Equality extends scala.Equals {
8686
* to maintain a semblance of order.
8787
*/
8888
override def hashCode() = basisForHashCode.##
89-
override def equals(other: Any) = doComparison(other, false)
90-
final def xml_==(other: Any) = doComparison(other, true)
89+
override def equals(other: Any) = doComparison(other, blithe = false)
90+
final def xml_==(other: Any) = doComparison(other, blithe = true)
9191
final def xml_!=(other: Any) = !xml_==(other)
9292

9393
/** The "blithe" parameter expresses the caller's unconcerned attitude

src/library/scala/xml/Node.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ abstract class Node extends NodeSeq {
163163
/**
164164
* Same as `toString('''false''')`.
165165
*/
166-
override def toString(): String = buildString(false)
166+
override def toString(): String = buildString(stripComments = false)
167167

168168
/**
169169
* Appends qualified name of this node to `StringBuilder`.

src/library/scala/xml/PrettyPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class PrettyPrinter(width: Int, step: Int) {
147147
case _ =>
148148
val test = {
149149
val sb = new StringBuilder()
150-
Utility.serialize(node, pscope, sb, false)
150+
Utility.serialize(node, pscope, sb, stripComments = false)
151151
if (doPreserve(node)) sb.toString
152152
else TextBuffer.fromString(sb.toString).toText(0).data
153153
}

src/library/scala/xml/dtd/ElementValidator.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,21 @@ class ElementValidator() extends Function1[Node,Boolean] {
9999
*/
100100
def check(nodes: Seq[Node]): Boolean = contentModel match {
101101
case ANY => true
102-
case EMPTY => getIterable(nodes, false).isEmpty
103-
case PCDATA => getIterable(nodes, true).isEmpty
102+
case EMPTY => getIterable(nodes, skipPCDATA = false).isEmpty
103+
case PCDATA => getIterable(nodes, skipPCDATA = true).isEmpty
104104
case MIXED(ContentModel.Alt(branches @ _*)) => // @todo
105105
val j = exc.length
106106
def find(Key: String): Boolean =
107107
branches exists { case ContentModel.Letter(ElemName(Key)) => true ; case _ => false }
108108

109-
getIterable(nodes, true) map (_.name) filterNot find foreach {
109+
getIterable(nodes, skipPCDATA = true) map (_.name) filterNot find foreach {
110110
exc ::= MakeValidationException fromUndefinedElement _
111111
}
112112
(exc.length == j) // - true if no new exception
113113

114114
case _: ELEMENTS =>
115115
dfa isFinal {
116-
getIterable(nodes, false).foldLeft(0) { (q, e) =>
116+
getIterable(nodes, skipPCDATA = false).foldLeft(0) { (q, e) =>
117117
(dfa delta q).getOrElse(e, throw ValidationException("element %s not allowed here" format e))
118118
}
119119
}

src/library/scala/xml/parsing/MarkupParser.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ trait MarkupParser extends MarkupParserCommon with TokenTests
199199
* // this is a bit more lenient than necessary...
200200
* }}} */
201201
def prolog(): (Option[String], Option[String], Option[Boolean]) =
202-
prologOrTextDecl(true)
202+
prologOrTextDecl(isProlog = true)
203203

204204
/** prolog, but without standalone */
205205
def textDecl(): (Option[String], Option[String]) =
206-
prologOrTextDecl(false) match { case (x1, x2, _) => (x1, x2) }
206+
prologOrTextDecl(isProlog = false) match { case (x1, x2, _) => (x1, x2) }
207207

208208
/** {{{
209209
* [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
@@ -799,12 +799,12 @@ trait MarkupParser extends MarkupParserCommon with TokenTests
799799

800800
val defdecl: DefaultDecl = ch match {
801801
case '\'' | '"' =>
802-
DEFAULT(false, xAttributeValue())
802+
DEFAULT(fixed = false, xAttributeValue())
803803

804804
case '#' =>
805805
nextch()
806806
xName match {
807-
case "FIXED" => xSpace() ; DEFAULT(true, xAttributeValue())
807+
case "FIXED" => xSpace() ; DEFAULT(fixed = true, xAttributeValue())
808808
case "IMPLIED" => IMPLIED
809809
case "REQUIRED" => REQUIRED
810810
}

src/library/scala/xml/persistent/CachedFileStorage.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ abstract class CachedFileStorage(private val file1: File) extends Thread with Lo
7676
log("[load]\nloading "+theFile)
7777
val src = Source.fromFile(theFile)
7878
log("parsing "+theFile)
79-
val res = ConstructingParser.fromSource(src, false).document().docElem(0)
79+
val res = ConstructingParser.fromSource(src,preserveWS = false).document.docElem(0)
8080
switch()
8181
log("[load done]")
8282
res.child.iterator
@@ -94,7 +94,7 @@ abstract class CachedFileStorage(private val file1: File) extends Thread with Lo
9494
// @todo: optimize
9595
val storageNode = <nodes>{ nodes.toList }</nodes>
9696
val w = Channels.newWriter(c, "utf-8")
97-
XML.write(w, storageNode, "utf-8", true, null)
97+
XML.write(w, storageNode, "utf-8", xmlDecl = true, doctype = null)
9898

9999
log("writing to "+theFile)
100100

0 commit comments

Comments
 (0)