From a1dd52ebc87b350bca258deb3f457145df13d61a Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Fri, 9 Apr 2010 14:33:25 +0200 Subject: [PATCH] support XML comments --- XML.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/XML.js b/XML.js index cd6b2b02..1db6c3d8 100644 --- a/XML.js +++ b/XML.js @@ -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: ".+" + } ] };