update components

This commit is contained in:
Luke Pulverenti 2016-05-02 13:34:06 -04:00
parent 3f0cecbf02
commit 06ade66d61
881 changed files with 676 additions and 47086 deletions

View File

@ -36,7 +36,7 @@
"tag": "v1.5.0",
"commit": "c7402274efa2e3b2a905ffa25d70c2ff3309dc59"
},
"_source": "git://github.com/PolymerElements/iron-selector.git",
"_source": "git://github.com/polymerelements/iron-selector.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-selector"
"_originalSource": "polymerelements/iron-selector"
}

View File

@ -16,6 +16,7 @@
"**/.*",
"img",
"templates",
"tests",
"CNAME",
"*.html",
"style.css",
@ -26,14 +27,14 @@
"utopia.js",
"code.js"
],
"version": "1.4.1",
"_release": "1.4.1",
"version": "1.5.0",
"_release": "1.5.0",
"_resolution": {
"type": "version",
"tag": "v1.4.1",
"commit": "97b0eb5a1a74760c5c0f37f82116679b33876634"
"tag": "1.5.0",
"commit": "f4912eed9225c0acf974e53f3d1e3f962d3e7ddf"
},
"_source": "git://github.com/LeaVerou/prism.git",
"_source": "https://github.com/LeaVerou/prism.git",
"_target": "*",
"_originalSource": "prism"
}

View File

