Beautify XQuery highlighting rules.
This commit is contained in:
parent
823abf4449
commit
d91d4954ea
1 changed files with 68 additions and 69 deletions
|
|
@ -41,49 +41,48 @@ var XQueryHighlightRules = function() {
|
||||||
|
|
||||||
// regexp must not have capturing parentheses
|
// regexp must not have capturing parentheses
|
||||||
// regexps are ordered -> the first match is used
|
// regexps are ordered -> the first match is used
|
||||||
|
|
||||||
this.$rules = {
|
this.$rules = {
|
||||||
start : [ {
|
start: [{
|
||||||
token : "text",
|
token: "text",
|
||||||
regex : "<\\!\\[CDATA\\[",
|
regex: "<\\!\\[CDATA\\[",
|
||||||
next : "cdata"
|
next: "cdata"
|
||||||
}, {
|
}, {
|
||||||
token : "xml-pe",
|
token: "xml-pe",
|
||||||
regex : "<\\?.*?\\?>"
|
regex: "<\\?.*?\\?>"
|
||||||
}, {
|
}, {
|
||||||
token : "comment",
|
token: "comment",
|
||||||
regex : "<\\!--",
|
regex: "<\\!--",
|
||||||
next : "comment"
|
next: "comment"
|
||||||
}, {
|
|
||||||
token : "comment",
|
|
||||||
regex : "\\(:",
|
|
||||||
next : "comment"
|
|
||||||
}, {
|
}, {
|
||||||
token : "text", // opening tag
|
token: "comment",
|
||||||
regex : "<\\/?",
|
regex: "\\(:",
|
||||||
next : "tag"
|
next: "comment"
|
||||||
}, {
|
}, {
|
||||||
token : "constant", // number
|
token: "text", // opening tag
|
||||||
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
regex: "<\\/?",
|
||||||
}, {
|
next: "tag"
|
||||||
token : "variable", // variable
|
|
||||||
regex : "\\$[a-zA-Z_][a-zA-Z0-9_\\-:]*\\b"
|
|
||||||
}, {
|
|
||||||
token: "string",
|
|
||||||
regex : '".*?"'
|
|
||||||
}, {
|
|
||||||
token: "string",
|
|
||||||
regex : "'.*?'"
|
|
||||||
}, {
|
}, {
|
||||||
token : "text",
|
token: "constant", // number
|
||||||
regex : "\\s+"
|
regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
||||||
|
}, {
|
||||||
|
token: "variable", // variable
|
||||||
|
regex: "\\$[a-zA-Z_][a-zA-Z0-9_\\-:]*\\b"
|
||||||
|
}, {
|
||||||
|
token: "string",
|
||||||
|
regex: '".*?"'
|
||||||
|
}, {
|
||||||
|
token: "string",
|
||||||
|
regex: "'.*?'"
|
||||||
|
}, {
|
||||||
|
token: "text",
|
||||||
|
regex: "\\s+"
|
||||||
}, {
|
}, {
|
||||||
token: "support.function",
|
token: "support.function",
|
||||||
regex: "\\w[\\w+_\\-:]+(?=\\()"
|
regex: "\\w[\\w+_\\-:]+(?=\\()"
|
||||||
}, {
|
}, {
|
||||||
token : keywordMapper,
|
token: keywordMapper,
|
||||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||||
}, {
|
}, {
|
||||||
token: "keyword.operator",
|
token: "keyword.operator",
|
||||||
regex: "\\*|=|<|>|\\-|\\+"
|
regex: "\\*|=|<|>|\\-|\\+"
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -92,50 +91,50 @@ var XQueryHighlightRules = function() {
|
||||||
}, {
|
}, {
|
||||||
token: "rparen",
|
token: "rparen",
|
||||||
regex: "[\\])}]"
|
regex: "[\\])}]"
|
||||||
} ],
|
}],
|
||||||
|
|
||||||
tag : [ {
|
tag: [{
|
||||||
token : "text",
|
token: "text",
|
||||||
regex : ">",
|
regex: ">",
|
||||||
next : "start"
|
next: "start"
|
||||||
}, {
|
}, {
|
||||||
token : "meta.tag",
|
token: "meta.tag",
|
||||||
regex : "[-_a-zA-Z0-9:]+"
|
regex: "[-_a-zA-Z0-9:]+"
|
||||||
}, {
|
}, {
|
||||||
token : "text",
|
token: "text",
|
||||||
regex : "\\s+"
|
regex: "\\s+"
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token: "string",
|
||||||
regex : '".*?"'
|
regex: '".*?"'
|
||||||
}, {
|
}, {
|
||||||
token : "string",
|
token: "string",
|
||||||
regex : "'.*?'"
|
regex: "'.*?'"
|
||||||
} ],
|
}],
|
||||||
|
|
||||||
cdata : [ {
|
cdata: [{
|
||||||
token : "comment",
|
token: "comment",
|
||||||
regex : "\\]\\]>",
|
regex: "\\]\\]>",
|
||||||
next : "start"
|
next: "start"
|
||||||
}, {
|
}, {
|
||||||
token : "comment",
|
token: "comment",
|
||||||
regex : "\\s+"
|
regex: "\\s+"
|
||||||
}, {
|
}, {
|
||||||
token : "comment",
|
token: "comment",
|
||||||
regex : "(?:[^\\]]|\\](?!\\]>))+"
|
regex: "(?:[^\\]]|\\](?!\\]>))+"
|
||||||
} ],
|
}],
|
||||||
|
|
||||||
comment : [ {
|
comment: [{
|
||||||
token : "comment",
|
token: "comment",
|
||||||
regex : ".*?-->",
|
regex: ".*?-->",
|
||||||
next : "start"
|
next: "start"
|
||||||
}, {
|
}, {
|
||||||
token: "comment",
|
token: "comment",
|
||||||
regex : ".*:\\)",
|
regex: ".*:\\)",
|
||||||
next : "start"
|
next: "start"
|
||||||
}, {
|
}, {
|
||||||
token : "comment",
|
token: "comment",
|
||||||
regex : ".+"
|
regex: ".+"
|
||||||
} ]
|
}]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue