diff options
Diffstat (limited to 'src/library/scala/xml/parsing/MarkupParserCommon.scala')
-rw-r--r-- | src/library/scala/xml/parsing/MarkupParserCommon.scala | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/library/scala/xml/parsing/MarkupParserCommon.scala b/src/library/scala/xml/parsing/MarkupParserCommon.scala index da640484e0..57c1651558 100644 --- a/src/library/scala/xml/parsing/MarkupParserCommon.scala +++ b/src/library/scala/xml/parsing/MarkupParserCommon.scala @@ -6,11 +6,11 @@ ** |/ ** \* */ -package scala.xml +package scala +package xml package parsing import scala.io.Source -import scala.xml.dtd._ import scala.annotation.switch import Utility.Escapes.{ pairs => unescape } @@ -39,7 +39,7 @@ private[scala] trait MarkupParserCommon extends TokenTests { */ protected def xTag(pscope: NamespaceType): (String, AttributesType) = { val name = xName - xSpaceOpt + xSpaceOpt() (name, mkAttributes(name, pscope)) } @@ -50,7 +50,7 @@ private[scala] trait MarkupParserCommon extends TokenTests { */ def xProcInstr: ElementType = { val n = xName - xSpaceOpt + xSpaceOpt() xTakeUntil(mkProcInstr(_, n, _), () => tmppos, "?>") } @@ -78,7 +78,7 @@ private[scala] trait MarkupParserCommon extends TokenTests { private def takeUntilChar(it: Iterator[Char], end: Char): String = { val buf = new StringBuilder - while (it.hasNext) it.next match { + while (it.hasNext) it.next() match { case `end` => return buf.toString case ch => buf append ch } @@ -92,7 +92,7 @@ private[scala] trait MarkupParserCommon extends TokenTests { if (xName != startName) errorNoEnd(startName) - xSpaceOpt + xSpaceOpt() xToken('>') } @@ -139,9 +139,9 @@ private[scala] trait MarkupParserCommon extends TokenTests { val buf = new StringBuilder val it = attval.iterator.buffered - while (it.hasNext) buf append (it.next match { + while (it.hasNext) buf append (it.next() match { case ' ' | '\t' | '\n' | '\r' => " " - case '&' if it.head == '#' => it.next ; xCharRef(it) + case '&' if it.head == '#' => it.next() ; xCharRef(it) case '&' => attr_unescape(takeUntilChar(it, ';')) case c => c }) @@ -158,11 +158,11 @@ private[scala] trait MarkupParserCommon extends TokenTests { Utility.parseCharRef(ch, nextch, reportSyntaxError _, truncatedError _) def xCharRef(it: Iterator[Char]): String = { - var c = it.next - Utility.parseCharRef(() => c, () => { c = it.next }, reportSyntaxError _, truncatedError _) + var c = it.next() + Utility.parseCharRef(() => c, () => { c = it.next() }, reportSyntaxError _, truncatedError _) } - def xCharRef: String = xCharRef(() => ch, () => nextch) + def xCharRef: String = xCharRef(() => ch, () => nextch()) /** Create a lookahead reader which does not influence the input */ def lookahead(): BufferedIterator[Char] @@ -195,20 +195,20 @@ private[scala] trait MarkupParserCommon extends TokenTests { } def xToken(that: Char) { - if (ch == that) nextch + if (ch == that) nextch() else xHandleError(that, "'%s' expected instead of '%s'".format(that, ch)) } def xToken(that: Seq[Char]) { that foreach xToken } /** scan [S] '=' [S]*/ - def xEQ() = { xSpaceOpt; xToken('='); xSpaceOpt } + def xEQ() = { xSpaceOpt(); xToken('='); xSpaceOpt() } /** skip optional space S? */ - def xSpaceOpt() = while (isSpace(ch) && !eof) nextch + def xSpaceOpt() = while (isSpace(ch) && !eof) nextch() /** scan [3] S ::= (#x20 | #x9 | #xD | #xA)+ */ def xSpace() = - if (isSpace(ch)) { nextch; xSpaceOpt } + if (isSpace(ch)) { nextch(); xSpaceOpt() } else xHandleError(ch, "whitespace expected") /** Apply a function and return the passed value */ @@ -241,7 +241,7 @@ private[scala] trait MarkupParserCommon extends TokenTests { truncatedError("") // throws TruncatedXMLControl in compiler sb append ch - nextch + nextch() } unreachable } @@ -254,7 +254,7 @@ private[scala] trait MarkupParserCommon extends TokenTests { private def peek(lookingFor: String): Boolean = (lookahead() take lookingFor.length sameElements lookingFor.iterator) && { // drop the chars from the real reader (all lookahead + orig) - (0 to lookingFor.length) foreach (_ => nextch) + (0 to lookingFor.length) foreach (_ => nextch()) true } } |