@@ -68,17 +68,18 @@ object MarkupParsers {
68
68
if (ch == SU ) throw TruncatedXMLControl
69
69
else reportSyntaxError(msg)
70
70
71
- var input : CharArrayReader = _
71
+ var input : CharArrayReader = _
72
72
def lookahead (): BufferedIterator [Char ] =
73
73
(input.buf drop input.charOffset).iterator.buffered
74
74
75
75
import parser .{ symbXMLBuilder => handle }
76
76
77
- def curOffset : Int = input.charOffset - 1
78
- var tmppos : Span = NoSpan
77
+ def curOffset : Int = input.lastCharOffset
78
+
79
+ var tmppos : Span = NoSpan
79
80
def ch : Char = input.ch
80
81
/** this method assign the next character to ch and advances in input */
81
- def nextch (): Unit = { input.nextChar() }
82
+ def nextch (): Unit = input.nextChar()
82
83
83
84
protected def ch_returning_nextch : Char = {
84
85
val result = ch; input.nextChar(); result
@@ -329,9 +330,9 @@ object MarkupParsers {
329
330
case c @ TruncatedXMLControl =>
330
331
ifTruncated(c.getMessage)
331
332
case c @ (MissingEndTagControl | ConfusedAboutBracesControl ) =>
332
- parser.syntaxError(c.getMessage + debugLastElem + " >" , debugLastPos)
333
+ parser.syntaxError(s " ${ c.getMessage}$ debugLastElem> " , debugLastPos)
333
334
case _ : ArrayIndexOutOfBoundsException =>
334
- parser.syntaxError(" missing end tag in XML literal for <%s> " format debugLastElem , debugLastPos)
335
+ parser.syntaxError(s " missing end tag in XML literal for < $debugLastElem > " , debugLastPos)
335
336
}
336
337
finally parser.in.resume(saved)
337
338
@@ -342,14 +343,13 @@ object MarkupParsers {
342
343
}
343
344
344
345
/** Use a lookahead parser to run speculative body, and return the first char afterward. */
345
- private def charComingAfter (body : => Unit ): Char = {
346
+ private def charComingAfter (body : => Unit ): Char =
346
347
try {
347
348
input = input.lookaheadReader()
348
349
body
349
350
ch
350
351
}
351
352
finally input = parser.in
352
- }
353
353
354
354
/** xLiteral = element { element }
355
355
* @return Scala representation of this xml literal
0 commit comments