support XML comments

This commit is contained in:
Fabian Jakobs 2010-04-09 14:33:25 +02:00
commit a1dd52ebc8

20
XML.js
View file

@ -17,6 +17,11 @@ XML.RULES = {
token: "xml_pe",
regex: "<\\?.*?\\?>"
},
{
token: "comment",
regex: "<\\!--",
next: "comment"
},
{
token: "text", // opening tag
regex: "<",
@ -65,13 +70,26 @@ XML.RULES = {
next: "start"
},
{
token: "string",
token: "text",
regex: "\\s+"
},
{
token: "text",
regex: ".+"
}
],
comment:
[
{
token: "comment",
regex: ".*?-->",
next: "start"
},
{
token: "comment",
regex: ".+"
}
]
};