@ -1,5 +1,42 @@
# Prism Changelog
## 1.5.0 (2016-05-01)
### New components
* __Bro Language__ ([#925](https://github.com/PrismJS/prism/pull/925))
* __Protocol Buffers Language__ ([#938](https://github.com/PrismJS/prism/pull/938)) [[`ae4a4f2`](https://github.com/PrismJS/prism/commit/ae4a4f2)]
### Updated components
* __Keep Markup__:
* Fix Keep Markup plugin incorrect highlighting ([#880](https://github.com/PrismJS/prism/pull/880)) [[`24841ef`](https://github.com/PrismJS/prism/commit/24841ef)]
* __Groovy Language__:
* Fix double HTML-encoding bug in Groovy language [[`24a0936`](https://github.com/PrismJS/prism/commit/24a0936)]
* __Java Language__:
* Adding annotation token for Java ([#905](https://github.com/PrismJS/prism/pull/905)) [[`367ace6`](https://github.com/PrismJS/prism/commit/367ace6)]
* __SAS Language__:
* Add missing keywords for SAS ([#922](https://github.com/PrismJS/prism/pull/922))
* __YAML Language__:
* fix hilighting of YAML keys on first line of code block ([#943](https://github.com/PrismJS/prism/pull/943)) [[`f19db81`](https://github.com/PrismJS/prism/commit/f19db81)]
* __C# Language__:
* Support for generic methods in csharp [[`6f75735`](https://github.com/PrismJS/prism/commit/6f75735)]
### New plugins
* __Unescaped Markup__ [[`07d77e5`](https://github.com/PrismJS/prism/commit/07d77e5)]
* __Normalize Whitespace__ ([#847](https://github.com/PrismJS/prism/pull/847)) [[`e86ec01`](https://github.com/PrismJS/prism/commit/e86ec01)]
### Other changes
* Add JSPM support [[`ad048ab`](https://github.com/PrismJS/prism/commit/ad048ab)]
* update linear-gradient syntax from `left` to `to right` [[`cd234dc`](https://github.com/PrismJS/prism/commit/cd234dc)]
* Add after-property to allow ordering of plugins [[`224b7a1`](https://github.com/PrismJS/prism/commit/224b7a1)]
* Partial solution for the "Comment-like substrings"-problem [[`2705c50`](https://github.com/PrismJS/prism/commit/2705c50)]
* Add property 'aliasTitles' to components.js [[`54400fb`](https://github.com/PrismJS/prism/commit/54400fb)]
* Add before-highlightall hook [[`70a8602`](https://github.com/PrismJS/prism/commit/70a8602)]
* Fix catastrophic backtracking regex issues in JavaScript [[`ab65be2`](https://github.com/PrismJS/prism/commit/ab65be2)]
## 1.4.1 (2016-02-03)
### Other changes

View File

@ -16,6 +16,7 @@
"**/.*",
"img",
"templates",
"tests",
"CNAME",
"*.html",
"style.css",

View File

@ -44,6 +44,7 @@ var components = {
},
"markup": {
"title": "Markup",
"aliasTitles": { "html": "HTML", "xml": "XML", "svg": "SVG", "mathml": "MathML" },
"option": "default"
},
"css": {
@ -59,9 +60,6 @@ var components = {
"option": "default",
"require": "clike"
},
"abap": {
"title": "ABAP",
"owner": "dellagustin"
@ -121,6 +119,10 @@ var components = {
"title": "Brainfuck",
"owner": "Golmote"
},
"bro": {
"title": "Bro",
"owner": "wayward710"
},
"c": {
"title": "C",
"require": "clike",
@ -395,6 +397,11 @@ var components = {
"title": "Prolog",
"owner": "Golmote"
},
"protobuf": {
"title": "Protocol Buffers",
"require": "clike",
"owner": "just-boris"
},
"puppet": {
"title": "Puppet",
"owner": "Golmote"
@ -605,11 +612,19 @@ var components = {
"keep-markup": {
"title": "Keep Markup",
"owner": "Golmote",
"after": "normalize-whitespace",
"noCSS": true
},
"command-line": {
"title": "Command Line",
"owner": "chriswells0"
},
"unescaped-markup": "Unescaped Markup",
"normalize-whitespace": {
"title": "Normalize Whitespace",
"owner": "zeitgeist87",
"after": "unescaped-markup",
"noCSS": true
}
}
};

View File

@ -44,10 +44,12 @@
{
pattern: /((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,
lookbehind: true,
greedy: true,
inside: insideString
},
{
pattern: /("|')(?:\\?[\s\S])*?\1/g,
pattern: /(["'])(?:\\\\|\\?[^\\])*?\1/g,
greedy: true,
inside: insideString
}
],

View File

@ -1 +1 @@
!function(e){var t={variable:[{pattern:/\$?\(\([\w\W]+?\)\)/,inside:{variable:[{pattern:/(^\$\(\([\w\W]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\([^)]+\)|`[^`]+`/,inside:{variable:/^\$\(|^`|\)$|`$/}},/\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i]};e.languages.bash={shebang:{pattern:/^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,alias:"important"},comment:{pattern:/(^|[^"{\\])#.*/,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,lookbehind:!0,inside:t},{pattern:/("|')(?:\\?[\s\S])*?\1/g,inside:t}],variable:t.variable,"function":{pattern:/(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/,lookbehind:!0},keyword:{pattern:/(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/,lookbehind:!0},"boolean":{pattern:/(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/,lookbehind:!0},operator:/&&?|\|\|?|==?|!=?|<<<?|>>|<=?|>=?|=~/,punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];]/};var a=t.variable[1].inside;a["function"]=e.languages.bash["function"],a.keyword=e.languages.bash.keyword,a.boolean=e.languages.bash.boolean,a.operator=e.languages.bash.operator,a.punctuation=e.languages.bash.punctuation}(Prism);
!function(e){var t={variable:[{pattern:/\$?\(\([\w\W]+?\)\)/,inside:{variable:[{pattern:/(^\$\(\([\w\W]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\([^)]+\)|`[^`]+`/,inside:{variable:/^\$\(|^`|\)$|`$/}},/\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i]};e.languages.bash={shebang:{pattern:/^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,alias:"important"},comment:{pattern:/(^|[^"{\\])#.*/,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,lookbehind:!0,greedy:!0,inside:t},{pattern:/(["'])(?:\\\\|\\?[^\\])*?\1/g,greedy:!0,inside:t}],variable:t.variable,"function":{pattern:/(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/,lookbehind:!0},keyword:{pattern:/(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/,lookbehind:!0},"boolean":{pattern:/(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/,lookbehind:!0},operator:/&&?|\|\|?|==?|!=?|<<<?|>>|<=?|>=?|=~/,punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];]/};var a=t.variable[1].inside;a["function"]=e.languages.bash["function"],a.keyword=e.languages.bash.keyword,a.boolean=e.languages.bash.boolean,a.operator=e.languages.bash.operator,a.punctuation=e.languages.bash.punctuation}(Prism);

View File

@ -0,0 +1,50 @@
Prism.languages.bro = {
'comment': {
pattern: /(^|[^\\$])#.*/,
lookbehind: true,
inside: {
'italic': /\b(TODO|FIXME|XXX)\b/
}
},
'string': {
pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true
},
'boolean': /\b(T|F)\b/,
'function': {
pattern: /(?:function|hook|event) [a-zA-Z0-9_]+(::[a-zA-Z0-9_]+)?/,
inside: {
keyword: /^(?:function|hook|event)/
}
},
'variable': {
pattern: /(?:global|local) [a-zA-Z0-9_]+/i,
inside: {
keyword: /(?:global|local)/
}
},
'builtin':
/(@(load(-(sigs|plugin))?|unload|prefixes|ifn?def|else|(end)?if|DIR|FILENAME))|(&?(redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,
'constant': {
pattern: /const [a-zA-Z0-9_]+/i,
inside: {
keyword: /const/
}
},
'keyword':
/\b(break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/,
'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,
'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
'punctuation': /[{}[\];(),.:]/
};

View File

@ -0,0 +1 @@
Prism.languages.bro={comment:{pattern:/(^|[^\\$])#.*/,lookbehind:!0,inside:{italic:/\b(TODO|FIXME|XXX)\b/}},string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"boolean":/\b(T|F)\b/,"function":{pattern:/(?:function|hook|event) [a-zA-Z0-9_]+(::[a-zA-Z0-9_]+)?/,inside:{keyword:/^(?:function|hook|event)/}},variable:{pattern:/(?:global|local) [a-zA-Z0-9_]+/i,inside:{keyword:/(?:global|local)/}},builtin:/(@(load(-(sigs|plugin))?|unload|prefixes|ifn?def|else|(end)?if|DIR|FILENAME))|(&?(redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|group|error_handler|type_column))/,constant:{pattern:/const [a-zA-Z0-9_]+/i,inside:{keyword:/const/}},keyword:/\b(break|next|continue|alarm|using|of|add|delete|export|print|return|schedule|when|timeout|addr|any|bool|count|double|enum|file|int|interval|pattern|opaque|port|record|set|string|subnet|table|time|vector|for|if|else|in|module|function)\b/,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,punctuation:/[{}[\];(),.:]/};

View File

@ -9,7 +9,10 @@ Prism.languages.clike = {
lookbehind: true
}
],
'string': /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
'string': {
pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true
},
'class-name': {
pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,
lookbehind: true,

View File

@ -1 +1 @@
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};

View File

@ -12,11 +12,15 @@ Prism.languages.coffeescript = Prism.languages.extend('javascript', {
'string': [
// Strings are multiline
/'(?:\\?[^\\])*?'/,
{
pattern: /'(?:\\?[^\\])*?'/,
greedy: true,
},
{
// Strings are multiline
pattern: /"(?:\\?[^\\])*?"/,
greedy: true,
inside: {
'interpolation': interpolation
}
@ -62,10 +66,12 @@ Prism.languages.insertBefore('coffeescript', 'string', {
'multiline-string': [
{
pattern: /'''[\s\S]*?'''/,
greedy: true,
alias: 'string'
},
{
pattern: /"""[\s\S]*?"""/,
greedy: true,
alias: 'string',
inside: {
interpolation: interpolation

View File

@ -1 +1 @@
!function(e){var n=/#(?!\{).+/,t={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:n,string:[/'(?:\\?[^\\])*?'/,{pattern:/"(?:\\?[^\\])*?"/,inside:{interpolation:t}}],keyword:/\b(and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:t}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\?[\s\S])*?`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},rest:e.languages.javascript}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,alias:"string"},{pattern:/"""[\s\S]*?"""/,alias:"string",inside:{interpolation:t}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/})}(Prism);
!function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\?[^\\])*?'/,greedy:!0},{pattern:/"(?:\\?[^\\])*?"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\?[\s\S])*?`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},rest:e.languages.javascript}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/})}(Prism);

View File

@ -89,19 +89,19 @@ var _ = _self.Prism = {
insertBefore: function (inside, before, insert, root) {
root = root || _.languages;
var grammar = root[inside];
if (arguments.length == 2) {
insert = arguments[1];
for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
grammar[newToken] = insert[newToken];
}
}
return grammar;
}
var ret = {};
for (var token in grammar) {
@ -121,7 +121,7 @@ var _ = _self.Prism = {
ret[token] = grammar[token];
}
}
// Update references in other language definitions
_.languages.DFS(_.languages, function(key, value) {
if (value === root[inside] && key != inside) {
@ -152,12 +152,19 @@ var _ = _self.Prism = {
}
},
plugins: {},
highlightAll: function(async, callback) {
var elements = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');
var env = {
callback: callback,
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
};
_.hooks.run("before-highlightall", env);
var elements = env.elements || document.querySelectorAll(env.selector);
for (var i=0, element; element = elements[i++];) {
_.highlightElement(element, async === true, callback);
_.highlightElement(element, async === true, env.callback);
}
},
@ -193,7 +200,9 @@ var _ = _self.Prism = {
code: code
};
if (!code || !grammar) {
_.hooks.run('before-sanity-check', env);
if (!env.code || !env.grammar) {
_.hooks.run('complete', env);
return;
}
@ -267,6 +276,7 @@ var _ = _self.Prism = {
var pattern = patterns[j],
inside = pattern.inside,
lookbehind = !!pattern.lookbehind,
greedy = !!pattern.greedy,
lookbehindLength = 0,
alias = pattern.alias;
@ -287,36 +297,76 @@ var _ = _self.Prism = {
pattern.lastIndex = 0;
var match = pattern.exec(str);
var match = pattern.exec(str),
delNum = 1;
if (match) {
if(lookbehind) {
lookbehindLength = match[1].length;
// Greedy patterns can override/remove up to two previously matched tokens
if (!match && greedy && i != strarr.length - 1) {
// Reconstruct the original text using the next two tokens
var nextToken = strarr[i + 1].matchedStr || strarr[i + 1],
combStr = str + nextToken;
if (i < strarr.length - 2) {
combStr += strarr[i + 2].matchedStr || strarr[i + 2];
}
var from = match.index - 1 + lookbehindLength,
match = match[0].slice(lookbehindLength),
len = match.length,
to = from + len,
before = str.slice(0, from + 1),
after = str.slice(to + 1);
var args = [i, 1];
if (before) {
args.push(before);
// Try the pattern again on the reconstructed text
pattern.lastIndex = 0;
match = pattern.exec(combStr);
if (!match) {
continue;
}
var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias);
args.push(wrapped);
if (after) {
args.push(after);
var from = match.index + (lookbehind ? match[1].length : 0);
// To be a valid candidate, the new match has to start inside of str
if (from >= str.length) {
continue;
}
var to = match.index + match[0].length,
len = str.length + nextToken.length;
Array.prototype.splice.apply(strarr, args);
// Number of tokens to delete and replace with the new match
delNum = 3;
if (to <= len) {
if (strarr[i + 1].greedy) {
continue;
}
delNum = 2;
combStr = combStr.slice(0, len);
}
str = combStr;
}
if (!match) {
continue;
}
if(lookbehind) {
lookbehindLength = match[1].length;
}
var from = match.index + lookbehindLength,
match = match[0].slice(lookbehindLength),
to = from + match.length,
before = str.slice(0, from),
after = str.slice(to);
var args = [i, delNum];
if (before) {
args.push(before);
}
var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);
args.push(wrapped);
if (after) {
args.push(after);
}
Array.prototype.splice.apply(strarr, args);
}
}
}
@ -349,10 +399,13 @@ var _ = _self.Prism = {
}
};
var Token = _.Token = function(type, content, alias) {
var Token = _.Token = function(type, content, alias, matchedStr, greedy) {
this.type = type;
this.content = content;
this.alias = alias;
// Copy of the full string this token was created from
this.matchedStr = matchedStr || null;
this.greedy = !!greedy;
};
Token.stringify = function(o, language, parent) {

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,14 @@ Prism.languages.csharp = Prism.languages.extend('clike', {
});
Prism.languages.insertBefore('csharp', 'keyword', {
'generic-method': {
pattern: /[a-z0-9_]+\s*<[^>\r\n]+?>\s*(?=\()/i,
alias: 'function',
inside: {
keyword: Prism.languages.csharp.keyword,
punctuation: /[<>(),.:]/
}
},
'preprocessor': {
pattern: /(^\s*)#.*/m,
lookbehind: true,

View File

@ -1 +1 @@
Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+f?)\b/i}),Prism.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});
Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+f?)\b/i}),Prism.languages.insertBefore("csharp","keyword",{"generic-method":{pattern:/[a-z0-9_]+\s*<[^>\r\n]+?>\s*(?=\()/i,alias:"function",inside:{keyword:Prism.languages.csharp.keyword,punctuation:/[<>(),.:]/}},preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});

View File

@ -1,6 +1,15 @@
Prism.languages.groovy = Prism.languages.extend('clike', {
'keyword': /\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,
'string': /("""|''')[\W\w]*?\1|("|'|\/)(?:\\?.)*?\2|(\$\/)(\$\/\$|[\W\w])*?\/\$/,
'string': [
{
pattern: /("""|''')[\W\w]*?\1|(\$\/)(\$\/\$|[\W\w])*?\/\$/,
greedy: true
},
{
pattern: /("|'|\/)(?:\\?.)*?\1/,
greedy: true
},
],
'number': /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?[\d]+)?)[glidf]?\b/i,
'operator': {
pattern: /(^|[^.])(~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.{1,2}(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,
@ -22,6 +31,7 @@ Prism.languages.insertBefore('groovy', 'punctuation', {
Prism.languages.insertBefore('groovy', 'function', {
'annotation': {
alias: 'punctuation',
pattern: /(^|[^.])@\w+/,
lookbehind: true
}
@ -37,6 +47,10 @@ Prism.hooks.add('wrap', function(env) {
if (delimiter === '$') {
pattern = /([^\$])(\$(\{.*?\}|[\w\.]+))/;
}
// To prevent double HTML-ecoding we have to decode env.content first
env.content = env.content.replace(/&amp;/g, '&').replace(/&lt;/g, '<');
env.content = Prism.highlight(env.content, {
'expression': {
pattern: pattern,

View File

@ -1 +1 @@
Prism.languages.groovy=Prism.languages.extend("clike",{keyword:/\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,string:/("""|''')[\W\w]*?\1|("|'|\/)(?:\\?.)*?\2|(\$\/)(\$\/\$|[\W\w])*?\/\$/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?[\d]+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.{1,2}(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(setup|given|when|then|and|cleanup|expect|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0}}),Prism.hooks.add("wrap",function(e){if("groovy"===e.language&&"string"===e.type){var t=e.content[0];if("'"!=t){var n=/([^\\])(\$(\{.*?\}|[\w\.]+))/;"$"===t&&(n=/([^\$])(\$(\{.*?\}|[\w\.]+))/),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring")}}});
Prism.languages.groovy=Prism.languages.extend("clike",{keyword:/\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,string:[{pattern:/("""|''')[\W\w]*?\1|(\$\/)(\$\/\$|[\W\w])*?\/\$/,greedy:!0},{pattern:/("|'|\/)(?:\\?.)*?\1/,greedy:!0}],number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?[\d]+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.{1,2}(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(setup|given|when|then|and|cleanup|expect|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0}}),Prism.hooks.add("wrap",function(e){if("groovy"===e.language&&"string"===e.type){var t=e.content[0];if("'"!=t){var n=/([^\\])(\$(\{.*?\}|[\w\.]+))/;"$"===t&&(n=/([^\$])(\$(\{.*?\}|[\w\.]+))/),e.content=e.content.replace(/&amp;/g,"&").replace(/&lt;/g,"<"),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring")}}});

View File

@ -4,7 +4,10 @@ Prism.languages.haskell= {
lookbehind: true
},
'char': /'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,
'string': /"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/,
'string': {
pattern: /"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/,
greedy: true
},
'keyword' : /\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,
'import_statement' : {
// The imported or hidden names are not included in this import

View File

@ -1 +1 @@
Prism.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\w\W]*?-})/m,lookbehind:!0},"char":/'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,string:/"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/,keyword:/\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,import_statement:{pattern:/(\r?\n|\r|^)\s*import\s+(qualified\s+)?([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*(\s+as\s+([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*)?(\s+hiding\b)?/m,inside:{keyword:/\b(import|qualified|as|hiding)\b/}},builtin:/\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(\d+(\.\d+)?(e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`/,hvariable:/\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/,constant:/\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/,punctuation:/[{}[\];(),.:]/};
Prism.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\w\W]*?-})/m,lookbehind:!0},"char":/'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,string:{pattern:/"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/,greedy:!0},keyword:/\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,import_statement:{pattern:/(\r?\n|\r|^)\s*import\s+(qualified\s+)?([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*(\s+as\s+([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*)?(\s+hiding\b)?/m,inside:{keyword:/\b(import|qualified|as|hiding)\b/}},builtin:/\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(\d+(\.\d+)?(e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`/,hvariable:/\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/,constant:/\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/,punctuation:/[{}[\];(),.:]/};

View File

@ -5,4 +5,12 @@ Prism.languages.java = Prism.languages.extend('clike', {
pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,
lookbehind: true
}
});
});
Prism.languages.insertBefore('java','function', {
'annotation': {
alias: 'punctuation',
pattern: /(^|[^.])@\w+/,
lookbehind: true
}
});

View File

@ -1 +1 @@
Prism.languages.java=Prism.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}});
Prism.languages.java=Prism.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),Prism.languages.insertBefore("java","function",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0}});

View File

@ -8,13 +8,15 @@ Prism.languages.javascript = Prism.languages.extend('clike', {
Prism.languages.insertBefore('javascript', 'keyword', {
'regex': {
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
lookbehind: true
lookbehind: true,
greedy: true
}
});
Prism.languages.insertBefore('javascript', 'class-name', {
'template-string': {
pattern: /`(?:\\`|\\?[^`])*`/,
pattern: /`(?:\\\\|\\?[^\\])*?`/,
greedy: true,
inside: {
'interpolation': {
pattern: /\$\{[^}]+\}/,

View File

@ -1 +1 @@
Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript;
Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript;

View File

@ -55,13 +55,7 @@
}
];
Prism.languages.kotlin['string'] = {
pattern: Prism.languages.kotlin['string'],
inside: {
interpolation: interpolation
}
};
Prism.languages.kotlin['raw-string'].inside = {
Prism.languages.kotlin['string'].inside = Prism.languages.kotlin['raw-string'].inside = {
interpolation: interpolation
};

View File

@ -1 +1 @@
!function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|else|enum|final|finally|for|fun|get|if|import|in|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|out|override|package|private|protected|public|reified|return|sealed|set|super|tailrec|this|throw|to|try|val|var|when|where|while)\b/,lookbehind:!0},"function":[/\w+(?=\s*\()/,{pattern:/(\.)\w+(?=\s*\{)/,lookbehind:!0}],number:/\b(?:0[bx][\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"],n.languages.insertBefore("kotlin","string",{"raw-string":{pattern:/(["'])\1\1[\s\S]*?\1{3}/,alias:"string"}}),n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\w+@|@\w+/,alias:"symbol"}});var e=[{pattern:/\$\{[^}]+\}/,inside:{delimiter:{pattern:/^\$\{|\}$/,alias:"variable"},rest:n.util.clone(n.languages.kotlin)}},{pattern:/\$\w+/,alias:"variable"}];n.languages.kotlin.string={pattern:n.languages.kotlin.string,inside:{interpolation:e}},n.languages.kotlin["raw-string"].inside={interpolation:e}}(Prism);
!function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|else|enum|final|finally|for|fun|get|if|import|in|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|out|override|package|private|protected|public|reified|return|sealed|set|super|tailrec|this|throw|to|try|val|var|when|where|while)\b/,lookbehind:!0},"function":[/\w+(?=\s*\()/,{pattern:/(\.)\w+(?=\s*\{)/,lookbehind:!0}],number:/\b(?:0[bx][\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"],n.languages.insertBefore("kotlin","string",{"raw-string":{pattern:/(["'])\1\1[\s\S]*?\1{3}/,alias:"string"}}),n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\w+@|@\w+/,alias:"symbol"}});var e=[{pattern:/\$\{[^}]+\}/,inside:{delimiter:{pattern:/^\$\{|\}$/,alias:"variable"},rest:n.util.clone(n.languages.kotlin)}},{pattern:/\$\w+/,alias:"variable"}];n.languages.kotlin.string.inside=n.languages.kotlin["raw-string"].inside={interpolation:e}}(Prism);

View File

@ -1,7 +1,10 @@
Prism.languages.lua = {
'comment': /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,
// \z may be used to skip the following space
'string': /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,
'string': {
pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,
greedy: true
},
'number': /\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,
'keyword': /\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,
'function': /(?!\d)\w+(?=\s*(?:[({]))/,

View File

@ -1 +1 @@
Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,number:/\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,"function":/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/};
Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,"function":/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/};

View File

@ -12,6 +12,7 @@ Prism.languages.powershell = {
'string': [
{
pattern: /"(`?[\w\W])*?"/,
greedy: true,
inside: {
'function': {
pattern: /[^`]\$\(.*?\)/,
@ -20,7 +21,10 @@ Prism.languages.powershell = {
}
}
},
/'([^']|'')*'/
{
pattern: /'([^']|'')*'/,
greedy: true
}
],
// Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
'namespace': /\[[a-z][\w\W]*?\]/i,

View File

@ -1 +1 @@
Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\w\W]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.+/,lookbehind:!0}],string:[{pattern:/"(`?[\w\W])*?"/,inside:{"function":{pattern:/[^`]\$\(.*?\)/,inside:{}}}},/'([^']|'')*'/],namespace:/\[[a-z][\w\W]*?\]/i,"boolean":/\$(true|false)\b/i,variable:/\$\w+\b/i,"function":[/\b(Add-(Computer|Content|History|Member|PSSnapin|Type)|Checkpoint-Computer|Clear-(Content|EventLog|History|Item|ItemProperty|Variable)|Compare-Object|Complete-Transaction|Connect-PSSession|ConvertFrom-(Csv|Json|StringData)|Convert-Path|ConvertTo-(Csv|Html|Json|Xml)|Copy-(Item|ItemProperty)|Debug-Process|Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Disconnect-PSSession|Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Enter-PSSession|Exit-PSSession|Export-(Alias|Clixml|Console|Csv|FormatData|ModuleMember|PSSession)|ForEach-Object|Format-(Custom|List|Table|Wide)|Get-(Alias|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Culture|Date|Event|EventLog|EventSubscriber|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|WmiObject)|Group-Object|Import-(Alias|Clixml|Csv|LocalizedData|Module|PSSession)|Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)|Join-Path|Limit-EventLog|Measure-(Command|Object)|Move-(Item|ItemProperty)|New-(Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy)|Out-(Default|File|GridView|Host|Null|Printer|String)|Pop-Location|Push-Location|Read-Host|Receive-(Job|PSSession)|Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Remove-(Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)|Rename-(Computer|Item|ItemProperty)|Reset-ComputerMachinePassword|Resolve-Path|Restart-(Computer|Service)|Restore-Computer|Resume-(Job|Service)|Save-Help|Select-(Object|String|Xml)|Send-MailMessage|Set-(Alias|Content|Date|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)|Show-(Command|ControlPanelItem|EventLog)|Sort-Object|Split-Path|Start-(Job|Process|Service|Sleep|Transaction)|Stop-(Computer|Job|Process|Service)|Suspend-(Job|Service)|Tee-Object|Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)|Trace-Command|Unblock-File|Undo-Transaction|Unregister-(Event|PSSessionConfiguration)|Update-(FormatData|Help|List|TypeData)|Use-Transaction|Wait-(Event|Job|Process)|Where-Object|Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning))\b/i,/\b(ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(\W?)(!|-(eq|ne|gt|ge|lt|le|sh[lr]|not|b?(and|x?or)|(Not)?(Like|Match|Contains|In)|Replace|Join|is(Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/},Prism.languages.powershell.string[0].inside.boolean=Prism.languages.powershell.boolean,Prism.languages.powershell.string[0].inside.variable=Prism.languages.powershell.variable,Prism.languages.powershell.string[0].inside.function.inside=Prism.util.clone(Prism.languages.powershell);
Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\w\W]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.+/,lookbehind:!0}],string:[{pattern:/"(`?[\w\W])*?"/,greedy:!0,inside:{"function":{pattern:/[^`]\$\(.*?\)/,inside:{}}}},{pattern:/'([^']|'')*'/,greedy:!0}],namespace:/\[[a-z][\w\W]*?\]/i,"boolean":/\$(true|false)\b/i,variable:/\$\w+\b/i,"function":[/\b(Add-(Computer|Content|History|Member|PSSnapin|Type)|Checkpoint-Computer|Clear-(Content|EventLog|History|Item|ItemProperty|Variable)|Compare-Object|Complete-Transaction|Connect-PSSession|ConvertFrom-(Csv|Json|StringData)|Convert-Path|ConvertTo-(Csv|Html|Json|Xml)|Copy-(Item|ItemProperty)|Debug-Process|Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Disconnect-PSSession|Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Enter-PSSession|Exit-PSSession|Export-(Alias|Clixml|Console|Csv|FormatData|ModuleMember|PSSession)|ForEach-Object|Format-(Custom|List|Table|Wide)|Get-(Alias|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Culture|Date|Event|EventLog|EventSubscriber|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|WmiObject)|Group-Object|Import-(Alias|Clixml|Csv|LocalizedData|Module|PSSession)|Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)|Join-Path|Limit-EventLog|Measure-(Command|Object)|Move-(Item|ItemProperty)|New-(Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy)|Out-(Default|File|GridView|Host|Null|Printer|String)|Pop-Location|Push-Location|Read-Host|Receive-(Job|PSSession)|Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Remove-(Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)|Rename-(Computer|Item|ItemProperty)|Reset-ComputerMachinePassword|Resolve-Path|Restart-(Computer|Service)|Restore-Computer|Resume-(Job|Service)|Save-Help|Select-(Object|String|Xml)|Send-MailMessage|Set-(Alias|Content|Date|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)|Show-(Command|ControlPanelItem|EventLog)|Sort-Object|Split-Path|Start-(Job|Process|Service|Sleep|Transaction)|Stop-(Computer|Job|Process|Service)|Suspend-(Job|Service)|Tee-Object|Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)|Trace-Command|Unblock-File|Undo-Transaction|Unregister-(Event|PSSessionConfiguration)|Update-(FormatData|Help|List|TypeData)|Use-Transaction|Wait-(Event|Job|Process)|Where-Object|Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning))\b/i,/\b(ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(\W?)(!|-(eq|ne|gt|ge|lt|le|sh[lr]|not|b?(and|x?or)|(Not)?(Like|Match|Contains|In)|Replace|Join|is(Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/},Prism.languages.powershell.string[0].inside.boolean=Prism.languages.powershell.boolean,Prism.languages.powershell.string[0].inside.variable=Prism.languages.powershell.variable,Prism.languages.powershell.string[0].inside.function.inside=Prism.util.clone(Prism.languages.powershell);

View File

@ -0,0 +1,8 @@
Prism.languages.protobuf = Prism.languages.extend('clike', {
keyword: /\b(package|import|message|enum)\b/,
builtin: /\b(required|repeated|optional|reserved)\b/,
primitive: {
pattern: /\b(double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/,
alias: 'symbol'
}
});

View File

@ -0,0 +1 @@
Prism.languages.protobuf=Prism.languages.extend("clike",{keyword:/\b(package|import|message|enum)\b/,builtin:/\b(required|repeated|optional|reserved)\b/,primitive:{pattern:/\b(double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/,alias:"symbol"}});

View File

@ -7,7 +7,10 @@ Prism.languages.python= {
pattern: /(^|[^\\])#.*/,
lookbehind: true
},
'string': /("|')(?:\\?.)*?\1/,
'string': {
pattern: /("|')(?:\\\\|\\?[^\\\r\n])*?\1/,
greedy: true
},
'function' : {
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,
lookbehind: true

View File

@ -1 +1 @@
Prism.languages.python={"triple-quoted-string":{pattern:/"""[\s\S]+?"""|'''[\s\S]+?'''/,alias:"string"},comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/};
Prism.languages.python={"triple-quoted-string":{pattern:/"""[\s\S]+?"""|'''[\s\S]+?'''/,alias:"string"},comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/("|')(?:\\\\|\\?[^\\\r\n])*?\1/,greedy:!0},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/};

View File

@ -23,9 +23,9 @@ Prism.languages.sas = {
alias: 'number'
},
'string': /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
'keyword': /\b(?:data|else|format|if|input|proc|run|then)\b/i,
'keyword': /\b(?:data|else|format|if|input|proc\s\w+|quit|run|then)\b/i,
// Decimal (1.2e23), hexadecimal (0c1x)
'number': /(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,
'operator': /\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,
'punctuation': /[$%@.(){}\[\];,\\]/
};
};

View File

@ -1 +1 @@
Prism.languages.sas={datalines:{pattern:/^\s*(?:(?:data)?lines|cards);[\s\S]+?(?:\r?\n|\r);/im,alias:"string",inside:{keyword:{pattern:/^(\s*)(?:(?:data)?lines|cards)/i,lookbehind:!0},punctuation:/;/}},comment:[{pattern:/(^\s*|;\s*)\*.*;/m,lookbehind:!0},/\/\*[\s\S]+?\*\//],datetime:{pattern:/'[^']+'(?:dt?|t)\b/i,alias:"number"},string:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,keyword:/\b(?:data|else|format|if|input|proc|run|then)\b/i,number:/(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,operator:/\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,punctuation:/[$%@.(){}\[\];,\\]/};
Prism.languages.sas={datalines:{pattern:/^\s*(?:(?:data)?lines|cards);[\s\S]+?(?:\r?\n|\r);/im,alias:"string",inside:{keyword:{pattern:/^(\s*)(?:(?:data)?lines|cards)/i,lookbehind:!0},punctuation:/;/}},comment:[{pattern:/(^\s*|;\s*)\*.*;/m,lookbehind:!0},/\/\*[\s\S]+?\*\//],datetime:{pattern:/'[^']+'(?:dt?|t)\b/i,alias:"number"},string:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,keyword:/\b(?:data|else|format|if|input|proc\s\w+|quit|run|then)\b/i,number:/(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,operator:/\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,punctuation:/[$%@.(){}\[\];,\\]/};

View File

@ -1,6 +1,15 @@
Prism.languages.scala = Prism.languages.extend('java', {
'keyword': /<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,
'string': /"""[\W\w]*?"""|"(?:[^"\\\r\n]|\\.)*"|'(?:[^\\\r\n']|\\.[^\\']*)'/,
'string': [
{
pattern: /"""[\W\w]*?"""/,
greedy: true
},
{
pattern: /("|')(?:\\\\|\\?[^\\\r\n])*?\1/,
greedy: true
},
],
'builtin': /\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,
'number': /\b(?:0x[\da-f]*\.?[\da-f]+|\d*\.?\d+e?\d*[dfl]?)\b/i,
'symbol': /'[^\d\s\\]\w*/

View File

@ -1 +1 @@
Prism.languages.scala=Prism.languages.extend("java",{keyword:/<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,string:/"""[\W\w]*?"""|"(?:[^"\\\r\n]|\\.)*"|'(?:[^\\\r\n']|\\.[^\\']*)'/,builtin:/\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,number:/\b(?:0x[\da-f]*\.?[\da-f]+|\d*\.?\d+e?\d*[dfl]?)\b/i,symbol:/'[^\d\s\\]\w*/}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala["function"];
Prism.languages.scala=Prism.languages.extend("java",{keyword:/<-|=>|\b(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|null|object|override|package|private|protected|return|sealed|self|super|this|throw|trait|try|type|val|var|while|with|yield)\b/,string:[{pattern:/"""[\W\w]*?"""/,greedy:!0},{pattern:/("|')(?:\\\\|\\?[^\\\r\n])*?\1/,greedy:!0}],builtin:/\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,number:/\b(?:0x[\da-f]*\.?[\da-f]+|\d*\.?\d+e?\d*[dfl]?)\b/i,symbol:/'[^\d\s\\]\w*/}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala["function"];

View File

@ -2,6 +2,7 @@
Prism.languages.swift = Prism.languages.extend('clike', {
'string': {
pattern: /("|')(\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true,
inside: {
'interpolation': {
pattern: /\\\((?:[^()]|\([^)]+\))+\)/,

View File

@ -1 +1 @@
Prism.languages.swift=Prism.languages.extend("clike",{string:{pattern:/("|')(\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,inside:{interpolation:{pattern:/\\\((?:[^()]|\([^)]+\))+\)/,inside:{delimiter:{pattern:/^\\\(|\)$/,alias:"variable"}}}}},keyword:/\b(as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|Protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/,number:/\b([\d_]+(\.[\de_]+)?|0x[a-f0-9_]+(\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,constant:/\b(nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,atrule:/@\b(IB(?:Outlet|Designable|Action|Inspectable)|class_protocol|exported|noreturn|NS(?:Copying|Managed)|objc|UIApplicationMain|auto_closure)\b/,builtin:/\b([A-Z]\S+|abs|advance|alignof(?:Value)?|assert|contains|count(?:Elements)?|debugPrint(?:ln)?|distance|drop(?:First|Last)|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lexicographicalCompare|map|max(?:Element)?|min(?:Element)?|numericCast|overlaps|partition|print(?:ln)?|reduce|reflect|reverse|sizeof(?:Value)?|sort(?:ed)?|split|startsWith|stride(?:of(?:Value)?)?|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|with(?:ExtendedLifetime|Unsafe(?:MutablePointers?|Pointers?)|VaList))\b/}),Prism.languages.swift.string.inside.interpolation.inside.rest=Prism.util.clone(Prism.languages.swift);
Prism.languages.swift=Prism.languages.extend("clike",{string:{pattern:/("|')(\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/\\\((?:[^()]|\([^)]+\))+\)/,inside:{delimiter:{pattern:/^\\\(|\)$/,alias:"variable"}}}}},keyword:/\b(as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|Protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/,number:/\b([\d_]+(\.[\de_]+)?|0x[a-f0-9_]+(\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,constant:/\b(nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,atrule:/@\b(IB(?:Outlet|Designable|Action|Inspectable)|class_protocol|exported|noreturn|NS(?:Copying|Managed)|objc|UIApplicationMain|auto_closure)\b/,builtin:/\b([A-Z]\S+|abs|advance|alignof(?:Value)?|assert|contains|count(?:Elements)?|debugPrint(?:ln)?|distance|drop(?:First|Last)|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lexicographicalCompare|map|max(?:Element)?|min(?:Element)?|numericCast|overlaps|partition|print(?:ln)?|reduce|reflect|reverse|sizeof(?:Value)?|sort(?:ed)?|split|startsWith|stride(?:of(?:Value)?)?|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|with(?:ExtendedLifetime|Unsafe(?:MutablePointers?|Pointers?)|VaList))\b/}),Prism.languages.swift.string.inside.interpolation.inside.rest=Prism.util.clone(Prism.languages.swift);

View File

@ -6,7 +6,7 @@ Prism.languages.yaml = {
},
'comment': /#.*/,
'key': {
pattern: /(\s*[:\-,[{\r\n?][ \t]*(![^\s]+)?[ \t]*)[^\r\n{[\]},#]+?(?=\s*:\s)/,
pattern: /(\s*(?:^|[:\-,[{\r\n?])[ \t]*(![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,
lookbehind: true,
alias: 'atrule'
},

View File

@ -1 +1 @@
Prism.languages.yaml={scalar:{pattern:/([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\3[^\r\n]+)*)/,lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:/(\s*[:\-,[{\r\n?][ \t]*(![^\s]+)?[ \t]*)[^\r\n{[\]},#]+?(?=\s*:\s)/,lookbehind:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[ \t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*($|,|]|}))/m,lookbehind:!0,alias:"number"},"boolean":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},"null":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},string:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')(?=[ \t]*($|,|]|}))/m,lookbehind:!0},number:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\da-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,lookbehind:!0},tag:/![^\s]+/,important:/[&*][\w]+/,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./};
Prism.languages.yaml={scalar:{pattern:/([\-:]\s*(![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\3[^\r\n]+)*)/,lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:/(\s*(?:^|[:\-,[{\r\n?])[ \t]*(![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,lookbehind:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(\d{4}-\d\d?-\d\d?([tT]|[ \t]+)\d\d?:\d{2}:\d{2}(\.\d*)?[ \t]*(Z|[-+]\d\d?(:\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(:\d{2}(\.\d*)?)?)(?=[ \t]*($|,|]|}))/m,lookbehind:!0,alias:"number"},"boolean":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(true|false)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},"null":{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)(null|~)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},string:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')(?=[ \t]*($|,|]|}))/m,lookbehind:!0},number:{pattern:/([:\-,[{]\s*(![^\s]+)?[ \t]*)[+\-]?(0x[\da-f]+|0o[0-7]+|(\d+\.?\d*|\.?\d+)(e[\+\-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,lookbehind:!0},tag:/![^\s]+/,important:/[&*][\w]+/,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./};

View File

@ -70,6 +70,10 @@ gulp.task('languages-plugins', function (cb) {
languagesMap[p] = title;
}
for (var name in data.languages[p].aliasTitles) {
languagesMap[name] = data.languages[p].aliasTitles[name];
}
if(data.languages[p].require) {
dependenciesMap[p] = data.languages[p].require;
}

View File

@ -1,6 +1,6 @@
{
"name": "prismjs",
"version": "1.4.1",
"version": "1.5.0",
"description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.",
"main": "prism.js",
"scripts": {
@ -27,5 +27,17 @@
"gulp-replace": "^0.5.4",
"mocha": "^2.2.5",
"yargs": "^3.26.0"
},
"jspm": {
"main": "prism",
"registry": "jspm",
"jspmPackage": true,
"format": "global",
"files": [
"components/**/*.min.js",
"plugins/**/*",
"themes/*.css",
"prism.js"
]
}
}
}

View File

@ -4,7 +4,7 @@
}
// The dependencies map is built automatically with gulp
var lang_dependencies = /*languages_placeholder[*/{"javascript":"clike","actionscript":"javascript","aspnet":"markup","bison":"c","c":"clike","csharp":"clike","cpp":"c","coffeescript":"javascript","crystal":"ruby","css-extras":"css","d":"clike","dart":"clike","fsharp":"clike","glsl":"clike","go":"clike","groovy":"clike","haml":"ruby","handlebars":"markup","haxe":"clike","jade":"javascript","java":"clike","kotlin":"clike","less":"css","markdown":"markup","nginx":"clike","objectivec":"c","parser":"markup","php":"clike","php-extras":"php","processing":"clike","qore":"clike","jsx":["markup","javascript"],"ruby":"clike","sass":"css","scss":"css","scala":"java","smarty":"markup","swift":"clike","textile":"markup","twig":"markup","typescript":"javascript","wiki":"markup"}/*]*/;
var lang_dependencies = /*languages_placeholder[*/{"javascript":"clike","actionscript":"javascript","aspnet":"markup","bison":"c","c":"clike","csharp":"clike","cpp":"c","coffeescript":"javascript","crystal":"ruby","css-extras":"css","d":"clike","dart":"clike","fsharp":"clike","glsl":"clike","go":"clike","groovy":"clike","haml":"ruby","handlebars":"markup","haxe":"clike","jade":"javascript","java":"clike","kotlin":"clike","less":"css","markdown":"markup","nginx":"clike","objectivec":"c","parser":"markup","php":"clike","php-extras":"php","processing":"clike","protobuf":"clike","qore":"clike","jsx":["markup","javascript"],"ruby":"clike","sass":"css","scss":"css","scala":"java","smarty":"markup","swift":"clike","textile":"markup","twig":"markup","typescript":"javascript","wiki":"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",aspnet:"markup",bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",fsharp:"clike",glsl:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup",haxe:"clike",jade:"javascript",java:"clike",kotlin:"clike",less:"css",markdown:"markup",nginx:"clike",objectivec:"c",parser:"markup",php:"clike","php-extras":"php",processing:"clike",qore:"clike",jsx:["markup","javascript"],ruby:"clike",sass:"css",scss:"css",scala:"java",smarty:"markup",swift:"clike",textile:"markup",twig:"markup",typescript:"javascript",wiki:"markup"},c={},a=Prism.plugins.autoloader={languages_path:"components/",use_minified:!0},s=function(e,c,a){var s=document.createElement("script");s.src=e,s.async=!0,s.onload=function(){document.body.removeChild(s),c&&c()},s.onerror=function(){document.body.removeChild(s),a&&a()},document.body.appendChild(s)},r=function(e){return a.languages_path+"prism-"+e+(a.use_minified?".min":"")+".js"},n=function(e,a){var s=c[e];s||(s=c[e]={});var r=a.getAttribute("data-dependencies");!r&&a.parentNode&&"pre"===a.parentNode.tagName.toLowerCase()&&(r=a.parentNode.getAttribute("data-dependencies")),r=r?r.split(/\s*,\s*/g):[],i(r,function(){t(e,function(){Prism.highlightElement(a)})})},i=function(e,c,a){"string"==typeof e&&(e=[e]);var s=0,r=e.length,n=function(){r>s?t(e[s],function(){s++,n()},function(){a&&a(e[s])}):s===r&&c&&c(e)};n()},t=function(a,n,t){var u=function(){var e=!1;a.indexOf("!")>=0&&(e=!0,a=a.replace("!",""));var i=c[a];if(i||(i=c[a]={}),n&&(i.success_callbacks||(i.success_callbacks=[]),i.success_callbacks.push(n)),t&&(i.error_callbacks||(i.error_callbacks=[]),i.error_callbacks.push(t)),!e&&Prism.languages[a])l(a);else if(!e&&i.error)o(a);else if(e||!i.loading){i.loading=!0;var u=r(a);s(u,function(){i.loading=!1,l(a)},function(){i.loading=!1,i.error=!0,o(a)})}},p=e[a];p&&p.length?i(p,u):u()},l=function(e){c[e]&&c[e].success_callbacks&&c[e].success_callbacks.length&&c[e].success_callbacks.forEach(function(c){c(e)})},o=function(e){c[e]&&c[e].error_callbacks&&c[e].error_callbacks.length&&c[e].error_callbacks.forEach(function(c){c(e)})};Prism.hooks.add("complete",function(e){e.element&&e.language&&!e.grammar&&n(e.language,e.element)})}}();
!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var e={javascript:"clike",actionscript:"javascript",aspnet:"markup",bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",fsharp:"clike",glsl:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup",haxe:"clike",jade:"javascript",java:"clike",kotlin:"clike",less:"css",markdown:"markup",nginx:"clike",objectivec:"c",parser:"markup",php:"clike","php-extras":"php",processing:"clike",protobuf:"clike",qore:"clike",jsx:["markup","javascript"],ruby:"clike",sass:"css",scss:"css",scala:"java",smarty:"markup",swift:"clike",textile:"markup",twig:"markup",typescript:"javascript",wiki:"markup"},c={},a=Prism.plugins.autoloader={languages_path:"components/",use_minified:!0},s=function(e,c,a){var s=document.createElement("script");s.src=e,s.async=!0,s.onload=function(){document.body.removeChild(s),c&&c()},s.onerror=function(){document.body.removeChild(s),a&&a()},document.body.appendChild(s)},r=function(e){return a.languages_path+"prism-"+e+(a.use_minified?".min":"")+".js"},n=function(e,a){var s=c[e];s||(s=c[e]={});var r=a.getAttribute("data-dependencies");!r&&a.parentNode&&"pre"===a.parentNode.tagName.toLowerCase()&&(r=a.parentNode.getAttribute("data-dependencies")),r=r?r.split(/\s*,\s*/g):[],i(r,function(){t(e,function(){Prism.highlightElement(a)})})},i=function(e,c,a){"string"==typeof e&&(e=[e]);var s=0,r=e.length,n=function(){r>s?t(e[s],function(){s++,n()},function(){a&&a(e[s])}):s===r&&c&&c(e)};n()},t=function(a,n,t){var u=function(){var e=!1;a.indexOf("!")>=0&&(e=!0,a=a.replace("!",""));var i=c[a];if(i||(i=c[a]={}),n&&(i.success_callbacks||(i.success_callbacks=[]),i.success_callbacks.push(n)),t&&(i.error_callbacks||(i.error_callbacks=[]),i.error_callbacks.push(t)),!e&&Prism.languages[a])l(a);else if(!e&&i.error)o(a);else if(e||!i.loading){i.loading=!0;var u=r(a);s(u,function(){i.loading=!1,l(a)},function(){i.loading=!1,i.error=!0,o(a)})}},p=e[a];p&&p.length?i(p,u):u()},l=function(e){c[e]&&c[e].success_callbacks&&c[e].success_callbacks.length&&c[e].success_callbacks.forEach(function(c){c(e)})},o=function(e){c[e]&&c[e].error_callbacks&&c[e].error_callbacks.length&&c[e].error_callbacks.forEach(function(c){c(e)})};Prism.hooks.add("complete",function(e){e.element&&e.language&&!e.grammar&&n(e.language,e.element)})}}();

View File

@ -7,13 +7,14 @@
var Extensions = {
'js': 'javascript',
'html': 'markup',
'svg': 'markup',
'xml': 'markup',
'py': 'python',
'rb': 'ruby',
'ps1': 'powershell',
'psm1': 'powershell'
'psm1': 'powershell',
'sh': 'bash',
'bat': 'batch',
'h': 'c',
'tex': 'latex'
};
if(Array.prototype.forEach) { // Check to prevent error in IE8

View File

@ -1 +1 @@
!function(){"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(self.Prism.fileHighlight=function(){var e={js:"javascript",html:"markup",svg:"markup",xml:"markup",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell"};Array.prototype.forEach&&Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(t){for(var r,a=t.getAttribute("data-src"),n=t,s=/\blang(?:uage)?-(?!\*)(\w+)\b/i;n&&!s.test(n.className);)n=n.parentNode;if(n&&(r=(t.className.match(s)||[,""])[1]),!r){var o=(a.match(/\.(\w+)$/)||[,""])[1];r=e[o]||o}var l=document.createElement("code");l.className="language-"+r,t.textContent="",l.textContent="Loading…",t.appendChild(l);var i=new XMLHttpRequest;i.open("GET",a,!0),i.onreadystatechange=function(){4==i.readyState&&(i.status<400&&i.responseText?(l.textContent=i.responseText,Prism.highlightElement(l)):l.textContent=i.status>=400?"✖ Error "+i.status+" while fetching file: "+i.statusText:"✖ Error: File does not exist or is empty")},i.send(null)})},document.addEventListener("DOMContentLoaded",self.Prism.fileHighlight))}();
!function(){"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(self.Prism.fileHighlight=function(){var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"};Array.prototype.forEach&&Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(t){for(var a,s=t.getAttribute("data-src"),n=t,r=/\blang(?:uage)?-(?!\*)(\w+)\b/i;n&&!r.test(n.className);)n=n.parentNode;if(n&&(a=(t.className.match(r)||[,""])[1]),!a){var o=(s.match(/\.(\w+)$/)||[,""])[1];a=e[o]||o}var l=document.createElement("code");l.className="language-"+a,t.textContent="",l.textContent="Loading…",t.appendChild(l);var i=new XMLHttpRequest;i.open("GET",s,!0),i.onreadystatechange=function(){4==i.readyState&&(i.status<400&&i.responseText?(l.textContent=i.responseText,Prism.highlightElement(l)):l.textContent=i.status>=400?"✖ Error "+i.status+" while fetching file: "+i.statusText:"✖ Error: File does not exist or is empty")},i.send(null)})},document.addEventListener("DOMContentLoaded",self.Prism.fileHighlight))}();

View File

@ -4,8 +4,13 @@
return;
}
Prism.plugins.KeepMarkup = true;
Prism.hooks.add('before-highlight', function (env) {
var firstWhiteSpaces = false;
if (!env.element.children.length) {
return;
}
var pos = 0;
var data = [];
var f = function (elt, baseNode) {
@ -21,11 +26,6 @@
if (child.nodeType === 1) { // element
f(child);
} else if(child.nodeType === 3) { // text
if(!firstWhiteSpaces) {
// We need to ignore the first white spaces in the code block
child.data = child.data.replace(/^(?:\r?\n|\r)/, '');
firstWhiteSpaces = true;
}
pos += child.data.length;
}
}
@ -94,4 +94,4 @@
});
}
});
}());
}());

View File

@ -1 +1 @@
!function(){"undefined"!=typeof self&&self.Prism&&self.document&&document.createRange&&(Prism.hooks.add("before-highlight",function(e){var n=!1,o=0,t=[],d=function(e,a){var r={};a||(r.clone=e.cloneNode(!1),r.posOpen=o,t.push(r));for(var s=0,p=e.childNodes.length;p>s;s++){var l=e.childNodes[s];1===l.nodeType?d(l):3===l.nodeType&&(n||(l.data=l.data.replace(/^(?:\r?\n|\r)/,""),n=!0),o+=l.data.length)}a||(r.posClose=o)};d(e.element,!0),t&&t.length&&(e.keepMarkup=t)}),Prism.hooks.add("after-highlight",function(e){if(e.keepMarkup&&e.keepMarkup.length){var n=function(e,o){for(var t=0,d=e.childNodes.length;d>t;t++){var a=e.childNodes[t];if(1===a.nodeType){if(!n(a,o))return!1}else 3===a.nodeType&&(!o.nodeStart&&o.pos+a.data.length>o.node.posOpen&&(o.nodeStart=a,o.nodeStartPos=o.node.posOpen-o.pos),o.nodeStart&&o.pos+a.data.length>=o.node.posClose&&(o.nodeEnd=a,o.nodeEndPos=o.node.posClose-o.pos),o.pos+=a.data.length);if(o.nodeStart&&o.nodeEnd){var r=document.createRange();return r.setStart(o.nodeStart,o.nodeStartPos),r.setEnd(o.nodeEnd,o.nodeEndPos),o.node.clone.appendChild(r.extractContents()),r.insertNode(o.node.clone),r.detach(),!1}}return!0};e.keepMarkup.forEach(function(o){n(e.element,{node:o,pos:0})})}}))}();
!function(){"undefined"!=typeof self&&self.Prism&&self.document&&document.createRange&&(Prism.plugins.KeepMarkup=!0,Prism.hooks.add("before-highlight",function(e){if(e.element.children.length){var n=0,o=[],t=function(e,d){var r={};d||(r.clone=e.cloneNode(!1),r.posOpen=n,o.push(r));for(var a=0,s=e.childNodes.length;s>a;a++){var p=e.childNodes[a];1===p.nodeType?t(p):3===p.nodeType&&(n+=p.data.length)}d||(r.posClose=n)};t(e.element,!0),o&&o.length&&(e.keepMarkup=o)}}),Prism.hooks.add("after-highlight",function(e){if(e.keepMarkup&&e.keepMarkup.length){var n=function(e,o){for(var t=0,d=e.childNodes.length;d>t;t++){var r=e.childNodes[t];if(1===r.nodeType){if(!n(r,o))return!1}else 3===r.nodeType&&(!o.nodeStart&&o.pos+r.data.length>o.node.posOpen&&(o.nodeStart=r,o.nodeStartPos=o.node.posOpen-o.pos),o.nodeStart&&o.pos+r.data.length>=o.node.posClose&&(o.nodeEnd=r,o.nodeEndPos=o.node.posClose-o.pos),o.pos+=r.data.length);if(o.nodeStart&&o.nodeEnd){var a=document.createRange();return a.setStart(o.nodeStart,o.nodeStartPos),a.setEnd(o.nodeEnd,o.nodeEndPos),o.node.clone.appendChild(a.extractContents()),a.insertNode(o.node.clone),a.detach(),!1}}return!0};e.keepMarkup.forEach(function(o){n(e.element,{node:o,pos:0})})}}))}();

View File

@ -11,13 +11,13 @@ pre[data-line] {
margin-top: 1em; /* Same as .prisms padding-top */
background: hsla(24, 20%, 50%,.08);
background: -moz-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -webkit-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -o-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -moz-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -webkit-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: -o-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
pointer-events: none;
line-height: inherit;
white-space: pre;
}
@ -39,9 +39,9 @@ pre[data-line] {
text-shadow: none;
box-shadow: 0 1px white;
}
.line-highlight[data-end]:after {
content: attr(data-end);
top: auto;
bottom: .4em;
}
}

View File

@ -0,0 +1,170 @@
(function() {
if (typeof self === 'undefined' || !self.Prism || !self.document) {
return;
}
var assign = Object.assign || function (obj1, obj2) {
for (var name in obj2) {
if (obj2.hasOwnProperty(name))
obj1[name] = obj2[name];
}
return obj1;
}
function NormalizeWhitespace(defaults) {
this.defaults = assign({}, defaults);
}
function toCamelCase(value) {
return value.replace(/-(\w)/g, function(match, firstChar) {
return firstChar.toUpperCase();
});
}
function tabLen(str) {
var res = 0;
for (var i = 0; i < str.length; ++i) {
if (str.charCodeAt(i) == '\t'.charCodeAt(0))
res += 3;
}
return str.length + res;
}
NormalizeWhitespace.prototype = {
setDefaults: function (defaults) {
this.defaults = assign(this.defaults, defaults);
},
normalize: function (input, settings) {
settings = assign(this.defaults, settings);
for (var name in settings) {
var methodName = toCamelCase(name);
if (name !== "normalize" && methodName !== 'setDefaults' &&
settings[name] && this[methodName]) {
input = this[methodName].call(this, input, settings[name]);
}
}
return input;
},
/*
* Normalization methods
*/
leftTrim: function (input) {
return input.replace(/^\s+/, '');
},
rightTrim: function (input) {
return input.replace(/\s+$/, '');
},
tabsToSpaces: function (input, spaces) {
spaces = spaces|0 || 4;
return input.replace(/\t/g, new Array(++spaces).join(' '));
},
spacesToTabs: function (input, spaces) {
spaces = spaces|0 || 4;
return input.replace(new RegExp(' {' + spaces + '}', 'g'), '\t');
},
removeTrailing: function (input) {
return input.replace(/\s*?$/gm, '');
},
// Support for deprecated plugin remove-initial-line-feed
removeInitialLineFeed: function (input) {
return input.replace(/^(?:\r?\n|\r)/, '');
},
removeIndent: function (input) {
var indents = input.match(/^[^\S\n\r]*(?=\S)/gm);
if (!indents || !indents[0].length)
return input;
indents.sort(function(a, b){return a.length - b.length; });
if (!indents[0].length)
return input;
return input.replace(new RegExp('^' + indents[0], 'gm'), '');
},
indent: function (input, tabs) {
return input.replace(/^[^\S\n\r]*(?=\S)/gm, new Array(++tabs).join('\t') + '$&');
},
breakLines: function (input, characters) {
characters = (characters === true) ? 80 : characters|0 || 80;
var lines = input.split('\n');
for (var i = 0; i < lines.length; ++i) {
if (tabLen(lines[i]) <= characters)
continue;
var line = lines[i].split(/(\s+)/g),
len = 0;
for (var j = 0; j < line.length; ++j) {
var tl = tabLen(line[j]);
len += tl;
if (len > characters) {
line[j] = '\n' + line[j];
len = tl;
}
}
lines[i] = line.join('');
}
return lines.join('\n');
}
};
Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({
'remove-trailing': true,
'remove-indent': true,
'left-trim': true,
'right-trim': true,
/*'break-lines': 80,
'indent': 2,
'remove-initial-line-feed': false,
'tabs-to-spaces': 4,
'spaces-to-tabs': 4*/
});
Prism.hooks.add('before-highlight', function (env) {
var pre = env.element.parentNode;
if (!env.code || !pre || pre.nodeName.toLowerCase() !== 'pre' ||
(env.settings && env.settings['whitespace-normalization'] === false))
return;
var children = pre.childNodes,
before = '',
after = '',
codeFound = false,
Normalizer = Prism.plugins.NormalizeWhitespace;
// Move surrounding whitespace from the <pre> tag into the <code> tag
for (var i = 0; i < children.length; ++i) {
var node = children[i];
if (node == env.element) {
codeFound = true;
} else if (node.nodeName === "#text") {
if (codeFound) {
after += node.nodeValue;
} else {
before += node.nodeValue;
}
pre.removeChild(node);
--i;
}
}
if (!env.element.children.length || !Prism.plugins.KeepMarkup) {
env.code = before + env.code + after;
env.code = Normalizer.normalize(env.code, env.settings);
} else {
// Preserve markup for keep-markup plugin
var html = before + env.element.innerHTML + after;
env.element.innerHTML = Normalizer.normalize(html, env.settings);
env.code = env.element.textContent;
}
});
}());

View File

@ -0,0 +1 @@
!function(){function e(e){this.defaults=r({},e)}function n(e){return e.replace(/-(\w)/g,function(e,n){return n.toUpperCase()})}function t(e){for(var n=0,t=0;t<e.length;++t)e.charCodeAt(t)==" ".charCodeAt(0)&&(n+=3);return e.length+n}if("undefined"!=typeof self&&self.Prism&&self.document){var r=Object.assign||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e};e.prototype={setDefaults:function(e){this.defaults=r(this.defaults,e)},normalize:function(e,t){t=r(this.defaults,t);for(var i in t){var o=n(i);"normalize"!==i&&"setDefaults"!==o&&t[i]&&this[o]&&(e=this[o].call(this,e,t[i]))}return e},leftTrim:function(e){return e.replace(/^\s+/,"")},rightTrim:function(e){return e.replace(/\s+$/,"")},tabsToSpaces:function(e,n){return n=0|n||4,e.replace(/\t/g,new Array(++n).join(" "))},spacesToTabs:function(e,n){return n=0|n||4,e.replace(new RegExp(" {"+n+"}","g")," ")},removeTrailing:function(e){return e.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(e){return e.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(e){var n=e.match(/^[^\S\n\r]*(?=\S)/gm);return n&&n[0].length?(n.sort(function(e,n){return e.length-n.length}),n[0].length?e.replace(new RegExp("^"+n[0],"gm"),""):e):e},indent:function(e,n){return e.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++n).join(" ")+"$&")},breakLines:function(e,n){n=n===!0?80:0|n||80;for(var r=e.split("\n"),i=0;i<r.length;++i)if(!(t(r[i])<=n)){for(var o=r[i].split(/(\s+)/g),a=0,l=0;l<o.length;++l){var s=t(o[l]);a+=s,a>n&&(o[l]="\n"+o[l],a=s)}r[i]=o.join("")}return r.join("\n")}},Prism.plugins.NormalizeWhitespace=new e({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-highlight",function(e){var n=e.element.parentNode;if(e.code&&n&&"pre"===n.nodeName.toLowerCase()&&(!e.settings||e.settings["whitespace-normalization"]!==!1)){for(var t=n.childNodes,r="",i="",o=!1,a=Prism.plugins.NormalizeWhitespace,l=0;l<t.length;++l){var s=t[l];s==e.element?o=!0:"#text"===s.nodeName&&(o?i+=s.nodeValue:r+=s.nodeValue,n.removeChild(s),--l)}if(e.element.children.length&&Prism.plugins.KeepMarkup){var u=r+e.element.innerHTML+i;e.element.innerHTML=a.normalize(u,e.settings),e.code=e.element.textContent}else e.code=r+e.code+i,e.code=a.normalize(e.code,e.settings)}})}}();

View File

@ -5,7 +5,7 @@ if (typeof self === 'undefined' || !self.Prism || !self.document) {
}
// The languages map is built automatically with gulp
var Languages = /*languages_placeholder[*/{"css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","asciidoc":"AsciiDoc","aspnet":"ASP.NET (C#)","autoit":"AutoIt","autohotkey":"AutoHotkey","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","http":"HTTP","inform7":"Inform 7","json":"JSON","latex":"LaTeX","lolcode":"LOLCODE","matlab":"MATLAB","mel":"MEL","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","vim":"vim","wiki":"Wiki markup","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","asciidoc":"AsciiDoc","aspnet":"ASP.NET (C#)","autoit":"AutoIt","autohotkey":"AutoHotkey","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","http":"HTTP","inform7":"Inform 7","json":"JSON","latex":"LaTeX","lolcode":"LOLCODE","matlab":"MATLAB","mel":"MEL","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","protobuf":"Protocol Buffers","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","vim":"vim","wiki":"Wiki markup","yaml":"YAML"}/*]*/;
Prism.hooks.add('before-highlight', 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){var e={css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",asciidoc:"AsciiDoc",aspnet:"ASP.NET (C#)",autoit:"AutoIt",autohotkey:"AutoHotkey",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript","css-extras":"CSS Extras",fsharp:"F#",glsl:"GLSL",http:"HTTP",inform7:"Inform 7",json:"JSON",latex:"LaTeX",lolcode:"LOLCODE",matlab:"MATLAB",mel:"MEL",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",parigp:"PARI/GP",php:"PHP","php-extras":"PHP Extras",powershell:"PowerShell",jsx:"React JSX",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vhdl:"VHDL",vim:"vim",wiki:"Wiki markup",yaml:"YAML"};Prism.hooks.add("before-highlight",function(s){var a=s.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,i,r=a.getAttribute("data-language")||e[s.language]||s.language.substring(0,1).toUpperCase()+s.language.substring(1),l=a.previousSibling;l&&/\s*\bprism-show-language\b\s*/.test(l.className)&&l.firstChild&&/\s*\bprism-show-language-label\b\s*/.test(l.firstChild.className)?i=l.firstChild:(t=document.createElement("div"),i=document.createElement("div"),i.className="prism-show-language-label",t.className="prism-show-language",t.appendChild(i),a.parentNode.insertBefore(t,a)),i.innerHTML=r}})}}();
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){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",asciidoc:"AsciiDoc",aspnet:"ASP.NET (C#)",autoit:"AutoIt",autohotkey:"AutoHotkey",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript","css-extras":"CSS Extras",fsharp:"F#",glsl:"GLSL",http:"HTTP",inform7:"Inform 7",json:"JSON",latex:"LaTeX",lolcode:"LOLCODE",matlab:"MATLAB",mel:"MEL",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",parigp:"PARI/GP",php:"PHP","php-extras":"PHP Extras",powershell:"PowerShell",protobuf:"Protocol Buffers",jsx:"React JSX",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vhdl:"VHDL",vim:"vim",wiki:"Wiki markup",yaml:"YAML"};Prism.hooks.add("before-highlight",function(s){var a=s.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,i,r=a.getAttribute("data-language")||e[s.language]||s.language.substring(0,1).toUpperCase()+s.language.substring(1),l=a.previousSibling;l&&/\s*\bprism-show-language\b\s*/.test(l.className)&&l.firstChild&&/\s*\bprism-show-language-label\b\s*/.test(l.firstChild.className)?i=l.firstChild:(t=document.createElement("div"),i=document.createElement("div"),i.className="prism-show-language-label",t.className="prism-show-language",t.appendChild(i),a.parentNode.insertBefore(t,a)),i.innerHTML=r}})}}();

View File

@ -0,0 +1,10 @@
/* Fallback, in case JS does not run, to ensure the code is at least visible */
.lang-markup script[type='text/plain'],
.language-markup script[type='text/plain'],
script[type='text/plain'].lang-markup,
script[type='text/plain'].language-markup {
display: block;
font: 100% Consolas, Monaco, monoscpace;
white-space: pre;
overflow: auto;
}

View File

@ -0,0 +1,40 @@
(function () {
if (typeof self === 'undefined' || !self.Prism || !self.document || !Prism.languages.markup) {
return;
}
Prism.plugins.UnescapedMarkup = true;
Prism.hooks.add('before-highlightall', function (env) {
env.selector += ", .lang-markup script[type='text/plain'], .language-markup script[type='text/plain']" +
", script[type='text/plain'].lang-markup, script[type='text/plain'].language-markup";
});
Prism.hooks.add('before-sanity-check', function (env) {
if (env.language != "markup") {
return;
}
if (env.element.matches("script[type='text/plain']")) {
var code = document.createElement("code");
var pre = document.createElement("pre");
pre.className = code.className = env.element.className;
env.code = env.code.replace(/&lt;\/script(>|&gt;)/gi, "</scri" + "pt>");
code.textContent = env.code;
pre.appendChild(code);
env.element.parentNode.replaceChild(pre, env.element);
env.element = code;
return;
}
var pre = env.element.parentNode;
if (!env.code && pre && pre.nodeName.toLowerCase() == 'pre' &&
env.element.childNodes.length && env.element.childNodes[0].nodeName == "#comment") {
env.element.textContent = env.code = env.element.childNodes[0].textContent;
}
});
}());

View File

@ -0,0 +1 @@
!function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.languages.markup&&(Prism.plugins.UnescapedMarkup=!0,Prism.hooks.add("before-highlightall",function(e){e.selector+=", .lang-markup script[type='text/plain'], .language-markup script[type='text/plain'], script[type='text/plain'].lang-markup, script[type='text/plain'].language-markup"}),Prism.hooks.add("before-sanity-check",function(e){if("markup"==e.language){if(e.element.matches("script[type='text/plain']")){var t=document.createElement("code"),n=document.createElement("pre");return n.className=t.className=e.element.className,e.code=e.code.replace(/&lt;\/script(>|&gt;)/gi,"</script>"),t.textContent=e.code,n.appendChild(t),e.element.parentNode.replaceChild(n,e.element),e.element=t,void 0}var n=e.element.parentNode;!e.code&&n&&"pre"==n.nodeName.toLowerCase()&&e.element.childNodes.length&&"#comment"==e.element.childNodes[0].nodeName&&(e.element.textContent=e.code=e.element.childNodes[0].textContent)}}))}();

View File

@ -94,19 +94,19 @@ var _ = _self.Prism = {
insertBefore: function (inside, before, insert, root) {
root = root || _.languages;
var grammar = root[inside];
if (arguments.length == 2) {
insert = arguments[1];
for (var newToken in insert) {
if (insert.hasOwnProperty(newToken)) {
grammar[newToken] = insert[newToken];
}
}
return grammar;
}
var ret = {};
for (var token in grammar) {
@ -126,7 +126,7 @@ var _ = _self.Prism = {
ret[token] = grammar[token];
}
}
// Update references in other language definitions
_.languages.DFS(_.languages, function(key, value) {
if (value === root[inside] && key != inside) {
@ -157,12 +157,19 @@ var _ = _self.Prism = {
}
},
plugins: {},
highlightAll: function(async, callback) {
var elements = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');
var env = {
callback: callback,
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
};
_.hooks.run("before-highlightall", env);
var elements = env.elements || document.querySelectorAll(env.selector);
for (var i=0, element; element = elements[i++];) {
_.highlightElement(element, async === true, callback);
_.highlightElement(element, async === true, env.callback);
}
},
@ -198,7 +205,9 @@ var _ = _self.Prism = {
code: code
};
if (!code || !grammar) {
_.hooks.run('before-sanity-check', env);
if (!env.code || !env.grammar) {
_.hooks.run('complete', env);
return;
}
@ -272,6 +281,7 @@ var _ = _self.Prism = {
var pattern = patterns[j],
inside = pattern.inside,
lookbehind = !!pattern.lookbehind,
greedy = !!pattern.greedy,
lookbehindLength = 0,
alias = pattern.alias;
@ -292,36 +302,76 @@ var _ = _self.Prism = {
pattern.lastIndex = 0;
var match = pattern.exec(str);
var match = pattern.exec(str),
delNum = 1;
if (match) {
if(lookbehind) {
lookbehindLength = match[1].length;
// Greedy patterns can override/remove up to two previously matched tokens
if (!match && greedy && i != strarr.length - 1) {
// Reconstruct the original text using the next two tokens
var nextToken = strarr[i + 1].matchedStr || strarr[i + 1],
combStr = str + nextToken;
if (i < strarr.length - 2) {
combStr += strarr[i + 2].matchedStr || strarr[i + 2];
}
var from = match.index - 1 + lookbehindLength,
match = match[0].slice(lookbehindLength),
len = match.length,
to = from + len,
before = str.slice(0, from + 1),
after = str.slice(to + 1);
var args = [i, 1];
if (before) {
args.push(before);
// Try the pattern again on the reconstructed text
pattern.lastIndex = 0;
match = pattern.exec(combStr);
if (!match) {
continue;
}
var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias);
args.push(wrapped);
if (after) {
args.push(after);
var from = match.index + (lookbehind ? match[1].length : 0);
// To be a valid candidate, the new match has to start inside of str
if (from >= str.length) {
continue;
}
var to = match.index + match[0].length,
len = str.length + nextToken.length;
Array.prototype.splice.apply(strarr, args);
// Number of tokens to delete and replace with the new match
delNum = 3;
if (to <= len) {
if (strarr[i + 1].greedy) {
continue;
}
delNum = 2;
combStr = combStr.slice(0, len);
}
str = combStr;
}
if (!match) {
continue;
}
if(lookbehind) {
lookbehindLength = match[1].length;
}
var from = match.index + lookbehindLength,
match = match[0].slice(lookbehindLength),
to = from + match.length,
before = str.slice(0, from),
after = str.slice(to);
var args = [i, delNum];
if (before) {
args.push(before);
}
var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);
args.push(wrapped);
if (after) {
args.push(after);
}
Array.prototype.splice.apply(strarr, args);
}
}
}
@ -354,10 +404,13 @@ var _ = _self.Prism = {
}
};
var Token = _.Token = function(type, content, alias) {
var Token = _.Token = function(type, content, alias, matchedStr, greedy) {
this.type = type;
this.content = content;
this.alias = alias;
// Copy of the full string this token was created from
this.matchedStr = matchedStr || null;
this.greedy = !!greedy;
};
Token.stringify = function(o, language, parent) {
@ -568,7 +621,10 @@ Prism.languages.clike = {
lookbehind: true
}
],
'string': /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
'string': {
pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true
},
'class-name': {
pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,
lookbehind: true,
@ -599,13 +655,15 @@ Prism.languages.javascript = Prism.languages.extend('clike', {
Prism.languages.insertBefore('javascript', 'keyword', {
'regex': {
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,
lookbehind: true
lookbehind: true,
greedy: true
}
});
Prism.languages.insertBefore('javascript', 'class-name', {
'template-string': {
pattern: /`(?:\\`|\\?[^`])*`/,
pattern: /`(?:\\\\|\\?[^\\])*?`/,
greedy: true,
inside: {
'interpolation': {
pattern: /\$\{[^}]+\}/,
@ -648,13 +706,14 @@ Prism.languages.js = Prism.languages.javascript;
var Extensions = {
'js': 'javascript',
'html': 'markup',
'svg': 'markup',
'xml': 'markup',
'py': 'python',
'rb': 'ruby',
'ps1': 'powershell',
'psm1': 'powershell'
'psm1': 'powershell',
'sh': 'bash',
'bat': 'batch',
'h': 'c',
'tex': 'latex'
};
if(Array.prototype.forEach) { // Check to prevent error in IE8

View File

@ -1,10 +0,0 @@
"use strict";
var fs = require("fs");
var vm = require("vm");
var fileContent = fs.readFileSync(__dirname + "/../../components.js", "utf8");
var context = {};
vm.runInNewContext(fileContent, context);
module.exports = context.components;

View File

@ -1,131 +0,0 @@
"use strict";
var fs = require("fs");
var vm = require("vm");
var components = require("./components");
var languagesCatalog = components.languages;
module.exports = {
/**
* Creates a new Prism instance with the given language loaded
*
* @param {string|string[]} languages
* @returns {Prism}
*/
createInstance: function (languages) {
var context = {
loadedLanguages: [],
Prism: this.createEmptyPrism()
};
context = this.loadLanguages(languages, context);
return context.Prism;
},
/**
* Loads the given languages and appends the config to the given Prism object
*
* @private
* @param {string|string[]} languages
* @param {{loadedLanguages: string[], Prism: Prism}} context
* @returns {{loadedLanguages: string[], Prism: Prism}}
*/
loadLanguages: function (languages, context) {
if (typeof languages === 'string') {
languages = [languages];
}
var self = this;
languages.forEach(function (language) {
context = self.loadLanguage(language, context);
});
return context;
},
/**
* Loads the given language (including recursively loading the dependencies) and
* appends the config to the given Prism object
*
* @private
* @param {string} language
* @param {{loadedLanguages: string[], Prism: Prism}} context
* @returns {{loadedLanguages: string[], Prism: Prism}}
*/
loadLanguage: function (language, context) {
if (!languagesCatalog[language]) {
throw new Error("Language '" + language + "' not found.");
}
// the given language was already loaded
if (-1 < context.loadedLanguages.indexOf(language)) {
return context;
}
// if the language has a dependency -> load it first
if (languagesCatalog[language].require) {
context = this.loadLanguages(languagesCatalog[language].require, context);
}
// load the language itself
var languageSource = this.loadFileSource(language);
context.Prism = this.runFileWithContext(languageSource, {Prism: context.Prism}).Prism;
context.loadedLanguages.push(language);
return context;
},
/**
* Creates a new empty prism instance
*
* @private
* @returns {Prism}
*/
createEmptyPrism: function () {
var coreSource = this.loadFileSource("core");
var context = this.runFileWithContext(coreSource);
return context.Prism;
},
/**
* Cached file sources, to prevent massive HDD work
*
* @private
* @type {Object.<string, string>}
*/
fileSourceCache: {},
/**
* Loads the given file source as string
*
* @private
* @param {string} name
* @returns {string}
*/
loadFileSource: function (name) {
return this.fileSourceCache[name] = this.fileSourceCache[name] || fs.readFileSync(__dirname + "/../../components/prism-" + name + ".js", "utf8");
},
/**
* Runs a VM for a given file source with the given context
*
* @private
* @param {string} fileSource
* @param {*} [context]
*
* @returns {*}
*/
runFileWithContext: function (fileSource, context) {
context = context || {};
vm.runInNewContext(fileSource, context);
return context;
}
};

View File

@ -1,145 +0,0 @@
"use strict";
var fs = require("fs");
var assert = require("chai").assert;
var PrismLoader = require("./prism-loader");
var TokenStreamTransformer = require("./token-stream-transformer");
/**
* Handles parsing of a test case file.
*
*
* A test case file consists of at least two parts, separated by a line of dashes.
* This separation line must start at the beginning of the line and consist of at least three dashes.
*
* The test case file can either consist of two parts:
*
* {source code}
* ----
* {expected token stream}
*
*
* or of three parts:
*
* {source code}
* ----
* {expected token stream}
* ----
* {text comment explaining the test case}
*
* If the file contains more than three parts, the remaining parts are just ignored.
* If the file however does not contain at least two parts (so no expected token stream),
* the test case will later be marked as failed.
*
*
* @type {{runTestCase: Function, transformCompiledTokenStream: Function, parseTestCaseFile: Function}}
*/
module.exports = {
/**
* Runs the given test case file and asserts the result
*
* The passed language identifier can either be a language like "css" or a composed language
* identifier like "css+markup". Composed identifiers can be used for testing language inclusion.
*
* When testing language inclusion, the first given language is the main language which will be passed
* to Prism for highlighting ("css+markup" will result in a call to Prism to highlight with the "css" grammar).
* But it will be ensured, that the additional passed languages will be loaded too.
*
* The languages will be loaded in the order they were provided.
*
* @param {string} languageIdentifier
* @param {string} filePath
*/
runTestCase: function (languageIdentifier, filePath) {
var testCase = this.parseTestCaseFile(filePath);
var usedLanguages = this.parseLanguageNames(languageIdentifier);
if (null === testCase) {
throw new Error("Test case file has invalid format (or the provided token stream is invalid JSON), please read the docs.");
}
var Prism = PrismLoader.createInstance(usedLanguages.languages);
// the first language is the main language to highlight
var mainLanguageGrammar = Prism.languages[usedLanguages.mainLanguage];
var compiledTokenStream = Prism.tokenize(testCase.testSource, mainLanguageGrammar);
var simplifiedTokenStream = TokenStreamTransformer.simplify(compiledTokenStream);
assert.deepEqual(simplifiedTokenStream, testCase.expectedTokenStream, testCase.comment);
},
/**
* Parses the language names and finds the main language.
*
* It is either the first language or the language followed by a exclamation mark !.
* There should only be one language with an exclamation mark.
*
* @param {string} languageIdentifier
*
* @returns {{languages: string[], mainLanguage: string}}
*/
parseLanguageNames: function (languageIdentifier) {
var languages = languageIdentifier.split("+");
var mainLanguage = null;
languages = languages.map(
function (language) {
var pos = language.indexOf("!");
if (-1 < pos) {
if (mainLanguage) {
throw "There are multiple main languages defined.";
}
mainLanguage = language.replace("!", "");
return mainLanguage;
}
return language;
}
);
if (!mainLanguage) {
mainLanguage = languages[languages.length-1];
}
return {
languages: languages,
mainLanguage: mainLanguage
};
},
/**
* Parses the test case from the given test case file
*
* @private
* @param {string} filePath
* @returns {{testSource: string, expectedTokenStream: Array.<Array.<string>>, comment:string?}|null}
*/
parseTestCaseFile: function (filePath) {
var testCaseSource = fs.readFileSync(filePath, "utf8");
var testCaseParts = testCaseSource.split(/^-{10,}\w*$/m);
try {
var testCase = {
testSource: testCaseParts[0].trim(),
expectedTokenStream: JSON.parse(testCaseParts[1]),
comment: null
};
// if there are three parts, the third one is the comment
// explaining the test case
if (testCaseParts[2]) {
testCase.comment = testCaseParts[2].trim();
}
return testCase;
}
catch (e) {
// the JSON can't be parsed (e.g. it could be empty)
return null;
}
}
};

View File

@ -1,117 +0,0 @@
"use strict";
var fs = require("fs");
var path = require("path");
module.exports = {
/**
* Loads the list of all available tests
*
* @param {string} rootDir
* @returns {Object.<string, string[]>}
*/
loadAllTests: function (rootDir) {
var testSuite = {};
var self = this;
this.getAllDirectories(rootDir).forEach(
function (language) {
testSuite[language] = self.getAllFiles(path.join(rootDir, language));
}
);
return testSuite;
},
/**
* Loads the list of available tests that match the given languages
*
* @param {string} rootDir
* @param {string|string[]} languages
* @returns {Object.<string, string[]>}
*/
loadSomeTests: function (rootDir, languages) {
var testSuite = {};
var self = this;
this.getSomeDirectories(rootDir, languages).forEach(
function (language) {
testSuite[language] = self.getAllFiles(path.join(rootDir, language));
}
);
return testSuite;
},
/**
* Returns a list of all (sub)directories (just the directory names, not full paths)
* in the given src directory
*
* @param {string} src
* @returns {Array.<string>}
*/
getAllDirectories: function (src) {
return fs.readdirSync(src).filter(
function (file) {
return fs.statSync(path.join(src, file)).isDirectory();
}
);
},
/**
* Returns a list of all (sub)directories (just the directory names, not full paths)
* in the given src directory, matching the given languages
*
* @param {string} src
* @param {string|string[]} languages
* @returns {Array.<string>}
*/
getSomeDirectories: function (src, languages) {
var self = this;
return fs.readdirSync(src).filter(
function (file) {
return fs.statSync(path.join(src, file)).isDirectory() && self.directoryMatches(file, languages);
}
);
},
/**
* Returns whether a directory matches one of the given languages.
* @param {string} directory
* @param {string|string[]} languages
*/
directoryMatches: function (directory, languages) {
if (!Array.isArray(languages)) {
languages = [languages];
}
var dirLanguages = directory.split(/!?\+!?/);
return dirLanguages.some(function (lang) {
return languages.indexOf(lang) >= 0;
});
},
/**
* Returns a list of all full file paths to all files in the given src directory
*
* @private
* @param {string} src
* @returns {Array.<string>}
*/
getAllFiles: function (src) {
return fs.readdirSync(src).filter(
function (fileName) {
// only find files that have the ".test" extension
return ".test" === path.extname(fileName) &&
fs.statSync(path.join(src, fileName)).isFile();
}
).map(
function (fileName) {
return path.join(src, fileName);
}
);
}
};

View File

@ -1,32 +0,0 @@
"use strict";
module.exports = {
/**
* Simplifies the token stream to ease the matching with the expected token stream.
*
* * Strings are kept as-is
* * In arrays each value is transformed individually
* * Values that are empty (empty arrays or strings only containing whitespace)
*
*
* @param {Array} tokenStream
* @returns {Array.<string[]|Array>}
*/
simplify: function (tokenStream) {
if (Array.isArray(tokenStream)) {
return tokenStream
.map(this.simplify.bind(this))
.filter(function (value) {
return !(Array.isArray(value) && !value.length) && !(typeof value === "string" && !value.trim().length);
}
);
}
else if (typeof tokenStream === "object") {
return [tokenStream.type, this.simplify(tokenStream.content)];
}
else {
return tokenStream;
}
}
};

View File

@ -1,13 +0,0 @@
*
* Foobar
----------------------------------------------------
[
["comment", "*"],
["comment", "* Foobar"]
]
----------------------------------------------------
Checks for comments.

View File

@ -1,13 +0,0 @@
"
" foobar
----------------------------------------------------
[
["eol-comment", "\""],
["eol-comment", "\" foobar"]
]
----------------------------------------------------
Checks for EOL comments.

View File

@ -1,15 +0,0 @@
0
42
123456789
----------------------------------------------------
[
["number", "0"],
["number", "42"],
["number", "123456789"]
]
----------------------------------------------------
Checks for numbers.

View File

@ -1,38 +0,0 @@
.
+ -
/ * **
< > <= >=
= ?= <>
& &&
a-b
a~b
a->b
a=>b
a|b
a{b}c
----------------------------------------------------
[
["punctuation", "."],
["operator", "+"], ["operator", "-"],
["operator", "/"], ["operator", "*"], ["operator", "**"],
["operator", "<"], ["operator", ">"], ["operator", "<="], ["operator", ">="],
["operator", "="], ["operator", "?="], ["operator", "<>"],
["string-operator", "&"], ["string-operator", "&&"],
"\r\n\r\na", ["token-operator", "-"],
"b\r\na", ["token-operator", "~"],
"b\r\na", ["token-operator", "->"],
"b\r\na", ["token-operator", "=>"],
"b\r\na", ["token-operator", "|"],
"b\r\na", ["token-operator", "{"], "b", ["token-operator", "}"], "c"
]
----------------------------------------------------
Checks for operators, string-operators and token-operators.
The leading dot serves only because tests are trimmed.

View File

@ -1,17 +0,0 @@
|foobar|
|foo\|b\{a}r|
|foo { bar } baz|
----------------------------------------------------
[
["token-operator", "|"], ["string-template", "foobar"], ["token-operator", "|"],
["token-operator", "|"], ["string-template", "foo\\|b\\{a}r"], ["token-operator", "|"],
["token-operator", "|"], ["string-template", "foo "], ["token-operator", "{"],
" bar ",
["token-operator", "}"], ["string-template", " baz"], ["token-operator", "|"]
]
----------------------------------------------------
Checks for string templates.

View File

@ -1,21 +0,0 @@
''
'foo'
'foo\'bar'
``
`foo`
`foo\`bar`
----------------------------------------------------
[
["string", "''"],
["string", "'foo'"],
["string", "'foo\\'bar'"],
["string", "``"],
["string", "`foo`"],
["string", "`foo\\`bar`"]
]
----------------------------------------------------
Checks for strings.

View File

@ -1,71 +0,0 @@
as; break; case; catch; class;
const; default; delete; do; else;
extends; finally; for; function; if;
implements; import; in; instanceof; interface;
internal; is; native; new; null;
package; private; protected; public; return;
super; switch; this; throw; try;
typeof; use; var; void; while;
with; dynamic; each; final; get;
include; namespace; native; override; set;
static;
----------------------------------------------------
[
["keyword", "as"], ["punctuation", ";"],
["keyword", "break"], ["punctuation", ";"],
["keyword", "case"], ["punctuation", ";"],
["keyword", "catch"], ["punctuation", ";"],
["keyword", "class"], ["punctuation", ";"],
["keyword", "const"], ["punctuation", ";"],
["keyword", "default"], ["punctuation", ";"],
["keyword", "delete"], ["punctuation", ";"],
["keyword", "do"], ["punctuation", ";"],
["keyword", "else"], ["punctuation", ";"],
["keyword", "extends"], ["punctuation", ";"],
["keyword", "finally"], ["punctuation", ";"],
["keyword", "for"], ["punctuation", ";"],
["keyword", "function"], ["punctuation", ";"],
["keyword", "if"], ["punctuation", ";"],
["keyword", "implements"], ["punctuation", ";"],
["keyword", "import"], ["punctuation", ";"],
["keyword", "in"], ["punctuation", ";"],
["keyword", "instanceof"], ["punctuation", ";"],
["keyword", "interface"], ["punctuation", ";"],
["keyword", "internal"], ["punctuation", ";"],
["keyword", "is"], ["punctuation", ";"],
["keyword", "native"], ["punctuation", ";"],
["keyword", "new"], ["punctuation", ";"],
["keyword", "null"], ["punctuation", ";"],
["keyword", "package"], ["punctuation", ";"],
["keyword", "private"], ["punctuation", ";"],
["keyword", "protected"], ["punctuation", ";"],
["keyword", "public"], ["punctuation", ";"],
["keyword", "return"], ["punctuation", ";"],
["keyword", "super"], ["punctuation", ";"],
["keyword", "switch"], ["punctuation", ";"],
["keyword", "this"], ["punctuation", ";"],
["keyword", "throw"], ["punctuation", ";"],
["keyword", "try"], ["punctuation", ";"],
["keyword", "typeof"], ["punctuation", ";"],
["keyword", "use"], ["punctuation", ";"],
["keyword", "var"], ["punctuation", ";"],
["keyword", "void"], ["punctuation", ";"],
["keyword", "while"], ["punctuation", ";"],
["keyword", "with"], ["punctuation", ";"],
["keyword", "dynamic"], ["punctuation", ";"],
["keyword", "each"], ["punctuation", ";"],
["keyword", "final"], ["punctuation", ";"],
["keyword", "get"], ["punctuation", ";"],
["keyword", "include"], ["punctuation", ";"],
["keyword", "namespace"], ["punctuation", ";"],
["keyword", "native"], ["punctuation", ";"],
["keyword", "override"], ["punctuation", ";"],
["keyword", "set"], ["punctuation", ";"],
["keyword", "static"], ["punctuation", ";"]
]
----------------------------------------------------
Checks for all keywords.

View File

@ -1,29 +0,0 @@
+ - * / % ^
+= -= *= /= %= ^=
& && | ||
&= &&= |= ||=
< << > >> >>>
<= <<= >= >>= >>>=
! != = ==
!== ===
~ ? @
++ --
----------------------------------------------------
[
["operator", "+"], ["operator", "-"], ["operator", "*"], ["operator", "/"], ["operator", "%"], ["operator", "^"],
["operator", "+="], ["operator", "-="], ["operator", "*="], ["operator", "/="], ["operator", "%="], ["operator", "^="],
["operator", "&"], ["operator", "&&"], ["operator", "|"], ["operator", "||"],
["operator", "&="], ["operator", "&&="], ["operator", "|="], ["operator", "||="],
["operator", "<"], ["operator", "<<"], ["operator", ">"], ["operator", ">>"], ["operator", ">>>"],
["operator", "<="], ["operator", "<<="], ["operator", ">="], ["operator", ">>="], ["operator", ">>>="],
["operator", "!"], ["operator", "!="], ["operator", "="], ["operator", "=="],
["operator", "!=="], ["operator", "==="],
["operator", "~"], ["operator", "?"], ["operator", "@"],
["operator", "++"], ["operator", "--"]
]
----------------------------------------------------
Checks for all operators.

View File

@ -1,15 +0,0 @@
#foo
# bar
# Redirect 301 /2006/oldfile.html http://subdomain.domain.tld/newfile.html
----------------------------------------------------
[
["comment", "#foo"],
["comment", "# bar"],
["comment", "# Redirect 301 /2006/oldfile.html http://subdomain.domain.tld/newfile.html"]
]
----------------------------------------------------
Checks for comments.

View File

@ -1,469 +0,0 @@
<AuthnProviderAlias file file2>
</AuthnProviderAlias>
<AuthzProviderAlias ldap-group ldap-group-alias1 "cn=my-group,o=ctx">
</AuthzProviderAlias>
<Directory "/webpages/secure">
</Directory>
<DirectoryMatch "^/www/(.+/)?[0-9]{3}">
</DirectoryMatch>
<Else>
</Else>
<ElseIf "-R '10.0.0.0/8'">
</ElseIf>
<Files ~ "\.(gif|jpe?g|png)$">
</Files>
<FilesMatch ".+\.(gif|jpe?g|png)$">
</FilesMatch>
<If "-z req('Host')">
</If>
<IfDefine !MemCache>
</IfDefine>
<IfModule mod_rewrite.c>
</IfModule>
<IfVersion 2.1.0>
</IfVersion>
<Limit POST PUT DELETE>
</Limit>
<LimitExcept POST GET>
</LimitExcept>
<Location /private1>
</Location>
<LocationMatch "/(extra|special)/data">
</LocationMatch>
<Macro LocalAccessPolicy>
</Macro>
<Proxy "*">
</Proxy>
<RequireAll>
</RequireAll>
<RequireAny>
</RequireAny>
<RequireNone>
</RequireNone>
<VirtualHost [2001:db8::a00:20ff:fea7:ccea]:80>
</VirtualHost>
----------------------------------------------------
[
["directive-block", [
["directive-block", [
["punctuation", "<"],
"AuthnProviderAlias"
]],
["directive-block-parameter", [
" file file2"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"AuthnProviderAlias"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"AuthzProviderAlias"
]],
["directive-block-parameter", [
" ldap-group ldap-group-alias1 ",
["string", [
"\"cn=my-group,o=ctx\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"AuthzProviderAlias"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"Directory"
]],
["directive-block-parameter", [
["string", [
"\"/webpages/secure\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"Directory"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"DirectoryMatch"
]],
["directive-block-parameter", [
["string", [
"\"^/www/(.+/)?[0-9]{3}\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"DirectoryMatch"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"Else"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"Else"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"ElseIf"
]],
["directive-block-parameter", [
["string", [
"\"-R '10.0.0.0/8'\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"ElseIf"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"Files"
]],
["directive-block-parameter", [
" ~ ",
["string", [
"\"\\.(gif|jpe?g|png)$\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"Files"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"FilesMatch"
]],
["directive-block-parameter", [
["string", [
"\".+\\.(gif|jpe?g|png)$\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"FilesMatch"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"If"
]],
["directive-block-parameter", [
["string", [
"\"-z req('Host')\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"If"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"IfDefine"
]],
["directive-block-parameter", [
" !MemCache"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"IfDefine"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"IfModule"
]],
["directive-block-parameter", [
" mod_rewrite.c"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"IfModule"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"IfVersion"
]],
["directive-block-parameter", [
" 2.1.0"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"IfVersion"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"Limit"
]],
["directive-block-parameter", [
" POST PUT DELETE"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"Limit"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"LimitExcept"
]],
["directive-block-parameter", [
" POST GET"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"LimitExcept"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"Location"
]],
["directive-block-parameter", [
" /private1"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"Location"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"LocationMatch"
]],
["directive-block-parameter", [
["string", [
"\"/(extra|special)/data\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"LocationMatch"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"Macro"
]],
["directive-block-parameter", [
" LocalAccessPolicy"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"Macro"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"Proxy"
]],
["directive-block-parameter", [
["string", [
"\"*\""
]]
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"Proxy"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"RequireAll"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"RequireAll"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"RequireAny"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"RequireAny"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"RequireNone"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"RequireNone"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "<"],
"VirtualHost"
]],
["directive-block-parameter", [
" [2001",
["punctuation", ":"],
"db8",
["punctuation", ":"],
["punctuation", ":"],
"a00",
["punctuation", ":"],
"20ff",
["punctuation", ":"],
"fea7",
["punctuation", ":"],
"ccea]",
["punctuation", ":"],
"80"
]],
["punctuation", ">"]
]],
["directive-block", [
["directive-block", [
["punctuation", "</"],
"VirtualHost"
]],
["punctuation", ">"]
]]
]
----------------------------------------------------
Checks for directive blocks.

View File

@ -1,13 +0,0 @@
[OR]
[L,QSA]
----------------------------------------------------
[
["directive-flags", "[OR]"],
["directive-flags", "[L,QSA]"]
]
----------------------------------------------------
Checks for directive flags.

View File

@ -1,15 +0,0 @@
^(.*)$
^foo
bar$
----------------------------------------------------
[
["regex", "^(.*)$"],
["regex", "^foo"],
["regex", "bar$"]
]
----------------------------------------------------
Checks for regex.

View File

@ -1,24 +0,0 @@
"foo bar"
'foo bar'
"%{REMOTE_HOST}"
----------------------------------------------------
[
["string", [
"\"foo bar\""
]],
["string", [
"'foo bar'"
]],
["string", [
"\"",
["variable", "%{REMOTE_HOST}"],
"\""
]]
]
----------------------------------------------------
Checks for strings.
Also checks for variables inside strings.

View File

@ -1,15 +0,0 @@
$port
${docroot}
%{REMOTE_HOST}
----------------------------------------------------
[
["variable", "$port"],
["variable", "${docroot}"],
["variable", "%{REMOTE_HOST}"]
]
----------------------------------------------------
Checks for variables.

View File

@ -1,13 +0,0 @@
a←1 2 3
----------------------------------------------------
[
"a",
["assignment", "←"],
["number", "1"], ["number", "2"], ["number", "3"]
]
----------------------------------------------------
Checks for assignment.

View File

@ -1,15 +0,0 @@
⍝ Foobar
#!/usr/bin/env runapl
----------------------------------------------------
[
["comment", "⍝"],
["comment", "⍝ Foobar"],
["comment", "#!/usr/bin/env runapl"]
]
----------------------------------------------------
Checks for comments.

View File

@ -1,19 +0,0 @@
#
----------------------------------------------------
[
["constant", "⍬"],
["constant", "⌾"],
["constant", "#"],
["constant", "⎕"],
["constant", "⍞"]
]
----------------------------------------------------
Checks for constants.

View File

@ -1,23 +0,0 @@
{0=:'hello' ⋄ ∇¨⍵}
----------------------------------------------------
[
["dfn", "{"],
["number", "0"],
["function", "="],
["function", ""],
["function", ""],
["dfn", ""],
["dfn", ":"],
["string", "'hello'"],
["punctuation", "⋄"],
["dfn", "∇"],
["monadic-operator", "¨"],
["dfn", "⍵"],
["dfn", "}"]
]
----------------------------------------------------
Checks for Dfns.

View File

@ -1,13 +0,0 @@
. ⍣ ⍠
⍤ ∘ ⌸
----------------------------------------------------
[
["dyadic-operator", "."], ["dyadic-operator", "⍣"], ["dyadic-operator", "⍠"],
["dyadic-operator", "⍤"], ["dyadic-operator", "∘"], ["dyadic-operator", "⌸"]
]
----------------------------------------------------
Checks for dyadic operators.

View File

@ -1,41 +0,0 @@
- + × ÷
⌈ ⌊ |
? *
⍟ ○ ! ⌹
< ≤ = >
≥ ≠ ≡ ≢
∊ ⍷
~ ∧ ⍱
, ⍪
⌽ ⊖ ⍉
↑ ↓ ⊂ ⊃
⌷ ⍋ ⍒
⊥ ⍕ ⍎
⊣ ⊢ ⍁ ⍂
≈ ⍯
↗ ¤ →
----------------------------------------------------
[
["function", "-"], ["function", "+"], ["function", "×"], ["function", "÷"],
["function", "⌈"], ["function", "⌊"], ["function", ""], ["function", "|"],
["function", ""], ["function", "?"], ["function", "*"],
["function", "⍟"], ["function", "○"], ["function", "!"], ["function", "⌹"],
["function", "<"], ["function", "≤"], ["function", "="], ["function", ">"],
["function", "≥"], ["function", "≠"], ["function", "≡"], ["function", "≢"],
["function", "∊"], ["function", "⍷"], ["function", ""], ["function", "∩"],
["function", "~"], ["function", ""], ["function", "∧"], ["function", "⍱"],
["function", "⍲"], ["function", ""], ["function", ","], ["function", "⍪"],
["function", "⌽"], ["function", "⊖"], ["function", "⍉"],
["function", "↑"], ["function", "↓"], ["function", "⊂"], ["function", "⊃"],
["function", "⌷"], ["function", "⍋"], ["function", "⍒"],
["function", ""], ["function", "⊥"], ["function", "⍕"], ["function", "⍎"],
["function", "⊣"], ["function", "⊢"], ["function", "⍁"], ["function", "⍂"],
["function", "≈"], ["function", "⍯"],
["function", "↗"], ["function", "¤"], ["function", "→"]
]
----------------------------------------------------
Checks for functions.

View File

@ -1,15 +0,0 @@
\ / ⌿ ⍀
¨ ⍨ ⌶
& ∥
----------------------------------------------------
[
["monadic-operator", "\\"], ["monadic-operator", "/"], ["monadic-operator", "⌿"], ["monadic-operator", "⍀"],
["monadic-operator", "¨"], ["monadic-operator", "⍨"], ["monadic-operator", "⌶"],
["monadic-operator", "&"], ["monadic-operator", "∥"]
]
----------------------------------------------------
Checks for monadic operators.

View File

@ -1,27 +0,0 @@
42
3.14159
¯2
3E12
2.8e¯4
0.1e+7
2j3
¯4.3e2J1.9e¯4
----------------------------------------------------
[
["number", "42"],
["number", "3.14159"],
["number", "¯2"],
["number", "∞"],
["number", "3E12"],
["number", "2.8e¯4"],
["number", "0.1e+7"],
["number", "2j3"],
["number", "¯4.3e2J1.9e¯4"]
]
----------------------------------------------------
Checks for numbers.

View File

@ -1,13 +0,0 @@
:Ab
:FooBar
----------------------------------------------------
[
["statement", ":Ab"],
["statement", ":FooBar"]
]
----------------------------------------------------
Checks for statements.

View File

@ -1,15 +0,0 @@
''
'foobar'
'fo''obar'
----------------------------------------------------
[
["string", "''"],
["string", "'foobar'"],
["string", "'fo''obar'"]
]
----------------------------------------------------
Checks for strings.

View File

@ -1,17 +0,0 @@
⎕IO
⎕WA
⎕CR
⎕TCNL
----------------------------------------------------
[
["system-function", "⎕IO"],
["system-function", "⎕WA"],
["system-function", "⎕CR"],
["system-function", "⎕TCNL"]
]
----------------------------------------------------
Checks for system functions.

View File

@ -1,39 +0,0 @@
alias application boolean class constant
date file integer list number
POSIX file
real record reference
RGB color
script text centimetres centimeters feet
inches kilometres kilometers metres meters
miles yards
square feet square kilometres square kilometers square metres
square meters square miles square yards
cubic centimetres cubic centimeters cubic feet cubic inches
cubic metres cubic meters cubic yards
gallons litres liters quarts grams
kilograms ounces pounds
degrees Celsius degrees Fahrenheit degrees Kelvin
----------------------------------------------------
[
["class", "alias"], ["class", "application"], ["class", "boolean"], ["class", "class"], ["class", "constant"],
["class", "date"], ["class", "file"], ["class", "integer"], ["class", "list"], ["class", "number"],
["class", "POSIX file"],
["class", "real"], ["class", "record"], ["class", "reference"],
["class", "RGB color"],
["class", "script"], ["class", "text"], ["class", "centimetres"], ["class", "centimeters"], ["class", "feet"],
["class", "inches"], ["class", "kilometres"], ["class", "kilometers"], ["class", "metres"], ["class", "meters"],
["class", "miles"], ["class", "yards"],
["class", "square feet"], ["class", "square kilometres"], ["class", "square kilometers"], ["class", "square metres"],
["class", "square meters"], ["class", "square miles"], ["class", "square yards"],
["class", "cubic centimetres"], ["class", "cubic centimeters"], ["class", "cubic feet"], ["class", "cubic inches"],
["class", "cubic metres"], ["class", "cubic meters"], ["class", "cubic yards"],
["class", "gallons"], ["class", "litres"], ["class", "liters"], ["class", "quarts"], ["class", "grams"],
["class", "kilograms"], ["class", "ounces"], ["class", "pounds"],
["class", "degrees Celsius"], ["class", "degrees Fahrenheit"], ["class", "degrees Kelvin"]
]
----------------------------------------------------
Checks for all classes.

View File

@ -1,21 +0,0 @@
-- foo bar
# foo bar
(* foo
bar *)
(* foo
(* bar *)
*)
----------------------------------------------------
[
["comment", "-- foo bar"],
["comment", "# foo bar"],
["comment", "(* foo\r\nbar *)"],
["comment", "(* foo\r\n(* bar *)\r\n*)"]
]
----------------------------------------------------
Checks for single-line and multi-line comments.
Also checks for one level of nesting.

View File

@ -1,59 +0,0 @@
about above after against
apart from
around
aside from
at back before beginning behind below
beneath beside between but by
considering continue copy
does eighth else end
equal error every exit
false fifth first for fourth
from front get given global
if ignoring in
instead of
into is it its last
local me middle my
ninth of on onto
out of
over prop property put
repeat return returning
second set seventh since sixth
some tell tenth that the
then third through thru timeout
times to transaction true try
until where while whose with
without
----------------------------------------------------
[
["keyword", "about"], ["keyword", "above"], ["keyword", "after"], ["keyword", "against"],
["keyword", "apart from"],
["keyword", "around"],
["keyword", "aside from"],
["keyword", "at"], ["keyword", "back"], ["keyword", "before"], ["keyword", "beginning"], ["keyword", "behind"], ["keyword", "below"],
["keyword", "beneath"], ["keyword", "beside"], ["keyword", "between"], ["keyword", "but"], ["keyword", "by"],
["keyword", "considering"], ["keyword", "continue"], ["keyword", "copy"],
["keyword", "does"], ["keyword", "eighth"], ["keyword", "else"], ["keyword", "end"],
["keyword", "equal"], ["keyword", "error"], ["keyword", "every"], ["keyword", "exit"],
["keyword", "false"], ["keyword", "fifth"], ["keyword", "first"], ["keyword", "for"], ["keyword", "fourth"],
["keyword", "from"], ["keyword", "front"], ["keyword", "get"], ["keyword", "given"], ["keyword", "global"],
["keyword", "if"], ["keyword", "ignoring"], ["keyword", "in"],
["keyword", "instead of"],
["keyword", "into"], ["keyword", "is"], ["keyword", "it"], ["keyword", "its"], ["keyword", "last"],
["keyword", "local"], ["keyword", "me"], ["keyword", "middle"], ["keyword", "my"],
["keyword", "ninth"], ["keyword", "of"], ["keyword", "on"], ["keyword", "onto"],
["keyword", "out of"],
["keyword", "over"], ["keyword", "prop"], ["keyword", "property"], ["keyword", "put"],
["keyword", "repeat"], ["keyword", "return"], ["keyword", "returning"],
["keyword", "second"], ["keyword", "set"], ["keyword", "seventh"], ["keyword", "since"], ["keyword", "sixth"],
["keyword", "some"], ["keyword", "tell"], ["keyword", "tenth"], ["keyword", "that"], ["keyword", "the"],
["keyword", "then"], ["keyword", "third"], ["keyword", "through"], ["keyword", "thru"], ["keyword", "timeout"],
["keyword", "times"], ["keyword", "to"], ["keyword", "transaction"], ["keyword", "true"], ["keyword", "try"],
["keyword", "until"], ["keyword", "where"], ["keyword", "while"], ["keyword", "whose"], ["keyword", "with"],
["keyword", "without"]
]
----------------------------------------------------
Checks for all keywords.

View File

@ -1,17 +0,0 @@
42
3.14159
3e10
4.2E-5
----------------------------------------------------
[
["number", "42"],
["number", "3.14159"],
["number", "3e10"],
["number", "4.2E-5"]
]
----------------------------------------------------
Checks for numbers.

View File

@ -1,48 +0,0 @@
& = ≠ ≤ ≥
* + - / ÷ ^
< <= > >=
start with begin with end with
starts with begins with ends with
does not contain doesn't contain
contain contains
is in isn't in is not in
is contained by isn't contained by is not contained by
greater than greater than or equal greater than or equal to
less than less than or equal less than or equal to
does not come before doesn't come before comes before
does not come after doesn't come after comes after
is equal isn't equal is not equal
is equal to isn't equal to is not equal to
does not equal doesn't equal equals
isn't is not
ref a ref to a reference to
and or div mod as not
----------------------------------------------------
[
["operator", "&"], ["operator", "="], ["operator", "≠"], ["operator", "≤"], ["operator", "≥"],
["operator", "*"], ["operator", "+"], ["operator", "-"], ["operator", "/"], ["operator", "÷"], ["operator", "^"],
["operator", "<"], ["operator", "<="], ["operator", ">"], ["operator", ">="],
["operator", "start with"], ["operator", "begin with"], ["operator", "end with"],
["operator", "starts with"], ["operator", "begins with"], ["operator", "ends with"],
["operator", "does not contain"], ["operator", "doesn't contain"],
["operator", "contain"], ["operator", "contains"],
["operator", "is in"], ["operator", "isn't in"], ["operator", "is not in"],
["operator", "is contained by"], ["operator", "isn't contained by"], ["operator", "is not contained by"],
["operator", "greater than"], ["operator", "greater than or equal"], ["operator", "greater than or equal to"],
["operator", "less than"], ["operator", "less than or equal"], ["operator", "less than or equal to"],
["operator", "does not come before"], ["operator", "doesn't come before"], ["operator", "comes before"],
["operator", "does not come after"], ["operator", "doesn't come after"], ["operator", "comes after"],
["operator", "is equal"], ["operator", "isn't equal"], ["operator", "is not equal"],
["operator", "is equal to"], ["operator", "isn't equal to"], ["operator", "is not equal to"],
["operator", "does not equal"], ["operator", "doesn't equal"], ["operator", "equals"],
["operator", "isn't"], ["operator", "is not"],
["operator", "ref"], ["operator", "a ref to"], ["operator", "a reference to"],
["operator", "and"], ["operator", "or"], ["operator", "div"], ["operator", "mod"], ["operator", "as"], ["operator", "not"]
]
----------------------------------------------------
Checks for most of the operators.

View File

@ -1,13 +0,0 @@
""
"foo bar"
----------------------------------------------------
[
["string", "\"\""],
["string", "\"foo bar\""]
]
----------------------------------------------------
Checks for strings.

View File

@ -1,19 +0,0 @@
TIP: Foobar
NOTE: Foo bar baz
IMPORTANT: Foobar
WARNING: Foo bar baz
CAUTION: Foobar
----------------------------------------------------
[
["admonition", "TIP:"], " Foobar\r\n",
["admonition", "NOTE:"], " Foo bar baz\r\n",
["admonition", "IMPORTANT:"], " Foobar\r\n",
["admonition", "WARNING:"], " Foo bar baz\r\n",
["admonition", "CAUTION:"], " Foobar"
]
----------------------------------------------------
Checks for admonitions.

View File

@ -1,58 +0,0 @@
:Foo bar: baz
:Foobar: Foo +
bar +
baz
:Foo bar!:
:Foobar!:
=====
:Foo bar: baz
:Foobar: Foo +
bar +
baz
:Foo bar!:
:Foobar!:
=====
|=====
|
:Foo bar: baz
:Foobar: Foo +
bar +
baz
|=====
----------------------------------------------------
[
["attribute-entry", ":Foo bar: baz"],
["attribute-entry", ":Foobar: Foo +\r\nbar +\r\nbaz"],
["attribute-entry", ":Foo bar!:"],
["attribute-entry", ":Foobar!:"],
["other-block", [
["punctuation", "====="],
["attribute-entry", ":Foo bar: baz"],
["attribute-entry", ":Foobar: Foo +\r\nbar +\r\nbaz"],
["attribute-entry", ":Foo bar!:"],
["attribute-entry", ":Foobar!:"],
["punctuation", "====="]
]],
["table", [
["punctuation", "|====="],
["punctuation", "|"],
["attribute-entry", ":Foo bar: baz"],
["attribute-entry", ":Foobar: Foo +\r\nbar +\r\nbaz"],
["punctuation", "|====="]
]]
]
----------------------------------------------------
Checks for attribute entries.

Some files were not shown because too many files have changed in this diff Show More