-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#16458): regression in xml syntax parsing
xLiteral mistakenly assumed that the element just after `<` is always non-special element, but it is not true. It could be xCharData, comment, xProcInstr. [Cherry-picked 77aa363]
- Loading branch information
1 parent
42272ff
commit 4be0636
Showing
3 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
def x = <div>FooBar</div><!-- /.modal-content --> | ||
|
||
package scala.xml { | ||
type MetaData = AnyRef | ||
|
||
trait NamespaceBinding | ||
object TopScope extends NamespaceBinding | ||
object Null | ||
abstract class Node { | ||
def label: String | ||
def child: Seq[Node] | ||
override def toString = label + child.mkString | ||
} | ||
class Comment(commentText: String) extends Node{ | ||
def label = commentText | ||
def child = Nil | ||
} | ||
class Elem(prefix: String, val label: String, attributes1: MetaData, scope: NamespaceBinding, minimizeEmpty: Boolean, val child: Node*) extends Node | ||
class NodeBuffer extends Seq[Node] { | ||
val nodes = scala.collection.mutable.ArrayBuffer.empty[Node] | ||
def &+(o: Any): NodeBuffer = | ||
o match { | ||
case n: Node => nodes.addOne(n) ; this | ||
case t: Text => nodes.addOne(Atom(t)) ; this | ||
} | ||
// Members declared in scala.collection.IterableOnce | ||
def iterator: Iterator[scala.xml.Node] = nodes.iterator | ||
// Members declared in scala.collection.SeqOps | ||
def apply(i: Int): scala.xml.Node = nodes(i) | ||
def length: Int = nodes.length | ||
} | ||
case class Text(text: String) | ||
case class Atom(t: Text) extends Node { | ||
def label = t.text | ||
def child = Nil | ||
} | ||
} |