Add support for XQuery. Fix #1405 (#1411)

This commit is contained in:
Golmote 2018-05-26 11:39:35 +02:00 committed by GitHub
parent c2ff24822a
commit e326cb031f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 930 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -712,6 +712,11 @@
"title": "Xojo (REALbasic)",
"owner": "Golmote"
},
"xquery": {
"title": "XQuery",
"require": "markup",
"owner": "Golmote"
},
"yaml": {
"title": "YAML",
"owner": "hason"

164
components/prism-xquery.js Normal file
View File

@ -0,0 +1,164 @@
(function (Prism) {
Prism.languages.xquery = Prism.languages.extend('markup', {
'xquery-comment': {
pattern: /\(:[\s\S]*?:\)/,
greedy: true,
alias: "comment"
},
'string': {
pattern: /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
greedy: true
},
'extension': {
pattern: /\(#.+?#\)/,
alias: 'symbol'
},
'variable': /\$[\w-:]+/,
'axis': {
pattern: /(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,
lookbehind: true,
alias: 'operator'
},
'keyword-operator': {
pattern: /(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,
lookbehind: true,
alias: 'operator'
},
'keyword': {
pattern: /(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,
lookbehind: true
},
'function': /[\w-]+(?::[\w-]+)*(?=\s*\()/,
'xquery-element': {
pattern: /(element\s+)[\w-]+(?::[\w-]+)*/,
lookbehind: true,
alias: 'tag'
},
'xquery-attribute': {
pattern: /(attribute\s+)[\w-]+(?::[\w-]+)*/,
lookbehind: true,
alias: 'attr-name'
},
'builtin': {
pattern: /(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|ENTITIES|ENTITY|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|ID|IDREFS?|int|integer|language|long|Name|NCName|negativeInteger|NMTOKENS?|nonNegativeInteger|nonPositiveInteger|normalizedString|NOTATION|positiveInteger|QName|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,
lookbehind: true
},
'number': /\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,
'operator': [
/[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,
{
pattern: /(\s)-(?=\s)/,
lookbehind: true
}
],
'punctuation': /[[\](){},;:/]/
});
Prism.languages.xquery.tag.pattern = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i;
Prism.languages.xquery['tag'].inside['attr-value'].pattern = /=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}|(?!\1)[^\\])*\1|[^\s'">=]+)/i;
Prism.languages.xquery['tag'].inside['attr-value'].inside['punctuation'] = /^="|"$/;
Prism.languages.xquery['tag'].inside['attr-value'].inside['expression'] = {
// Allow for two levels of nesting
pattern: /{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}/,
inside: {
rest: Prism.languages.xquery
},
'alias': 'language-xquery'
};
// The following will handle plain text inside tags
var stringifyToken = function (token) {
if (typeof token === 'string') {
return token;
}
if (typeof token.content === 'string') {
return token.content;
}
return token.content.map(stringifyToken).join('');
};
var walkTokens = function (tokens) {
var openedTags = [];
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
var notTagNorBrace = false;
if (typeof token !== 'string') {
if (token.type === 'tag' && token.content[0] && token.content[0].type === 'tag') {
// We found a tag, now find its kind
if (token.content[0].content[0].content === '</') {
// Closing tag
if (openedTags.length > 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) {
// Pop matching opening tag
openedTags.pop();
}
} else {
if (token.content[token.content.length - 1].content === '/>') {
// Autoclosed tag, ignore
} else {
// Opening tag
openedTags.push({
tagName: stringifyToken(token.content[0].content[1]),
openedBraces: 0
});
}
}
} else if (
openedTags.length > 0 && token.type === 'punctuation' && token.content === '{' &&
// Ignore `{{`
(!tokens[i + 1] || tokens[i + 1].type !== 'punctuation' || tokens[i + 1].content !== '{') &&
(!tokens[i - 1] || tokens[i - 1].type !== 'plain-text' || tokens[i - 1].content !== '{')
) {
// Here we might have entered an XQuery expression inside a tag
openedTags[openedTags.length - 1].openedBraces++;
} else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === 'punctuation' && token.content === '}') {
// Here we might have left an XQuery expression inside a tag
openedTags[openedTags.length - 1].openedBraces--;
} else if (token.type !== 'comment') {
notTagNorBrace = true
}
}
if (notTagNorBrace || typeof token === 'string') {
if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) {
// Here we are inside a tag, and not inside an XQuery expression.
// That's plain text: drop any tokens matched.
var plainText = stringifyToken(token);
// And merge text with adjacent text
if (i < tokens.length - 1 && (typeof tokens[i + 1] === 'string' || tokens[i + 1].type === 'plain-text')) {
plainText += stringifyToken(tokens[i + 1]);
tokens.splice(i + 1, 1);
}
if (i > 0 && (typeof tokens[i - 1] === 'string' || tokens[i - 1].type === 'plain-text')) {
plainText = stringifyToken(tokens[i - 1]) + plainText;
tokens.splice(i - 1, 1);
i--;
}
if (/^\s+$/.test(plainText)) {
tokens[i] = plainText;
} else {
tokens[i] = new Prism.Token('plain-text', plainText, null, plainText);
}
}
}
if (token.content && typeof token.content !== 'string') {
walkTokens(token.content);
}
}
};
Prism.hooks.add('after-tokenize', function (env) {
if (env.language !== 'xquery') {
return;
}
walkTokens(env.tokens);
});
}(Prism));

1
components/prism-xquery.min.js vendored Normal file
View File

@ -0,0 +1 @@
!function(e){e.languages.xquery=e.languages.extend("markup",{"xquery-comment":{pattern:/\(:[\s\S]*?:\)/,greedy:!0,alias:"comment"},string:{pattern:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,greedy:!0},extension:{pattern:/\(#.+?#\)/,alias:"symbol"},variable:/\$[\w-:]+/,axis:{pattern:/(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,lookbehind:!0,alias:"operator"},"keyword-operator":{pattern:/(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,lookbehind:!0},"function":/[\w-]+(?::[\w-]+)*(?=\s*\()/,"xquery-element":{pattern:/(element\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"tag"},"xquery-attribute":{pattern:/(attribute\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"attr-name"},builtin:{pattern:/(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|ENTITIES|ENTITY|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|ID|IDREFS?|int|integer|language|long|Name|NCName|negativeInteger|NMTOKENS?|nonNegativeInteger|nonPositiveInteger|normalizedString|NOTATION|positiveInteger|QName|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,lookbehind:!0},number:/\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,operator:[/[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],punctuation:/[[\](){},;:\/]/}),e.languages.xquery.tag.pattern=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,e.languages.xquery.tag.inside["attr-value"].pattern=/=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}|(?!\1)[^\\])*\1|[^\s'">=]+)/i,e.languages.xquery.tag.inside["attr-value"].inside.punctuation=/^="|"$/,e.languages.xquery.tag.inside["attr-value"].inside.expression={pattern:/{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}/,inside:{rest:e.languages.xquery},alias:"language-xquery"};var t=function(e){return"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(t).join("")},n=function(a){for(var o=[],i=0;i<a.length;i++){var r=a[i],s=!1;if("string"!=typeof r&&("tag"===r.type&&r.content[0]&&"tag"===r.content[0].type?"</"===r.content[0].content[0].content?o.length>0&&o[o.length-1].tagName===t(r.content[0].content[1])&&o.pop():"/>"===r.content[r.content.length-1].content||o.push({tagName:t(r.content[0].content[1]),openedBraces:0}):!(o.length>0&&"punctuation"===r.type&&"{"===r.content)||a[i+1]&&"punctuation"===a[i+1].type&&"{"===a[i+1].content||a[i-1]&&"plain-text"===a[i-1].type&&"{"===a[i-1].content?o.length>0&&o[o.length-1].openedBraces>0&&"punctuation"===r.type&&"}"===r.content?o[o.length-1].openedBraces--:"comment"!==r.type&&(s=!0):o[o.length-1].openedBraces++),(s||"string"==typeof r)&&o.length>0&&0===o[o.length-1].openedBraces){var l=t(r);i<a.length-1&&("string"==typeof a[i+1]||"plain-text"===a[i+1].type)&&(l+=t(a[i+1]),a.splice(i+1,1)),i>0&&("string"==typeof a[i-1]||"plain-text"===a[i-1].type)&&(l=t(a[i-1])+l,a.splice(i-1,1),i--),a[i]=/^\s+$/.test(l)?l:new e.Token("plain-text",l,null,l)}r.content&&"string"!=typeof r.content&&n(r.content)}};e.hooks.add("after-tokenize",function(e){"xquery"===e.language&&n(e.tokens)})}(Prism);

View File

@ -0,0 +1,47 @@
<h2>Comments</h2>
<pre><code>(::)
(: Comment :)
(: Multi-line
comment :)
(:~
: The &lt;b>functx:substring-after-last&lt;/b> function returns the part
: of &lt;b>$string&lt;/b> that appears after the last occurrence of
: &lt;b>$delim&lt;/b>. If &lt;b>$string&lt;/b> does not contain
: &lt;b>$delim&lt;/b>, the entire string is returned.
:
: @param $string the string to substring
: @param $delim the delimiter
: @return the substring
:)</code></pre>
<h2>Variables</h2>
<pre><code>$myProduct
$foo-bar
$strings:LetterA</code></pre>
<h2>Functions</h2>
<pre><code>document-node(schema-element(catalog))
strings:trim($arg as xs:string?)
false()</code></pre>
<h2>Keywords</h2>
<pre><code>xquery version "1.0";
declare default element namespace "http://datypic.com/cat";
declare boundary-space preserve;
declare default collation "http://datypic.com/collation/custom";</code></pre>
<h2>Types</h2>
<pre><code>xs:anyAtomicType
element
xs:double</code></pre>
<h2>Full example</h2>
<pre><code>&lt;report xmlns="http://datypic.com/report"
xmlns:cat="http://datypic.com/cat"
xmlns:prod="http://datypic.com/prod"> {
for $product in doc("prod_ns.xml")/prod:product
return &lt;lineItem>
{$product/prod:number}
{$product/prod:name}
&lt;/lineItem>
} &lt;/report></code></pre>

View File

@ -4,7 +4,7 @@
}
// The dependencies map is built automatically with gulp
var lang_dependencies = /*languages_placeholder[*/{"javascript":"clike","actionscript":"javascript","arduino":"cpp","aspnet":["markup","csharp"],"bison":"c","c":"clike","csharp":"clike","cpp":"c","coffeescript":"javascript","crystal":"ruby","css-extras":"css","d":"clike","dart":"clike","django":"markup","erb":["ruby","markup-templating"],"fsharp":"clike","flow":"javascript","glsl":"clike","go":"clike","groovy":"clike","haml":"ruby","handlebars":"markup-templating","haxe":"clike","java":"clike","jolie":"clike","kotlin":"clike","less":"css","markdown":"markup","markup-templating":"markup","n4js":"javascript","nginx":"clike","objectivec":"c","opencl":"cpp","parser":"markup","php":["clike","markup-templating"],"php-extras":"php","plsql":"sql","processing":"clike","protobuf":"clike","pug":"javascript","qore":"clike","jsx":["markup","javascript"],"tsx":["jsx","typescript"],"reason":"clike","ruby":"clike","sass":"css","scss":"css","scala":"java","smarty":"markup-templating","soy":"markup-templating","swift":"clike","textile":"markup","tt2":["clike","markup-templating"],"twig":"markup","typescript":"javascript","vbnet":"basic","velocity":"markup","wiki":"markup","xeora":"markup"}/*]*/;
var lang_dependencies = /*languages_placeholder[*/{"javascript":"clike","actionscript":"javascript","arduino":"cpp","aspnet":["markup","csharp"],"bison":"c","c":"clike","csharp":"clike","cpp":"c","coffeescript":"javascript","crystal":"ruby","css-extras":"css","d":"clike","dart":"clike","django":"markup","erb":["ruby","markup-templating"],"fsharp":"clike","flow":"javascript","glsl":"clike","go":"clike","groovy":"clike","haml":"ruby","handlebars":"markup-templating","haxe":"clike","java":"clike","jolie":"clike","kotlin":"clike","less":"css","markdown":"markup","markup-templating":"markup","n4js":"javascript","nginx":"clike","objectivec":"c","opencl":"cpp","parser":"markup","php":["clike","markup-templating"],"php-extras":"php","plsql":"sql","processing":"clike","protobuf":"clike","pug":"javascript","qore":"clike","jsx":["markup","javascript"],"tsx":["jsx","typescript"],"reason":"clike","ruby":"clike","sass":"css","scss":"css","scala":"java","smarty":"markup-templating","soy":"markup-templating","swift":"clike","textile":"markup","tt2":["clike","markup-templating"],"twig":"markup","typescript":"javascript","vbnet":"basic","velocity":"markup","wiki":"markup","xeora":"markup","xquery":"markup"}/*]*/;
var lang_data = {};

View File

@ -1 +1 @@
!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var e={javascript:"clike",actionscript:"javascript",arduino:"cpp",aspnet:["markup","csharp"],bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",django:"markup",erb:["ruby","markup-templating"],fsharp:"clike",flow:"javascript",glsl:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",java:"clike",jolie:"clike",kotlin:"clike",less:"css",markdown:"markup","markup-templating":"markup",n4js:"javascript",nginx:"clike",objectivec:"c",opencl:"cpp",parser:"markup",php:["clike","markup-templating"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:"javascript",qore:"clike",jsx:["markup","javascript"],tsx:["jsx","typescript"],reason:"clike",ruby:"clike",sass:"css",scss:"css",scala:"java",smarty:"markup-templating",soy:"markup-templating",swift:"clike",textile:"markup",tt2:["clike","markup-templating"],twig:"markup",typescript:"javascript",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup"},a={},c="none",t=document.getElementsByTagName("script");t=t[t.length-1];var r="components/";if(t.hasAttribute("data-autoloader-path")){var s=t.getAttribute("data-autoloader-path").trim();s.length>0&&!/^[a-z]+:\/\//i.test(t.src)&&(r=s.replace(/\/?$/,"/"))}else/[\w-]+\.js$/.test(t.src)&&(r=t.src.replace(/[\w-]+\.js$/,"components/"));var i=Prism.plugins.autoloader={languages_path:r,use_minified:!0},t=function(e,a,c){var t=document.createElement("script");t.src=e,t.async=!0,t.onload=function(){document.body.removeChild(t),a&&a()},t.onerror=function(){document.body.removeChild(t),c&&c()},document.body.appendChild(t)},n=function(e){return i.languages_path+"prism-"+e+(i.use_minified?".min":"")+".js"},l=function(e,c){var t=a[e];t||(t=a[e]={});var r=c.getAttribute("data-dependencies");!r&&c.parentNode&&"pre"===c.parentNode.tagName.toLowerCase()&&(r=c.parentNode.getAttribute("data-dependencies")),r=r?r.split(/\s*,\s*/g):[],o(r,function(){p(e,function(){Prism.highlightElement(c)})})},o=function(e,a,c){"string"==typeof e&&(e=[e]);var t=0,r=e.length,s=function(){r>t?p(e[t],function(){t++,s()},function(){c&&c(e[t])}):t===r&&a&&a(e)};s()},p=function(c,r,s){var i=function(){var e=!1;c.indexOf("!")>=0&&(e=!0,c=c.replace("!",""));var i=a[c];if(i||(i=a[c]={}),r&&(i.success_callbacks||(i.success_callbacks=[]),i.success_callbacks.push(r)),s&&(i.error_callbacks||(i.error_callbacks=[]),i.error_callbacks.push(s)),!e&&Prism.languages[c])u(c);else if(!e&&i.error)m(c);else if(e||!i.loading){i.loading=!0;var l=n(c);t(l,function(){i.loading=!1,u(c)},function(){i.loading=!1,i.error=!0,m(c)})}},l=e[c];l&&l.length?o(l,i):i()},u=function(e){a[e]&&a[e].success_callbacks&&a[e].success_callbacks.length&&a[e].success_callbacks.forEach(function(a){a(e)})},m=function(e){a[e]&&a[e].error_callbacks&&a[e].error_callbacks.length&&a[e].error_callbacks.forEach(function(a){a(e)})};Prism.hooks.add("complete",function(e){e.element&&e.language&&!e.grammar&&e.language!==c&&l(e.language,e.element)})}}();
!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var e={javascript:"clike",actionscript:"javascript",arduino:"cpp",aspnet:["markup","csharp"],bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",django:"markup",erb:["ruby","markup-templating"],fsharp:"clike",flow:"javascript",glsl:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",java:"clike",jolie:"clike",kotlin:"clike",less:"css",markdown:"markup","markup-templating":"markup",n4js:"javascript",nginx:"clike",objectivec:"c",opencl:"cpp",parser:"markup",php:["clike","markup-templating"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:"javascript",qore:"clike",jsx:["markup","javascript"],tsx:["jsx","typescript"],reason:"clike",ruby:"clike",sass:"css",scss:"css",scala:"java",smarty:"markup-templating",soy:"markup-templating",swift:"clike",textile:"markup",tt2:["clike","markup-templating"],twig:"markup",typescript:"javascript",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup",xquery:"markup"},a={},c="none",t=document.getElementsByTagName("script");t=t[t.length-1];var r="components/";if(t.hasAttribute("data-autoloader-path")){var s=t.getAttribute("data-autoloader-path").trim();s.length>0&&!/^[a-z]+:\/\//i.test(t.src)&&(r=s.replace(/\/?$/,"/"))}else/[\w-]+\.js$/.test(t.src)&&(r=t.src.replace(/[\w-]+\.js$/,"components/"));var i=Prism.plugins.autoloader={languages_path:r,use_minified:!0},t=function(e,a,c){var t=document.createElement("script");t.src=e,t.async=!0,t.onload=function(){document.body.removeChild(t),a&&a()},t.onerror=function(){document.body.removeChild(t),c&&c()},document.body.appendChild(t)},n=function(e){return i.languages_path+"prism-"+e+(i.use_minified?".min":"")+".js"},l=function(e,c){var t=a[e];t||(t=a[e]={});var r=c.getAttribute("data-dependencies");!r&&c.parentNode&&"pre"===c.parentNode.tagName.toLowerCase()&&(r=c.parentNode.getAttribute("data-dependencies")),r=r?r.split(/\s*,\s*/g):[],o(r,function(){p(e,function(){Prism.highlightElement(c)})})},o=function(e,a,c){"string"==typeof e&&(e=[e]);var t=0,r=e.length,s=function(){r>t?p(e[t],function(){t++,s()},function(){c&&c(e[t])}):t===r&&a&&a(e)};s()},p=function(c,r,s){var i=function(){var e=!1;c.indexOf("!")>=0&&(e=!0,c=c.replace("!",""));var i=a[c];if(i||(i=a[c]={}),r&&(i.success_callbacks||(i.success_callbacks=[]),i.success_callbacks.push(r)),s&&(i.error_callbacks||(i.error_callbacks=[]),i.error_callbacks.push(s)),!e&&Prism.languages[c])u(c);else if(!e&&i.error)m(c);else if(e||!i.loading){i.loading=!0;var l=n(c);t(l,function(){i.loading=!1,u(c)},function(){i.loading=!1,i.error=!0,m(c)})}},l=e[c];l&&l.length?o(l,i):i()},u=function(e){a[e]&&a[e].success_callbacks&&a[e].success_callbacks.length&&a[e].success_callbacks.forEach(function(a){a(e)})},m=function(e){a[e]&&a[e].error_callbacks&&a[e].error_callbacks.length&&a[e].error_callbacks.forEach(function(a){a(e)})};Prism.hooks.add("complete",function(e){e.element&&e.language&&!e.grammar&&e.language!==c&&l(e.language,e.element)})}}();

View File

@ -11,7 +11,7 @@ if (!Prism.plugins.toolbar) {
}
// The languages map is built automatically with gulp
var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","arff":"ARFF","asciidoc":"AsciiDoc","asm6502":"6502 Assembly","aspnet":"ASP.NET (C#)","autohotkey":"AutoHotkey","autoit":"AutoIt","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","csp":"Content-Security-Policy","css-extras":"CSS Extras","django":"Django/Jinja2","erb":"ERB","fsharp":"F#","gedcom":"GEDCOM","glsl":"GLSL","graphql":"GraphQL","http":"HTTP","hpkp":"HTTP Public-Key-Pins","hsts":"HTTP Strict-Transport-Security","ichigojam":"IchigoJam","inform7":"Inform 7","json":"JSON","latex":"LaTeX","livescript":"LiveScript","lolcode":"LOLCODE","markup-templating":"Markup templating","matlab":"MATLAB","mel":"MEL","n4js":"N4JS","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","opencl":"OpenCL","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","plsql":"PL/SQL","powershell":"PowerShell","properties":".properties","protobuf":"Protocol Buffers","q":"Q (kdb+ database)","jsx":"React JSX","tsx":"React TSX","renpy":"Ren'py","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","soy":"Soy (Closure Template)","tt2":"Template Toolkit 2","typescript":"TypeScript","vbnet":"VB.Net","vhdl":"VHDL","vim":"vim","visual-basic":"Visual Basic","wasm":"WebAssembly","wiki":"Wiki markup","xojo":"Xojo (REALbasic)","yaml":"YAML"}/*]*/;
var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","arff":"ARFF","asciidoc":"AsciiDoc","asm6502":"6502 Assembly","aspnet":"ASP.NET (C#)","autohotkey":"AutoHotkey","autoit":"AutoIt","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","csp":"Content-Security-Policy","css-extras":"CSS Extras","django":"Django/Jinja2","erb":"ERB","fsharp":"F#","gedcom":"GEDCOM","glsl":"GLSL","graphql":"GraphQL","http":"HTTP","hpkp":"HTTP Public-Key-Pins","hsts":"HTTP Strict-Transport-Security","ichigojam":"IchigoJam","inform7":"Inform 7","json":"JSON","latex":"LaTeX","livescript":"LiveScript","lolcode":"LOLCODE","markup-templating":"Markup templating","matlab":"MATLAB","mel":"MEL","n4js":"N4JS","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","opencl":"OpenCL","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","plsql":"PL/SQL","powershell":"PowerShell","properties":".properties","protobuf":"Protocol Buffers","q":"Q (kdb+ database)","jsx":"React JSX","tsx":"React TSX","renpy":"Ren'py","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","soy":"Soy (Closure Template)","tt2":"Template Toolkit 2","typescript":"TypeScript","vbnet":"VB.Net","vhdl":"VHDL","vim":"vim","visual-basic":"Visual Basic","wasm":"WebAssembly","wiki":"Wiki markup","xojo":"Xojo (REALbasic)","xquery":"XQuery","yaml":"YAML"}/*]*/;
Prism.plugins.toolbar.registerButton('show-language', function(env) {
var pre = env.element.parentNode;
if (!pre || !/pre/i.test(pre.nodeName)) {

View File

@ -1 +1 @@
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){if(!Prism.plugins.toolbar)return console.warn("Show Languages plugin loaded before Toolbar plugin."),void 0;var e={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",arff:"ARFF",asciidoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript",csp:"Content-Security-Policy","css-extras":"CSS Extras",django:"Django/Jinja2",erb:"ERB",fsharp:"F#",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",inform7:"Inform 7",json:"JSON",latex:"LaTeX",livescript:"LiveScript",lolcode:"LOLCODE","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",n4js:"N4JS",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",php:"PHP","php-extras":"PHP Extras",plsql:"PL/SQL",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",q:"Q (kdb+ database)",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",soy:"Soy (Closure Template)",tt2:"Template Toolkit 2",typescript:"TypeScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xojo:"Xojo (REALbasic)",yaml:"YAML"};Prism.plugins.toolbar.registerButton("show-language",function(t){var a=t.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var s=a.getAttribute("data-language")||e[t.language]||t.language&&t.language.substring(0,1).toUpperCase()+t.language.substring(1);if(s){var i=document.createElement("span");return i.textContent=s,i}}})}}();
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){if(!Prism.plugins.toolbar)return console.warn("Show Languages plugin loaded before Toolbar plugin."),void 0;var e={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",arff:"ARFF",asciidoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript",csp:"Content-Security-Policy","css-extras":"CSS Extras",django:"Django/Jinja2",erb:"ERB",fsharp:"F#",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",inform7:"Inform 7",json:"JSON",latex:"LaTeX",livescript:"LiveScript",lolcode:"LOLCODE","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",n4js:"N4JS",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",php:"PHP","php-extras":"PHP Extras",plsql:"PL/SQL",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",q:"Q (kdb+ database)",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",soy:"Soy (Closure Template)",tt2:"Template Toolkit 2",typescript:"TypeScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML"};Prism.plugins.toolbar.registerButton("show-language",function(t){var a=t.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var s=a.getAttribute("data-language")||e[t.language]||t.language&&t.language.substring(0,1).toUpperCase()+t.language.substring(1);if(s){var i=document.createElement("span");return i.textContent=s,i}}})}}();

View File

@ -0,0 +1,33 @@
self::
child::
descendant::
descendant-or-self::
attribute::
following::
following-sibling::
parent::
ancestor::
ancestor-or-self::
preceding::
preceding-sibling::
----------------------------------------------------
[
["axis", "self"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "child"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "descendant"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "descendant-or-self"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "attribute"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "following"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "following-sibling"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "parent"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "ancestor"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "ancestor-or-self"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "preceding"], ["punctuation", ":"], ["punctuation", ":"],
["axis", "preceding-sibling"], ["punctuation", ":"], ["punctuation", ":"]
]
----------------------------------------------------
Checks for axes.

View File

@ -0,0 +1,122 @@
attribute foo
comment
document
element foo
processing-instruction
text
xs:anyAtomicType
xs:anyType
xs:anyURI
xs:base64Binary
xs:boolean
xs:byte
xs:date
xs:dateTime
xs:dayTimeDuration
xs:decimal
xs:double
xs:duration
xs:ENTITIES
xs:ENTITY
xs:float
xs:gDay
xs:gMonth
xs:gMonthDay
xs:gYear
xs:gYearMonth
xs:hexBinary
xs:ID
xs:IDREF
xs:IDREFS
xs:int
xs:integer
xs:language
xs:long
xs:Name
xs:NCName
xs:negativeInteger
xs:NMTOKEN
xs:NMTOKENS
xs:nonNegativeInteger
xs:nonPositiveInteger
xs:normalizedString
xs:NOTATION
xs:positiveInteger
xs:QName
xs:short
xs:string
xs:time
xs:token
xs:unsignedByte
xs:unsignedInt
xs:unsignedLong
xs:unsignedShort
xs:untyped
xs:untypedAtomic
xs:yearMonthDuration
----------------------------------------------------
[
["builtin", "attribute"],
["xquery-attribute", "foo"],
["builtin", "comment"],
["builtin", "document"],
["builtin", "element"],
["xquery-element", "foo"],
["builtin", "processing-instruction"],
["builtin", "text"],
["builtin", "xs:anyAtomicType"],
["builtin", "xs:anyType"],
["builtin", "xs:anyURI"],
["builtin", "xs:base64Binary"],
["builtin", "xs:boolean"],
["builtin", "xs:byte"],
["builtin", "xs:date"],
["builtin", "xs:dateTime"],
["builtin", "xs:dayTimeDuration"],
["builtin", "xs:decimal"],
["builtin", "xs:double"],
["builtin", "xs:duration"],
["builtin", "xs:ENTITIES"],
["builtin", "xs:ENTITY"],
["builtin", "xs:float"],
["builtin", "xs:gDay"],
["builtin", "xs:gMonth"],
["builtin", "xs:gMonthDay"],
["builtin", "xs:gYear"],
["builtin", "xs:gYearMonth"],
["builtin", "xs:hexBinary"],
["builtin", "xs:ID"],
["builtin", "xs:IDREF"],
["builtin", "xs:IDREFS"],
["builtin", "xs:int"],
["builtin", "xs:integer"],
["builtin", "xs:language"],
["builtin", "xs:long"],
["builtin", "xs:Name"],
["builtin", "xs:NCName"],
["builtin", "xs:negativeInteger"],
["builtin", "xs:NMTOKEN"],
["builtin", "xs:NMTOKENS"],
["builtin", "xs:nonNegativeInteger"],
["builtin", "xs:nonPositiveInteger"],
["builtin", "xs:normalizedString"],
["builtin", "xs:NOTATION"],
["builtin", "xs:positiveInteger"],
["builtin", "xs:QName"],
["builtin", "xs:short"],
["builtin", "xs:string"],
["builtin", "xs:time"],
["builtin", "xs:token"],
["builtin", "xs:unsignedByte"],
["builtin", "xs:unsignedInt"],
["builtin", "xs:unsignedLong"],
["builtin", "xs:unsignedShort"],
["builtin", "xs:untyped"],
["builtin", "xs:untypedAtomic"],
["builtin", "xs:yearMonthDuration"]
]
----------------------------------------------------
Checks for builtin types.

View File

@ -0,0 +1,11 @@
(# datypic:timeOut 200 #)
----------------------------------------------------
[
["extension", "(# datypic:timeOut 200 #)"]
]
----------------------------------------------------
Checks for extensions.

View File

@ -0,0 +1,43 @@
doc("catalog.xml")
generate-id($prod)
xs:QName("strings:trim")
declare function prod:countProds ($prods as element(product)*) as xs:string
false()
----------------------------------------------------
[
["function", "doc"],
["punctuation", "("],
["string", "\"catalog.xml\""],
["punctuation", ")"],
["function", "generate-id"],
["punctuation", "("],
["variable", "$prod"],
["punctuation", ")"],
["function", "xs:QName"],
["punctuation", "("],
["string", "\"strings:trim\""],
["punctuation", ")"],
["keyword", "declare"],
["keyword", "function"],
["function", "prod:countProds"],
["punctuation", "("],
["variable", "$prods"],
["keyword", "as"],
["function", "element"],
["punctuation", "("],
"product",
["punctuation", ")"],
["operator", "*"],
["punctuation", ")"],
["keyword", "as"],
["builtin", "xs:string"],
["function", "false"],
["punctuation", "("],
["punctuation", ")"]
]
----------------------------------------------------
Checks for functions.

View File

@ -0,0 +1,43 @@
and
castable as
div
eq
except
ge
gt
idiv
instance of
intersect
is
le
lt
mod
ne
or
union
----------------------------------------------------
[
["keyword-operator", "and"],
["keyword-operator", "castable as"],
["keyword-operator", "div"],
["keyword-operator", "eq"],
["keyword-operator", "except"],
["keyword-operator", "ge"],
["keyword-operator", "gt"],
["keyword-operator", "idiv"],
["keyword-operator", "instance of"],
["keyword-operator", "intersect"],
["keyword-operator", "is"],
["keyword-operator", "le"],
["keyword-operator", "lt"],
["keyword-operator", "mod"],
["keyword-operator", "ne"],
["keyword-operator", "or"],
["keyword-operator", "union"]
]
----------------------------------------------------
Checks for keyword operators.

View File

@ -0,0 +1,119 @@
as
ascending
at
base-uri
boundary-space
case
cast as
collation
construction
copy-namespaces
declare
default
descending
else
empty greatest
empty least
encoding
every
external
for
function
if
import
in
inherit
lax
let
map
module
namespace
no-inherit
no-preserve
option
order
order by
ordered
ordering
preserve
return
satisfies
schema
some
stable
strict
strip
then
to
treat as
typeswitch
unordered
validate
variable
version
where
xquery
----------------------------------------------------
[
["keyword", "as"],
["keyword", "ascending"],
["keyword", "at"],
["keyword", "base-uri"],
["keyword", "boundary-space"],
["keyword", "case"],
["keyword", "cast as"],
["keyword", "collation"],
["keyword", "construction"],
["keyword", "copy-namespaces"],
["keyword", "declare"],
["keyword", "default"],
["keyword", "descending"],
["keyword", "else"],
["keyword", "empty greatest"],
["keyword", "empty least"],
["keyword", "encoding"],
["keyword", "every"],
["keyword", "external"],
["keyword", "for"],
["keyword", "function"],
["keyword", "if"],
["keyword", "import"],
["keyword", "in"],
["keyword", "inherit"],
["keyword", "lax"],
["keyword", "let"],
["keyword", "map"],
["keyword", "module"],
["keyword", "namespace"],
["keyword", "no-inherit"],
["keyword", "no-preserve"],
["keyword", "option"],
["keyword", "order"],
["keyword", "order by"],
["keyword", "ordered"],
["keyword", "ordering"],
["keyword", "preserve"],
["keyword", "return"],
["keyword", "satisfies"],
["keyword", "schema"],
["keyword", "some"],
["keyword", "stable"],
["keyword", "strict"],
["keyword", "strip"],
["keyword", "then"],
["keyword", "to"],
["keyword", "treat as"],
["keyword", "typeswitch"],
["keyword", "unordered"],
["keyword", "validate"],
["keyword", "variable"],
["keyword", "version"],
["keyword", "where"],
["keyword", "xquery"]
]
----------------------------------------------------
Checks for keywords.

View File

@ -0,0 +1,17 @@
0
3.14159
42E8
3.25E-4
----------------------------------------------------
[
["number", "0"],
["number", "3.14159"],
["number", "42E8"],
["number", "3.25E-4"]
]
----------------------------------------------------
Checks for numbers.

View File

@ -0,0 +1,21 @@
+ - *
= ? | @
. ..
:= !=
< <= <<
> >= >>
----------------------------------------------------
[
["operator", "+"], ["operator", "-"], ["operator", "*"],
["operator", "="], ["operator", "?"], ["operator", "|"], ["operator", "@"],
["operator", "."], ["operator", ".."],
["operator", ":="], ["operator", "!="],
["operator", "<"], ["operator", "<="], ["operator", "<<"],
["operator", ">"], ["operator", ">="], ["operator", ">>"]
]
----------------------------------------------------
Checks for operators.

View File

@ -0,0 +1,71 @@
return <ul>
<!-- {concat(" List of ", $count, " products ")} -->
plaintext
{comment{concat(" List of ", $count, " products ")}}
</ul>
<h1>data($prod/name){data($prod/name)}{{data($prod/name)}}</h1>
----------------------------------------------------
[
["keyword", "return"],
["tag", [
["tag", [
["punctuation", "<"],
"ul"
]],
["punctuation", ">"]
]],
["comment", "<!-- {concat(\" List of \", $count, \" products \")} -->"],
["plain-text", "\r\nplaintext\r\n"],
["punctuation", "{"],
["builtin", "comment"],
["punctuation", "{"],
["function", "concat"],
["punctuation", "("],
["string", "\" List of \""],
["punctuation", ","],
["variable", "$count"],
["punctuation", ","],
["string", "\" products \""],
["punctuation", ")"],
["punctuation", "}"],
["punctuation", "}"],
["tag", [
["tag", [
["punctuation", "</"],
"ul"
]],
["punctuation", ">"]
]],
["tag", [
["tag", [
["punctuation", "<"],
"h1"
]],
["punctuation", ">"]
]],
["plain-text", "data($prod/name)"],
["punctuation", "{"],
["function", "data"],
["punctuation", "("],
["variable", "$prod"],
["punctuation", "/"],
"name",
["punctuation", ")"],
["punctuation", "}"],
["plain-text", "{{data($prod/name)}}"],
["tag", [
["tag", [
["punctuation", "</"],
"h1"
]],
["punctuation", ">"]
]]
]
----------------------------------------------------
Checks for plain-text between tags.

View File

@ -0,0 +1,25 @@
""
"Foo""bar"
"Foo'
bar""
baz"
''
'Foo''bar'
'Foo"
bar''
baz'
----------------------------------------------------
[
["string", "\"\""],
["string", "\"Foo\"\"bar\""],
["string", "\"Foo'\r\nbar\"\"\r\nbaz\""],
["string", "''"],
["string", "'Foo''bar'"],
["string", "'Foo\"\r\nbar''\r\nbaz'"]
]
----------------------------------------------------
Checks for strings.

View File

@ -0,0 +1,133 @@
<li dep="{$prod/@dept}">number: {data($prod/number)
}, name: {data($prod/name)}</li>
return <item num="{$item/@num}"
name="{$name}"
quan="{$item/@quantity}"/>
<li dep="{substring-after($prod/@dept, "-")}"/>
----------------------------------------------------
[
["tag", [
["tag", [
["punctuation", "<"],
"li"
]],
["attr-name", ["dep"]],
["attr-value", [
["punctuation", "=\""],
["expression", [
["punctuation", "{"],
["variable", "$prod"],
["punctuation", "/"],
["operator", "@"],
"dept",
["punctuation", "}"]
]],
["punctuation", "\""]
]],
["punctuation", ">"]
]],
["plain-text", "number: "],
["punctuation", "{"],
["function", "data"],
["punctuation", "("],
["variable", "$prod"],
["punctuation", "/"],
"number",
["punctuation", ")"],
["punctuation", "}"],
["plain-text", ", name: "],
["punctuation", "{"],
["function", "data"],
["punctuation", "("],
["variable", "$prod"],
["punctuation", "/"],
"name",
["punctuation", ")"],
["punctuation", "}"],
["tag", [
["tag", [
["punctuation", "</"],
"li"
]],
["punctuation", ">"]
]],
["keyword", "return"],
["tag", [
["tag", [
["punctuation", "<"],
"item"
]],
["attr-name", ["num"]],
["attr-value", [
["punctuation", "=\""],
["expression", [
["punctuation", "{"],
["variable", "$item"],
["punctuation", "/"],
["operator", "@"],
"num",
["punctuation", "}"]
]],
["punctuation", "\""]
]],
["attr-name", ["name"]],
["attr-value", [
["punctuation", "=\""],
["expression", [
["punctuation", "{"],
["variable", "$name"],
["punctuation", "}"]
]],
["punctuation", "\""]
]],
["attr-name", ["quan"]],
["attr-value", [
["punctuation", "=\""],
["expression", [
["punctuation", "{"],
["variable", "$item"],
["punctuation", "/"],
["operator", "@"],
"quantity",
["punctuation", "}"]
]],
["punctuation", "\""]
]],
["punctuation", "/>"]
]],
["tag", [
["tag", [
["punctuation", "<"],
"li"
]],
["attr-name", ["dep"]],
["attr-value", [
["punctuation", "=\""],
["expression", [
["punctuation", "{"],
["function", "substring-after"],
["punctuation", "("],
["variable", "$prod"],
["punctuation", "/"],
["operator", "@"],
"dept",
["punctuation", ","],
["string", "\"-\""],
["punctuation", ")"],
["punctuation", "}"]
]],
["punctuation", "\""]
]],
["punctuation", "/>"]
]]
]
----------------------------------------------------
Checks for XQuery inside tags.

View File

@ -0,0 +1,15 @@
$foo
$foo-bar
$strings:LetterA
----------------------------------------------------
[
["variable", "$foo"],
["variable", "$foo-bar"],
["variable", "$strings:LetterA"]
]
----------------------------------------------------
Checks for variables.

View File

@ -0,0 +1,18 @@
attribute foo
attribute foo-bar
attribute foo:bar
----------------------------------------------------
[
["builtin", "attribute"],
["xquery-attribute", "foo"],
["builtin", "attribute"],
["xquery-attribute", "foo-bar"],
["builtin", "attribute"],
["xquery-attribute", "foo:bar"]
]
----------------------------------------------------
Checks for XQuery attribute constructor.

View File

@ -0,0 +1,19 @@
(::)
(: Single line comment :)
(:Multi
line
comment:)
(: <html> :)
----------------------------------------------------
[
["xquery-comment", "(::)"],
["xquery-comment", "(: Single line comment :)"],
["xquery-comment", "(:Multi\r\nline\r\ncomment:)"],
["xquery-comment", "(: <html> :)"]
]
----------------------------------------------------
Checks for XQuery comments.

View File

@ -0,0 +1,18 @@
element html
element foo-bar
element foo:bar
----------------------------------------------------
[
["builtin", "element"],
["xquery-element", "html"],
["builtin", "element"],
["xquery-element", "foo-bar"],
["builtin", "element"],
["xquery-element", "foo:bar"]
]
----------------------------------------------------
Checks for XQuery element constructors.