Skip to content

Commit 3115f88

Browse files
committed
Merge pull request scala#4186 from som-snytt/issue/9027-backport
SI-9027 Backport xml parser fix
2 parents a908ded + 736293a commit 3115f88

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

bincompat-backward.whitelist.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ filter {
100100
{
101101
matchName="scala.reflect.runtime.SymbolLoaders.isInvalidClassName"
102102
problemName=MissingMethodProblem
103+
},
104+
105+
{
106+
matchName="scala.xml.dtd.ElementValidator.scala$xml$dtd$ElementValidator$$find$2"
107+
problemName=IncompatibleMethTypeProblem
103108
}
104109
]
105110
}
111+

bincompat-forward.whitelist.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ filter {
182182
# only accessible from util.parsing.combinator package
183183
matchName="scala.util.parsing.combinator.SubSequence"
184184
problemName=MissingClassProblem
185+
},
186+
187+
{
188+
matchName="scala.xml.dtd.ElementValidator.scala$xml$dtd$ElementValidator$$find$2"
189+
problemName=IncompatibleMethTypeProblem
185190
}
186191
]
187192
}

src/compiler/scala/tools/nsc/ast/parser/MarkupParsers.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,12 @@ trait MarkupParsers {
349349
content_LT(ts)
350350

351351
// parse more XML ?
352-
if (charComingAfter(xSpaceOpt) == '<') {
353-
xSpaceOpt
354-
while (ch == '<') {
355-
nextch
352+
if (charComingAfter(xSpaceOpt()) == '<') {
353+
do {
354+
xSpaceOpt()
355+
nextch()
356356
ts append element
357-
xSpaceOpt
358-
}
357+
} while (charComingAfter(xSpaceOpt()) == '<')
359358
handle.makeXMLseq(r2p(start, start, curOffset), ts)
360359
}
361360
else {

0 commit comments

Comments
 (0)