From ab1e52f2c505e9a13f3b7418886a595d873f6c07 Mon Sep 17 00:00:00 2001 From: William Candillon Date: Wed, 2 Jan 2013 17:45:00 +0100 Subject: [PATCH] Minor improvements. --- lib/ace/mode/xquery_highlight_rules.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/ace/mode/xquery_highlight_rules.js b/lib/ace/mode/xquery_highlight_rules.js index 4d082425..e407d1bd 100644 --- a/lib/ace/mode/xquery_highlight_rules.js +++ b/lib/ace/mode/xquery_highlight_rules.js @@ -70,7 +70,7 @@ var XQueryHighlightRules = function() { }, { token: ["text", "meta.tag"], // opening tag - regex: "(<)(" + qname + ")", + regex: "(<\\/?)(" + qname + ")", next: "tag" }, { token: "constant", // number @@ -90,7 +90,13 @@ var XQueryHighlightRules = function() { token: "text", regex: "\\s+" }, { - token: function(match) { if(keywords.indexOf(match) !== -1) { return "keyword" } else { return "support.function" } }, + token: function(match) { + if(keywords.indexOf(match.toLowerCase()) !== -1) { + return "keyword" + } else { + return "support.function" + } + }, regex: eqname }, { token: "keyword.operator", @@ -201,7 +207,7 @@ var XQueryHighlightRules = function() { "apos-string": [{ token: "string", - regex: ".*?'", + regex: ".*'", next: "start" }, { token: "string", @@ -210,7 +216,7 @@ var XQueryHighlightRules = function() { "quot-string": [{ token: "string", - regex: '.*?"', + regex: '.*"', next: "start" }, { token: "string", @@ -219,7 +225,7 @@ var XQueryHighlightRules = function() { "apos-attr": [{ token: "string", - regex: ".*?'", + regex: ".*'", next: "tag" }, { token: "string", @@ -228,7 +234,7 @@ var XQueryHighlightRules = function() { "quot-attr": [{ token: "string", - regex: '.*?"', + regex: '.*"', next: "tag" }, { token: "string",