diff --git a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParserCommon.scala b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParserCommon.scala index 906d104041b2..803470fe85a5 100644 --- a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParserCommon.scala +++ b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParserCommon.scala @@ -202,14 +202,6 @@ private[dotty] trait MarkupParserCommon { /** skip optional space S? */ def xSpaceOpt(): Unit = while (isSpace(ch) && !eof) nextch() - /** skip optional space S? and return the number of consumed characters */ - def xSpaceOptN(): Int = - var i = 0 - while (isSpace(ch) && !eof) do - nextch() - i += 1 - i - /** scan [3] S ::= (#x20 | #x9 | #xD | #xA)+ */ def xSpace(): Unit = if (isSpace(ch)) { nextch(); xSpaceOpt() } diff --git a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala index c45a6f205f30..6e37acfaac84 100644 --- a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala @@ -370,17 +370,10 @@ object MarkupParsers { // parse more XML? if (charComingAfter(xSpaceOpt()) == '<') { while { - if xSpaceOptN() == 0 then - nextch() - if content_LT(ts) then // Is `` valid xml? - xToken("/>") - charComingAfter(xSpaceOpt()) == '<' - else - // this is surely not a special node as any special node - // should start with `<{special symbol}` without space. - nextch() - ts.append(element) - charComingAfter(xSpaceOpt()) == '<' + xSpaceOpt() + nextch() + content_LT(ts) + charComingAfter(xSpaceOpt()) == '<' } do () handle.makeXMLseq(Span(start, curOffset, start), ts) }