-# [Prism](http://prismjs.com/)
+# [Prism](https://prismjs.com/)
[![Build Status](https://travis-ci.org/PrismJS/prism.svg?branch=master)](https://travis-ci.org/PrismJS/prism)
+[![npm](https://img.shields.io/npm/dw/prismjs.svg)](https://www.npmjs.com/package/prismjs)
-Prism is a lightweight, robust, elegant syntax highlighting library. It's a spin-off project from [Dabblet](http://dabblet.com/).
+Prism is a lightweight, robust, elegant syntax highlighting library. It's a spin-off project from [Dabblet](https://dabblet.com/).
-You can learn more on http://prismjs.com/.
+You can learn more on [prismjs.com](https://prismjs.com/).
-Why another syntax highlighter?: http://lea.verou.me/2012/07/introducing-prism-an-awesome-new-syntax-highlighter/#more-1841
+[Why another syntax highlighter?](https://lea.verou.me/2012/07/introducing-prism-an-awesome-new-syntax-highlighter/#more-1841)
+
+[More themes for Prism!](https://github.com/PrismJS/prism-themes)
## Contribute to Prism!
Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, considering giving back by sending a pull request. Here are a few tips:
-- Read the [documentation](http://prismjs.com/extending.html). Prism was designed to be extensible.
-- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the components/ folder. The minified files are also generated automatically.
+- Read the [documentation](https://prismjs.com/extending.html). Prism was designed to be extensible.
+- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. The minified files are also generated automatically.
- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. Having gulp installed, you just need to run the command `gulp`.
- Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc.
- Please try to err towards more smaller PRs rather than few huge PRs. If a PR includes changes I want to merge and changes I don't, handling it becomes difficult.
- My time is very limited these days, so it might take a long time to review longer PRs (short ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected.
- If you contribute a new language definition, you will be responsible for handling bug reports about that language definition.
-- If you add a new language definition, theme or plugin, you need to add it to `components.js` as well, so that it becomes available to the download build page.
+- If you add a new language definition, theme or plugin, you need to add it to `components.json` as well and rebuild Prism by running `gulp`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder.
Thank you so much for contributing!!
## Translations
-* [![中文说明](http://awesomes.oss-cn-beijing.aliyuncs.com/readme.png)](http://www.awesomes.cn/repo/PrismJS/prism)
+* [![中文说明](http://awesomes.oss-cn-beijing.aliyuncs.com/readme.png)](https://www.awesomes.cn/repo/PrismJS/prism)
"css": {
"title": "CSS",
"option": "default",
- "peerDependencies": "markup"
+ "modify": "markup"
},
"clike": {
"title": "C-like",
- "option": "default",
- "overrideExampleHeader": true
+ "option": "default"
},
"javascript": {
"title": "JavaScript",
"require": "clike",
- "peerDependencies": "markup",
+ "modify": "markup",
"alias": "js",
"option": "default"
},
"actionscript": {
"title": "ActionScript",
"require": "javascript",
- "peerDependencies": "markup",
+ "modify": "markup",
"owner": "Golmote"
},
"ada": {
"title": "Ada",
"owner": "Lucretia"
},
+ "antlr4": {
+ "title": "ANTLR4",
+ "alias": "g4",
+ "owner": "RunDevelopment"
+ },
"apacheconf": {
"title": "Apache Configuration",
"owner": "GuiTeK"
"title": "AppleScript",
"owner": "Golmote"
},
+ "aql": {
+ "title": "AQL",
+ "owner": "RunDevelopment"
+ },
"arduino": {
"title": "Arduino",
"require": "cpp",
"owner": "Golmote"
},
"asciidoc": {
- "alias": "adoc",
+ "alias": "adoc",
"title": "AsciiDoc",
"owner": "Golmote"
},
"title": "Batch",
"owner": "Golmote"
},
+ "bbcode": {
+ "title": "BBcode",
+ "alias": "shortcode",
+ "aliasTitles": {
+ "shortcode": "Shortcode"
+ },
+ "owner": "RunDevelopment"
+ },
"bison": {
"title": "Bison",
"require": "c",
"title": "Brainfuck",
"owner": "Golmote"
},
+ "brightscript": {
+ "title": "BrightScript",
+ "owner": "RunDevelopment"
+ },
"bro": {
"title": "Bro",
"owner": "wayward710"
"require": "clike",
"owner": "zeitgeist87"
},
+ "concurnas": {
+ "title": "Concurnas",
+ "alias": "conc",
+ "owner": "jasontatton"
+ },
"csharp": {
"title": "C#",
"require": "clike",
"css-extras": {
"title": "CSS Extras",
"require": "css",
+ "modify": "css",
"owner": "milesj"
},
"d": {
"require": "clike",
"owner": "Golmote"
},
+ "dax": {
+ "title": "DAX",
+ "owner": "peterbud"
+ },
"diff": {
"title": "Diff",
"owner": "uranusjr"
"alias": "jinja2",
"owner": "romanvm"
},
+ "dns-zone-file": {
+ "title": "DNS zone file",
+ "owner": "RunDevelopment",
+ "alias": "dns-zone"
+ },
"docker": {
"title": "Docker",
"alias": "dockerfile",
"title": "Elm",
"owner": "zwilias"
},
+ "etlua": {
+ "title": "Embedded Lua templating",
+ "require": ["lua", "markup-templating"],
+ "owner": "RunDevelopment"
+ },
"erb": {
"title": "ERB",
"require": ["ruby", "markup-templating"],
"title": "Erlang",
"owner": "Golmote"
},
+ "excel-formula": {
+ "title": "Excel Formula",
+ "alias": ["xlsx", "xls"],
+ "owner": "RunDevelopment"
+ },
"fsharp": {
"title": "F#",
"require": "clike",
"owner": "simonreynolds7"
},
+ "factor": {
+ "title": "Factor",
+ "owner": "catb0t"
+ },
+ "firestore-security-rules": {
+ "title": "Firestore security rules",
+ "require": "clike",
+ "owner": "RunDevelopment"
+ },
"flow": {
"title": "Flow",
"require": "javascript",
"title": "Fortran",
"owner": "Golmote"
},
+ "ftl": {
+ "title": "FreeMarker Template Language",
+ "require": "markup-templating",
+ "owner": "RunDevelopment"
+ },
"gcode": {
"title": "G-code",
"owner": "RunDevelopment"
},
+ "gdscript": {
+ "title": "GDScript",
+ "owner": "RunDevelopment"
+ },
"gedcom": {
"title": "GEDCOM",
"owner": "Golmote"
"haml": {
"title": "Haml",
"require": "ruby",
- "peerDependencies": [
+ "optional": [
"css",
+ "css-extras",
"coffeescript",
"erb",
"javascript",
"less",
"markdown",
- "ruby",
"scss",
"textile"
],
},
"http": {
"title": "HTTP",
- "peerDependencies": [
+ "optional": [
+ "css",
"javascript",
+ "json",
"markup"
],
"owner": "danielgtaylor"
"javadoc": {
"title": "JavaDoc",
"require": ["markup", "java", "javadoclike"],
- "peerDependencies": [
- "scala"
- ],
+ "modify": "java",
+ "optional": "scala",
"owner": "RunDevelopment"
},
"javadoclike": {
"title": "JavaDoc-like",
- "peerDependencies": [
+ "modify": [
"java",
"javascript",
"php"
"jsdoc": {
"title": "JSDoc",
"require": ["javascript", "javadoclike"],
- "peerDependencies": [
+ "modify": "javascript",
+ "optional": [
"actionscript",
"coffeescript"
],
"js-extras": {
"title": "JS Extras",
"require": "javascript",
- "peerDependencies": [
+ "modify": "javascript",
+ "optional": [
"actionscript",
"coffeescript",
"flow",
],
"owner": "RunDevelopment"
},
+ "js-templates": {
+ "title": "JS Templates",
+ "require": "javascript",
+ "modify": "javascript",
+ "optional": [
+ "css",
+ "css-extras",
+ "graphql",
+ "markdown",
+ "markup"
+ ],
+ "owner": "RunDevelopment"
+ },
"json": {
"title": "JSON",
"owner": "CupOfTea696"
},
"owner": "japborst"
},
+ "latte": {
+ "title": "Latte",
+ "require": ["clike", "markup-templating", "php"],
+ "owner": "nette"
+ },
"less": {
"title": "Less",
"require": "css",
+ "optional": "css-extras",
"owner": "Golmote"
},
+ "lilypond": {
+ "title": "LilyPond",
+ "require": "scheme",
+ "alias": "ly",
+ "owner": "RunDevelopment"
+ },
"liquid": {
"title": "Liquid",
"owner": "cinhtau"
"title": "LiveScript",
"owner": "Golmote"
},
+ "llvm": {
+ "title": "LLVM IR",
+ "owner": "porglezomp"
+ },
"lolcode": {
"title": "LOLCODE",
"owner": "Golmote"
"title": "Monkey",
"owner": "Golmote"
},
+ "moonscript": {
+ "title": "MoonScript",
+ "alias": "moon",
+ "owner": "RunDevelopment"
+ },
"n1ql": {
"title": "N1QL",
"owner": "TMWilds"
"n4js": {
"title": "N4JS",
"require": "javascript",
- "peerDependencies": [
- "jsdoc"
- ],
+ "optional": "jsdoc",
"alias": "n4jsd",
"owner": "bsmith-n4"
},
"title": "NASM",
"owner": "rbmj"
},
+ "neon": {
+ "title": "NEON",
+ "owner": "nette"
+ },
"nginx": {
"title": "nginx",
"owner": "westonganger",
},
"opencl": {
"title": "OpenCL",
- "require": "cpp",
- "peerDependencies": [
+ "require": "c",
+ "modify": [
"c",
"cpp"
],
- "overrideExampleHeader": true,
"owner": "Milania1"
},
"oz": {
},
"owner": "Golmote"
},
+ "pascaligo": {
+ "title": "Pascaligo",
+ "owner": "DefinitelyNotAGoat"
+ },
+ "pcaxis": {
+ "title": "PC-Axis",
+ "alias": "px",
+ "owner": "RunDevelopment"
+ },
"perl": {
"title": "Perl",
"owner": "Golmote"
"phpdoc": {
"title": "PHPDoc",
"require": ["php", "javadoclike"],
+ "modify": "php",
"owner": "RunDevelopment"
},
"php-extras": {
"title": "PHP Extras",
"require": "php",
+ "modify": "php",
"owner": "milesj"
},
"plsql": {
"require": "sql",
"owner": "Golmote"
},
+ "powerquery": {
+ "title": "PowerQuery",
+ "alias": ["pq", "mscript"],
+ "owner": "peterbud"
+ },
"powershell": {
"title": "PowerShell",
"owner": "nauzilus"
"pug": {
"title": "Pug",
"require": ["markup", "javascript"],
- "peerDependencies": [
+ "optional": [
"coffeescript",
"ejs",
"handlebars",
},
"pure": {
"title": "Pure",
- "peerDependencies": [
+ "optional": [
"c",
"cpp",
"fortran"
"title": "Q (kdb+ database)",
"owner": "Golmote"
},
+ "qml": {
+ "title": "QML",
+ "require": "javascript",
+ "owner": "RunDevelopment"
+ },
"qore": {
"title": "Qore",
"require": "clike",
"jsx": {
"title": "React JSX",
"require": ["markup", "javascript"],
- "peerDependencies": [
+ "optional": [
"jsdoc",
- "js-extras"
+ "js-extras",
+ "js-templates"
],
"owner": "vkbansal"
},
},
"regex": {
"title": "Regex",
- "peerDependencies": [
+ "modify": [
"actionscript",
"coffeescript",
"flow",
"title": "Roboconf",
"owner": "Golmote"
},
+ "robotframework": {
+ "title": "Robot Framework",
+ "alias": "robot",
+ "owner": "RunDevelopment"
+ },
"ruby": {
"title": "Ruby",
"require": "clike",
},
"sas": {
"title": "SAS",
+ "optional": ["groovy", "lua", "sql"],
"owner": "Golmote"
},
"sass": {
"scss": {
"title": "Sass (Scss)",
"require": "css",
+ "optional": "css-extras",
"owner": "MoOx"
},
"scala": {
"require": "markup-templating",
"owner": "Golmote"
},
- "sql": {
- "title": "SQL",
- "owner": "multipetros"
+ "solidity": {
+ "title": "Solidity (Ethereum)",
+ "require": "clike",
+ "owner": "glachaud"
+ },
+ "solution-file": {
+ "title": "Solution file",
+ "alias": "sln",
+ "owner": "RunDevelopment"
},
"soy": {
"title": "Soy (Closure Template)",
"require": "markup-templating",
"owner": "Golmote"
},
+ "sparql": {
+ "title": "SPARQL",
+ "require": "turtle",
+ "owner": "Triply-Dev",
+ "alias": "rq"
+ },
+ "splunk-spl": {
+ "title": "Splunk SPL",
+ "owner": "RunDevelopment"
+ },
+ "sqf": {
+ "title": "SQF: Status Quo Function (Arma 3)",
+ "require": "clike",
+ "owner": "RunDevelopment"
+ },
+ "sql": {
+ "title": "SQL",
+ "owner": "multipetros"
+ },
"stylus": {
"title": "Stylus",
"owner": "vkbansal"
"textile": {
"title": "Textile",
"require": "markup",
- "peerDependencies": "css",
+ "optional": "css",
"owner": "Golmote"
},
"toml": {
"require": ["clike", "markup-templating"],
"owner": "gflohr"
},
+ "turtle": {
+ "title": "Turtle",
+ "alias": "trig",
+ "aliasTitles": {
+ "trig": "TriG"
+ },
+ "owner": "jakubklimek"
+ },
"twig": {
"title": "Twig",
"require": "markup",
"typescript": {
"title": "TypeScript",
"require": "javascript",
+ "optional": "js-templates",
"alias": "ts",
"owner": "vkbansal"
},
"title": "YAML",
"alias": "yml",
"owner": "hason"
+ },
+ "zig": {
+ "title": "Zig",
+ "owner": "RunDevelopment"
}
},
"plugins": {
"path": "plugins/{id}/prism-{id}",
"link": "plugins/{id}/"
},
- "line-highlight": "Line Highlight",
+ "line-highlight": {
+ "title": "Line Highlight",
+ "description": "Highlights specific lines and/or line ranges."
+ },
"line-numbers": {
"title": "Line Numbers",
+ "description": "Line number at the beginning of code lines.",
"owner": "kuba-kubula"
},
"show-invisibles": {
"title": "Show Invisibles",
- "after": [
+ "description": "Show hidden characters such as tabs and line breaks.",
+ "optional": [
"autolinker",
"data-uri-highlight"
]
},
- "autolinker": "Autolinker",
- "wpd": "WebPlatform Docs",
+ "autolinker": {
+ "title": "Autolinker",
+ "description": "Converts URLs and emails in code to clickable links. Parses Markdown links in comments."
+ },
+ "wpd": {
+ "title": "WebPlatform Docs",
+ "description": "Makes tokens link to <a href=\"https://webplatform.github.io/docs/\">WebPlatform.org documentation</a>. The links open in a new tab."
+ },
"custom-class": {
"title": "Custom Class",
+ "description": "This plugin allows you to prefix Prism's default classes (<code>.comment</code> can become <code>.namespace--comment</code>) or replace them with your defined ones (like <code>.editor__comment</code>). You can even add new classes.",
"owner": "dvkndn",
"noCSS": true
},
"file-highlight": {
"title": "File Highlight",
+ "description": "Fetch external files and highlight them with Prism. Used on the Prism website itself.",
"noCSS": true
},
"show-language": {
"title": "Show Language",
+ "description": "Display the highlighted language in code blocks (inline code does not show the label).",
"owner": "nauzilus",
"noCSS": true,
"require": "toolbar"
},
"jsonp-highlight": {
"title": "JSONP Highlight",
+ "description": "Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",
"noCSS": true,
"owner": "nauzilus"
},
"highlight-keywords": {
"title": "Highlight Keywords",
+ "description": "Adds special CSS classes for each keyword matched in the code. For example, the keyword <code>if</code> will have the class <code>keyword-if</code> as well. You can have fine grained control over the appearance of each keyword by providing your own CSS rules.",
"owner": "vkbansal",
"noCSS": true
},
"remove-initial-line-feed": {
"title": "Remove initial line feed",
+ "description": "Removes the initial line feed in code blocks.",
"owner": "Golmote",
"noCSS": true
},
+ "inline-color": {
+ "title": "Inline color",
+ "description": "Adds a small inline preview for colors in style sheets.",
+ "require": "css-extras",
+ "owner": "RunDevelopment"
+ },
"previewers": {
"title": "Previewers",
+ "description": "Previewers for angles, colors, gradients, easing and time.",
+ "require": "css-extras",
"owner": "Golmote"
},
"autoloader": {
"title": "Autoloader",
+ "description": "Automatically loads the needed languages to highlight the code blocks.",
"owner": "Golmote",
"noCSS": true
},
"keep-markup": {
"title": "Keep Markup",
+ "description": "Prevents custom markup from being dropped out during highlighting.",
"owner": "Golmote",
- "after": "normalize-whitespace",
+ "optional": "normalize-whitespace",
"noCSS": true
},
"command-line": {
"title": "Command Line",
+ "description": "Display a command line with a prompt and, optionally, the output/response from the commands.",
"owner": "chriswells0"
},
- "unescaped-markup": "Unescaped Markup",
+ "unescaped-markup": {
+ "title": "Unescaped Markup",
+ "description": "Write markup without having to escape anything."
+ },
"normalize-whitespace": {
"title": "Normalize Whitespace",
+ "description": "Supports multiple operations to normalize whitespace in code blocks.",
"owner": "zeitgeist87",
- "after": "unescaped-markup",
+ "optional": "unescaped-markup",
"noCSS": true
},
"data-uri-highlight": {
"title": "Data-URI Highlight",
+ "description": "Highlights data-URI contents.",
"owner": "Golmote",
"noCSS": true
},
"toolbar": {
"title": "Toolbar",
+ "description": "Attach a toolbar for plugins to easily register buttons on the top of a code block.",
"owner": "mAAdhaTTah"
},
"copy-to-clipboard": {
"title": "Copy to Clipboard Button",
+ "description": "Add a button that copies the code block to the clipboard when clicked.",
"owner": "mAAdhaTTah",
"require": "toolbar",
"noCSS": true
+ },
+ "download-button": {
+ "title": "Download Button",
+ "description": "A button in the toolbar of a code block adding a convenient way to download a code file.",
+ "owner": "Golmote",
+ "require": "toolbar",
+ "noCSS": true
+ },
+ "match-braces": {
+ "title": "Match braces",
+ "description": "Highlights matching braces.",
+ "owner": "RunDevelopment"
+ },
+ "diff-highlight": {
+ "title": "Diff Highlight",
+ "description": "Highlights the code inside diff blocks.",
+ "owner": "RunDevelopment",
+ "require": "diff"
+ },
+ "filter-highlight-all": {
+ "title": "Filter highlightAll",
+ "description": "Filters the elements the <code>highlightAll</code> and <code>highlightAllUnder</code> methods actually highlight.",
+ "owner": "RunDevelopment",
+ "noCSS": true
+ },
+ "treeview": {
+ "title": "Treeview",
+ "description": "A language with special styles to highlight file system tree structures.",
+ "owner": "Golmote"
}
}
}
-define(["prism/prism","prism/components/prism-javascript","prism/components/prism-markup"], function () {
+define(["prism/prism","prism/components/prism-javascript"], function () {
Prism.languages.actionscript = Prism.languages.extend('javascript', {
'keyword': /\b(?: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)\b/,
'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
'xml': {
pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,
lookbehind: true,
- inside: {
- rest: Prism.languages.markup
- }
+ inside: Prism.languages.markup
}
});
}
+
return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.antlr4 = {
+ 'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
+ 'string': {
+ pattern: /'(?:\\.|[^\\'\r\n])*'/,
+ greedy: true
+ },
+ 'character-class': {
+ pattern: /\[(?:\\.|[^\\\]\r\n])*\]/,
+ greedy: true,
+ alias: 'regex',
+ inside: {
+ 'range': {
+ pattern: /([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/,
+ lookbehind: true,
+ alias: 'punctuation'
+ },
+ 'escape': /\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/,
+ 'punctuation': /[\[\]]/
+ }
+ },
+ 'action': {
+ pattern: /\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/,
+ greedy: true,
+ inside: {
+ 'content': {
+ // this might be C, C++, Python, Java, C#, or any other language ANTLR4 compiles to
+ pattern: /(\{)[\s\S]+(?=\})/,
+ lookbehind: true
+ },
+ 'punctuation': /[{}]/
+ }
+ },
+ 'command': {
+ pattern: /(->\s*)(?:\s*(?:,\s*)?[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,
+ lookbehind: true,
+ inside: {
+ 'function': /\b\w+(?=\s*(?:[,(]|$))/,
+ 'punctuation': /[,()]/
+ }
+ },
+ 'annotation': {
+ pattern: /@\w+(?:::\w+)*/,
+ alias: 'keyword'
+ },
+ 'label': {
+ pattern: /#[ \t]*\w+/,
+ alias: 'punctuation'
+ },
+ 'keyword': /\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/,
+ 'definition': [
+ {
+ pattern: /\b[a-z]\w*(?=\s*:)/,
+ alias: ['rule', 'class-name']
+ },
+ {
+ pattern: /\b[A-Z]\w*(?=\s*:)/,
+ alias: ['token', 'constant']
+ },
+ ],
+ 'constant': /\b[A-Z][A-Z_]*\b/,
+ 'operator': /\.\.|->|[|~]|[*+?]\??/,
+ 'punctuation': /[;:()=]/
+};
+
+Prism.languages.g4 = Prism.languages.antlr4;
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.aql = {
+ 'comment': /\/\/.*|\/\*[\s\S]*?\*\//,
+ 'property': {
+ pattern: /([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/,
+ lookbehind: true,
+ greedy: true
+ },
+ 'string': {
+ pattern: /(["'´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,
+ greedy: true
+ },
+ 'variable': /@@?\w+/,
+ 'keyword': [
+ {
+ pattern: /(\bWITH\s+)COUNT(?=\s+INTO\b)/i,
+ lookbehind: true
+ },
+ /\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WITH)\b/i,
+ // pseudo keywords get a lookbehind to avoid false positives
+ {
+ pattern: /(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i,
+ lookbehind: true
+ },
+ {
+ pattern: /(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/,
+ lookbehind: true
+ },
+ {
+ pattern: /\bOPTIONS(?=\s*{)/i
+ }
+ ],
+ 'function': /(?!\d)\w+(?=\s*\()/,
+ 'boolean': /(?:true|false)/i,
+ 'range': {
+ pattern: /\.\./,
+ alias: 'operator'
+ },
+ 'number': /(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i,
+ 'operator': /\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/,
+ 'punctuation': /::|[?.:,;()[\]{}]/
+};
+
+return Prism; })
\ No newline at end of file
define(["prism/prism","prism/components/prism-markup","prism/components/prism-csharp"], function () {
Prism.languages.aspnet = Prism.languages.extend('markup', {
- 'page-directive tag': {
+ 'page-directive': {
pattern: /<%\s*@.*%>/i,
+ alias: 'tag',
inside: {
- 'page-directive tag': /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,
+ 'page-directive': {
+ pattern: /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,
+ alias: 'tag'
+ },
rest: Prism.languages.markup.tag.inside
}
},
- 'directive tag': {
+ 'directive': {
pattern: /<%.*%>/i,
+ alias: 'tag',
inside: {
- 'directive tag': /<%\s*?[$=%#:]{0,2}|%>/i,
+ 'directive': {
+ pattern: /<%\s*?[$=%#:]{0,2}|%>/i,
+ alias: 'tag'
+ },
rest: Prism.languages.csharp
}
}
// match directives of attribute value foo="<% Bar %>"
Prism.languages.insertBefore('inside', 'punctuation', {
- 'directive tag': Prism.languages.aspnet['directive tag']
+ 'directive': Prism.languages.aspnet['directive']
}, Prism.languages.aspnet.tag.inside["attr-value"]);
Prism.languages.insertBefore('aspnet', 'comment', {
- 'asp comment': /<%--[\s\S]*?--%>/
+ 'asp-comment': {
+ pattern: /<%--[\s\S]*?--%>/,
+ alias: ['asp', 'comment']
+ }
});
// script runat="server" contains csharp, not javascript
Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', {
- 'asp script': {
+ 'asp-script': {
pattern: /(<script(?=.*runat=['"]?server['"]?)[\s\S]*?>)[\s\S]*?(?=<\/script>)/i,
lookbehind: true,
+ alias: ['asp', 'script'],
inside: Prism.languages.csharp || {}
}
});
+
return Prism; })
\ No newline at end of file
// NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl
Prism.languages.autohotkey= {
'comment': {
- pattern: /(^[^";\n]*("[^"\n]*?"[^"\n]*?)*)(?:;.*$|^\s*\/\*[\s\S]*\n\*\/)/m,
+ pattern: /(^[^";\n]*(?:"[^"\n]*?"[^"\n]*?)*)(?:;.*$|^\s*\/\*[\s\S]*\n\*\/)/m,
lookbehind: true
},
'string': /"(?:[^"\n\r]|"")*"/m,
'keyword': /\b(?:Abort|AboveNormal|Add|ahk_class|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i
};
+
return Prism; })
\ No newline at end of file
'string': [
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
{
- pattern: /((?:^|[^<])<<-?\s*)(\w+?)\s*(?:\r?\n|\r)(?:[\s\S])*?(?:\r?\n|\r)\2/,
+ pattern: /((?:^|[^<])<<-?\s*)(\w+?)\s*(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\2/,
lookbehind: true,
greedy: true,
inside: insideString
// Here-document with quotes around the tag
// → No expansion (so no “inside”).
{
- pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s*(?:\r?\n|\r)(?:[\s\S])*?(?:\r?\n|\r)\3/,
+ pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s*(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\3/,
lookbehind: true,
greedy: true
},
// “Normal” string
{
- pattern: /(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1/,
+ pattern: /(^|[^\\](?:\\\\)*)(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\2)[^\\])*\2/,
+ lookbehind: true,
greedy: true,
inside: insideString
}
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.bbcode = {
+ 'tag': {
+ pattern: /\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,
+ inside: {
+ 'tag': {
+ pattern: /^\[\/?[^\s=\]]+/,
+ inside: {
+ 'punctuation': /^\[\/?/
+ }
+ },
+ 'attr-value': {
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/i,
+ inside: {
+ 'punctuation': [
+ /^=/,
+ {
+ pattern: /^(\s*)["']|["']$/,
+ lookbehind: true
+ }
+ ]
+ }
+ },
+ 'punctuation': /\]/,
+ 'attr-name': /[^\s=\]]+/
+ }
+ }
+};
+
+Prism.languages.shortcode = Prism.languages.bbcode;
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.brightscript = {
+ 'comment': /(?:\brem|').*/i,
+ 'directive-statement': {
+ pattern: /(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im,
+ lookbehind: true,
+ alias: 'property',
+ inside: {
+ 'error-message': {
+ pattern: /(^#error).+/,
+ lookbehind: true
+ },
+ 'directive': {
+ pattern: /^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/,
+ alias: 'keyword'
+ },
+ 'expression': {
+ pattern: /[\s\S]+/,
+ inside: null // see below
+ }
+ }
+ },
+ 'property': {
+ pattern: /([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/,
+ lookbehind: true,
+ greedy: true
+ },
+ 'string': {
+ pattern: /"(?:[^"\r\n]|"")*"(?!")/,
+ greedy: true
+ },
+ 'class-name': {
+ pattern: /(\bAs[\t ]+)\w+/i,
+ lookbehind: true
+ },
+ 'keyword': /\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i,
+ 'boolean': /\b(?:true|false)\b/i,
+ 'function': /\b(?!\d)\w+(?=[\t ]*\()/i,
+ 'number': /(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i,
+ 'operator': /--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i,
+ 'punctuation': /[.,;()[\]{}]/,
+ 'constant': /\b(?:LINE_NUM)\b/i
+};
+
+Prism.languages.brightscript['directive-statement'].inside.expression.inside = Prism.languages.brightscript;
+
+return Prism; })
\ No newline at end of file
define(["prism/prism","prism/components/prism-clike"], function () {
Prism.languages.c = Prism.languages.extend('clike', {
+ 'comment': {
+ pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
+ greedy: true
+ },
'class-name': {
- pattern: /(\b(?:enum|struct)\s+)\w+/,
+ pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+/,
lookbehind: true
},
- 'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
+ 'keyword': /\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,
+ 'function': /[a-z_]\w*(?=\s*\()/i,
'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,
'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i
});
define(["prism/prism"], function () {
Prism.languages.cil = {
'comment': /\/\/.*/,
-
+
'string': {
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true
},
-
+
'directive': {
pattern: /(^|\W)\.[a-z]+(?=\s)/,
lookbehind: true,
alias: 'class-name'
},
-
+
// Actually an assembly reference
'variable': /\[[\w\.]+\]/,
-
-
+
+
'keyword': /\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|iant|idispatch|implements|import|initonly|instance|u?int(?:8|16|32|64)?|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/,
-
- 'function': /\b(?:(?:constrained|unaligned|volatile|readonly|tail|no)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.[0-9]+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.[0-9]+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|ldvirtftn|castclass|beq(?:\.s)?|mkrefany|localloc|ckfinite|rethrow|ldtoken|ldsflda|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stloc|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|clt|cgt|ceq|box|and|or|br)\b/,
-
+
+ 'function': /\b(?:(?:constrained|unaligned|volatile|readonly|tail|no)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.[0-9]+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.[0-9]+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|ldvirtftn|castclass|beq(?:\.s)?|mkrefany|localloc|ckfinite|rethrow|ldtoken|ldsflda|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stloc|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|clt|cgt|ceq|box|and|or|br)\b/,
+
'boolean': /\b(?:true|false)\b/,
'number': /\b-?(?:0x[0-9a-fA-F]+|[0-9]+)(?:\.[0-9a-fA-F]+)?\b/i,
-
+
'punctuation': /[{}[\];(),:=]|IL_[0-9A-Za-z]+/
}
greedy: true
},
'class-name': {
- pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,
+ pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
lookbehind: true,
inside: {
- punctuation: /[.\\]/
+ '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': /\w+(?=\()/,
'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,
- 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
+ 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
'punctuation': /[{}[\];(),.:]/
};
define(["prism/prism"], function () {
// Copied from https://github.com/jeluard/prism-clojure
Prism.languages.clojure = {
- comment: /;+.*/,
- string: /"(?:\\.|[^\\"\r\n])*"/,
- operator: /(?:::|[:|'])\b[a-z][\w*+!?-]*\b/i, //used for symbols and keywords
- keyword: {
+ 'comment': /;.*/,
+ 'string': {
+ pattern: /"(?:[^"\\]|\\.)*"/,
+ greedy: true
+ },
+ 'operator': /(?:::|[:|'])\b[a-z][\w*+!?-]*\b/i, //used for symbols and keywords
+ 'keyword': {
pattern: /([^\w+*'?-])(?:def|if|do|let|\.\.|quote|var|->>|->|fn|loop|recur|throw|try|monitor-enter|\.|new|set!|def\-|defn|defn\-|defmacro|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|==|defrecord|>=|deftype|<=|defproject|ns|\*|\+|\-|\/|<|=|>|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|conj|cons|constantly|cond|if-not|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|deref|difference|disj|dissoc|distinct|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|for|fnseq|frest|gensym|get-proxy-class|get|hash-map|hash-set|identical\?|identity|if-let|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|line-seq|list\*|list|load|load-file|locking|long|loop|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|name|namespace|neg\?|new|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|time|to-array|to-array-2d|tree-seq|true\?|union|up|update-proxy|val|vals|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[^\w+*'?-])/,
lookbehind: true
},
- boolean: /\b(?:true|false|nil)\b/,
- number: /\b[0-9A-Fa-f]+\b/,
- punctuation: /[{}\[\](),]/
+ 'boolean': /\b(?:true|false|nil)\b/,
+ 'number': /\b[\da-f]+\b/i,
+ 'punctuation': /[{}\[\](),]/
};
return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.concurnas = {
+ 'comment': [
+ {
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
+ lookbehind: true
+ },
+ {
+ pattern: /(^|[^\\:])\/\/.*/,
+ lookbehind: true,
+ greedy: true
+ }
+ ],
+ 'langext': {
+ pattern: /\w+\s*\|\|[\s\S]+?\|\|/,
+ greedy: true,
+ alias: 'string'
+ },
+ 'function': {
+ pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,
+ lookbehind: true
+ },
+ 'keyword': /\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,
+ 'boolean': /\b(?:false|true)\b/,
+ 'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,
+ 'punctuation': /[{}[\];(),.:]/,
+ 'operator': /<==|>==|=>|->|<-|<>|\^|&==|&<>|!|\?|\?:|\.\?|\+\+|--|[-+*/=<>]=?|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,
+ 'annotation': {
+ pattern: /@(?:\w+:)?(?:\w*|\[[^\]]+\])/,
+ alias: 'builtin'
+ }
+};
+
+Prism.languages.insertBefore('concurnas', 'langext', {
+ 'string': {
+ pattern: /[rs]?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
+ greedy: true,
+ inside: {
+ 'interpolation': {
+ pattern: /((?:^|[^\\])(?:\\{2})*){(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,
+ lookbehind: true,
+ inside: Prism.languages.concurnas
+ },
+ 'string': /[\s\S]+/
+ }
+ }
+});
+
+Prism.languages.conc = Prism.languages.concurnas;
+return Prism; })
\ No newline at end of file
pattern: /(\b(?:class|enum|struct)\s+)\w+/,
lookbehind: true
},
- 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,
+ 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,
'number': {
pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i,
greedy: true
define(["prism/prism","prism/components/prism-clike"], function () {
-Prism.languages.csharp = Prism.languages.extend('clike', {
- 'keyword': /\b(?:abstract|add|alias|as|ascending|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|descending|do|double|dynamic|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|from|get|global|goto|group|if|implicit|in|int|interface|internal|into|is|join|let|lock|long|namespace|new|null|object|operator|orderby|out|override|params|partial|private|protected|public|readonly|ref|remove|return|sbyte|sealed|select|set|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|value|var|virtual|void|volatile|where|while|yield)\b/,
- 'string': [
- {
- pattern: /@("|')(?:\1\1|\\[\s\S]|(?!\1)[^\\])*\1/,
- greedy: true
- },
- {
- pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*?\1/,
- greedy: true
+(function (Prism) {
+
+ /**
+ * Replaces all placeholders "<<n>>" of given pattern with the n-th replacement (zero based).
+ *
+ * Note: This is a simple text based replacement. Be careful when using backreferences!
+ *
+ * @param {string} pattern the given pattern.
+ * @param {string[]} replacements a list of replacement which can be inserted into the given pattern.
+ * @returns {string} the pattern with all placeholders replaced with their corresponding replacements.
+ * @example replace(/a<<0>>a/.source, [/b+/.source]) === /a(?:b+)a/.source
+ */
+ function replace(pattern, replacements) {
+ return pattern.replace(/<<(\d+)>>/g, function (m, index) {
+ return '(?:' + replacements[+index] + ')';
+ });
+ }
+ /**
+ * @param {string} pattern
+ * @param {string[]} replacements
+ * @param {string} [flags]
+ * @returns {RegExp}
+ */
+ function re(pattern, replacements, flags) {
+ return RegExp(replace(pattern, replacements), flags || '');
+ }
+
+ /**
+ * Creates a nested pattern where all occurrences of the string `<<self>>` are replaced with the pattern itself.
+ *
+ * @param {string} pattern
+ * @param {number} depthLog2
+ * @returns {string}
+ */
+ function nested(pattern, depthLog2) {
+ for (var i = 0; i < depthLog2; i++) {
+ pattern = pattern.replace(/<<self>>/g, function () { return '(?:' + pattern + ')'; });
+ }
+ return pattern.replace(/<<self>>/g, '[^\\s\\S]');
+ }
+
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/
+ var keywordKinds = {
+ // keywords which represent a return or variable type
+ type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
+ // keywords which are used to declare a type
+ typeDeclaration: 'class enum interface struct',
+ // contextual keywords
+ // ("var" and "dynamic" are missing because they are used like types)
+ contextual: 'add alias ascending async await by descending from get global group into join let nameof notnull on orderby partial remove select set unmanaged value when where where',
+ // all other keywords
+ other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
+ };
+
+ // keywords
+ function keywordsToPattern(words) {
+ return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b';
+ }
+ var typeDeclarationKeywords = keywordsToPattern(keywordKinds.typeDeclaration);
+ var keywords = RegExp(keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other));
+ var nonTypeKeywords = keywordsToPattern(keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other);
+ var nonContextualKeywords = keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.other);
+
+ // types
+ var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2); // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement.
+ var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
+ var name = /@?\b[A-Za-z_]\w*\b/.source;
+ var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [name, generic]);
+ var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [nonTypeKeywords, genericName]);
+ var array = /\[\s*(?:,\s*)*\]/.source;
+ var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [generic, nestedRound, array])
+ var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
+ var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [tuple, identifier, array]);
+
+ var typeInside = {
+ 'keyword': keywords,
+ 'punctuation': /[<>()?,.:[\]]/
+ };
+
+ // strings & characters
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#character-literals
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#string-literals
+ var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; // simplified pattern
+ var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
+ var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
+
+
+ Prism.languages.csharp = Prism.languages.extend('clike', {
+ 'string': [
+ {
+ pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
+ lookbehind: true,
+ greedy: true
+ },
+ {
+ pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
+ lookbehind: true,
+ greedy: true
+ },
+ {
+ pattern: RegExp(character),
+ greedy: true,
+ alias: 'character'
+ }
+ ],
+ 'class-name': [
+ {
+ // Using static
+ // using static System.Math;
+ pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [identifier]),
+ lookbehind: true,
+ inside: typeInside
+ },
+ {
+ // Using alias (type)
+ // using Project = PC.MyCompany.Project;
+ pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [name, typeExpression]),
+ lookbehind: true,
+ inside: typeInside
+ },
+ {
+ // Using alias (alias)
+ // using Project = PC.MyCompany.Project;
+ pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
+ lookbehind: true
+ },
+ {
+ // Type declarations
+ // class Foo<A, B>
+ // interface Foo<out A, B>
+ pattern: re(/(\b<<0>>\s+)<<1>>/.source, [typeDeclarationKeywords, genericName]),
+ lookbehind: true,
+ inside: typeInside
+ },
+ {
+ // Single catch exception declaration
+ // catch(Foo)
+ // (things like catch(Foo e) is covered by variable declaration)
+ pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
+ lookbehind: true,
+ inside: typeInside
+ },
+ {
+ // Name of the type parameter of generic constraints
+ // where Foo : class
+ pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
+ lookbehind: true
+ },
+ {
+ // Casts and checks via as and is.
+ // as Foo<A>, is Bar<B>
+ // (things like if(a is Foo b) is covered by variable declaration)
+ pattern: re(/(\b(?:is|as)\s+)<<0>>/.source, [typeExpression]),
+ lookbehind: true,
+ inside: typeInside
+ },
+ {
+ // Variable, field and parameter declaration
+ // (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
+ pattern: re(/\b<<0>>(?=\s+(?!<<1>>)<<2>>(?:\s*[=,;:{)\]]|\s+in))/.source, [typeExpression, nonContextualKeywords, name]),
+ inside: typeInside
+ }
+ ],
+ 'keyword': keywords,
+ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
+ 'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,
+ 'operator': />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
+ 'punctuation': /\?\.?|::|[{}[\];(),.:]/
+ });
+
+ Prism.languages.insertBefore('csharp', 'number', {
+ 'range': {
+ pattern: /\.\./,
+ alias: 'operator'
+ }
+ });
+
+ Prism.languages.insertBefore('csharp', 'punctuation', {
+ 'named-parameter': {
+ pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
+ lookbehind: true,
+ alias: 'punctuation'
}
- ],
- 'class-name': [
- {
- // (Foo bar, Bar baz)
- pattern: /\b[A-Z]\w*(?:\.\w+)*\b(?=\s+\w+)/,
+ });
+
+ Prism.languages.insertBefore('csharp', 'class-name', {
+ 'namespace': {
+ // namespace Foo.Bar {}
+ // using Foo.Bar;
+ pattern: re(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [name]),
+ lookbehind: true,
inside: {
- punctuation: /\./
+ 'punctuation': /\./
}
},
- {
- // [Foo]
- pattern: /(\[)[A-Z]\w*(?:\.\w+)*\b/,
+ 'type-expression': {
+ // default(Foo), typeof(Foo<Bar>), sizeof(int)
+ pattern: re(/(\b(?:default|typeof|sizeof)\s*\(\s*)(?:[^()\s]|\s(?!\s*\))|<<0>>)*(?=\s*\))/.source, [nestedRound]),
+ lookbehind: true,
+ alias: 'class-name',
+ inside: typeInside
+ },
+ 'return-type': {
+ // Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
+ // int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
+ // int Foo => 0; int Foo { get; set } = 0;
+ pattern: re(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [typeExpression, identifier]),
+ inside: typeInside,
+ alias: 'class-name'
+ },
+ 'constructor-invocation': {
+ // new List<Foo<Bar[]>> { }
+ pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
lookbehind: true,
+ inside: typeInside,
+ alias: 'class-name'
+ },
+ /*'explicit-implementation': {
+ // int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
+ pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
+ inside: classNameInside,
+ alias: 'class-name'
+ },*/
+ 'generic-method': {
+ // foo<Bar>()
+ pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [name, generic]),
inside: {
- punctuation: /\./
+ 'function': re(/^<<0>>/.source, [name]),
+ 'generic': {
+ pattern: RegExp(generic),
+ alias: 'class-name',
+ inside: typeInside
+ }
}
},
- {
- // class Foo : Bar
- pattern: /(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/,
+ 'type-list': {
+ // The list of types inherited or of generic constraints
+ // class Foo<F> : Bar, IList<FooBar>
+ // where F : Bar, IList<int>
+ pattern: re(
+ /\b((?:<<0>>\s+<<1>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>)(?:\s*,\s*(?:<<3>>|<<4>>))*(?=\s*(?:where|[{;]|=>|$))/.source,
+ [typeDeclarationKeywords, genericName, name, typeExpression, keywords.source]
+ ),
lookbehind: true,
inside: {
- punctuation: /\./
+ 'keyword': keywords,
+ 'class-name': {
+ pattern: RegExp(typeExpression),
+ greedy: true,
+ inside: typeInside
+ },
+ 'punctuation': /,/
}
},
- {
- // class Foo
- pattern: /((?:\b(?:class|interface|new)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/,
+ 'preprocessor': {
+ pattern: /(^\s*)#.*/m,
+ lookbehind: true,
+ alias: 'property',
+ inside: {
+ // highlight preprocessor directives as keywords
+ 'directive': {
+ pattern: /(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,
+ lookbehind: true,
+ alias: 'keyword'
+ }
+ }
+ }
+ });
+
+ // attributes
+ var regularStringOrCharacter = regularString + '|' + character;
+ var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*[\s\S]*?\*\/|<<0>>/.source, [regularStringOrCharacter]);
+ var roundExpression = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
+
+ // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets
+ var attrTarget = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source;
+ var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [identifier, roundExpression]);
+
+ Prism.languages.insertBefore('csharp', 'class-name', {
+ 'attribute': {
+ // Attributes
+ // [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
+ pattern: re(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [attrTarget, attr]),
lookbehind: true,
+ greedy: true,
inside: {
- punctuation: /\./
+ 'target': {
+ pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
+ alias: 'keyword'
+ },
+ 'attribute-arguments': {
+ pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
+ inside: Prism.languages.csharp
+ },
+ 'class-name': {
+ pattern: RegExp(identifier),
+ inside: {
+ 'punctuation': /\./
+ }
+ },
+ 'punctuation': /[:,]/
}
}
- ],
- 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)f?/i,
- 'operator': />>=?|<<=?|[-=]>|([-+&|?])\1|~|[-+*/%&|^!=<>]=?/,
- 'punctuation': /\?\.?|::|[{}[\];(),.:]/
-});
-
-Prism.languages.insertBefore('csharp', 'class-name', {
- 'generic-method': {
- pattern: /\w+\s*<[^>\r\n]+?>\s*(?=\()/,
- inside: {
- function: /^\w+/,
- 'class-name': {
- pattern: /\b[A-Z]\w*(?:\.\w+)*\b/,
+ });
+
+
+ // string interpolation
+ var formatString = /:[^}\r\n]+/.source;
+ // multi line
+ var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2)
+ var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [mInterpolationRound, formatString]);
+ // single line
+ var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*.*?\*\/|<<0>>|\(<<self>>*\)/.source, [regularStringOrCharacter]), 2)
+ var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [sInterpolationRound, formatString]);
+
+ function createInterpolationInside(interpolation, interpolationRound) {
+ return {
+ 'interpolation': {
+ pattern: re(/([^{](?:\{\{)*)<<0>>/.source, [interpolation]),
+ lookbehind: true,
inside: {
- punctuation: /\./
+ 'format-string': {
+ pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [interpolationRound, formatString]),
+ lookbehind: true,
+ inside: {
+ 'punctuation': /^:/
+ }
+ },
+ 'punctuation': /^\{|\}$/,
+ 'expression': {
+ pattern: /[\s\S]+/,
+ alias: 'language-csharp',
+ inside: Prism.languages.csharp
+ }
}
},
- keyword: Prism.languages.csharp.keyword,
- punctuation: /[<>(),.:]/
- }
- },
- 'preprocessor': {
- pattern: /(^\s*)#.*/m,
- lookbehind: true,
- alias: 'property',
- inside: {
- // highlight preprocessor directives as keywords
- 'directive': {
- pattern: /(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,
+ 'string': /[\s\S]+/
+ };
+ }
+
+ Prism.languages.insertBefore('csharp', 'string', {
+ 'interpolation-string': [
+ {
+ pattern: re(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [mInterpolation]),
+ lookbehind: true,
+ greedy: true,
+ inside: createInterpolationInside(mInterpolation, mInterpolationRound),
+ },
+ {
+ pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [sInterpolation]),
lookbehind: true,
- alias: 'keyword'
+ greedy: true,
+ inside: createInterpolationInside(sInterpolation, sInterpolationRound),
}
- }
- }
-});
+ ]
+ });
+
+}(Prism));
Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
define(["prism/prism","prism/components/prism-css"], function () {
-Prism.languages.css.selector = {
- pattern: Prism.languages.css.selector,
- inside: {
- 'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
- 'pseudo-class': /:[-\w]+/,
- 'class': /\.[-:.\w]+/,
- 'id': /#[-:.\w]+/,
- 'attribute': {
- pattern: /\[(?:[^[\]"']|("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1)*\]/,
- greedy: true,
- inside: {
- 'punctuation': /^\[|\]$/,
- 'case-sensitivity': {
- pattern: /(\s)[si]$/i,
- lookbehind: true,
- alias: 'keyword'
- },
- 'namespace': {
- pattern: /^(\s*)[-*\w\xA0-\uFFFF]*\|(?!=)/,
+(function (Prism) {
+
+ var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
+ var selectorInside;
+
+ Prism.languages.css.selector = {
+ pattern: Prism.languages.css.selector,
+ inside: selectorInside = {
+ 'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
+ 'pseudo-class': /:[-\w]+/,
+ 'class': /\.[-:.\w]+/,
+ 'id': /#[-:.\w]+/,
+ 'attribute': {
+ pattern: RegExp('\\[(?:[^[\\]"\']|' + string.source + ')*\\]'),
+ greedy: true,
+ inside: {
+ 'punctuation': /^\[|\]$/,
+ 'case-sensitivity': {
+ pattern: /(\s)[si]$/i,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+ 'namespace': {
+ pattern: /^(\s*)[-*\w\xA0-\uFFFF]*\|(?!=)/,
+ lookbehind: true,
+ inside: {
+ 'punctuation': /\|$/
+ }
+ },
+ 'attribute': {
+ pattern: /^(\s*)[-\w\xA0-\uFFFF]+/,
+ lookbehind: true
+ },
+ 'value': [
+ string,
+ {
+ pattern: /(=\s*)[-\w\xA0-\uFFFF]+(?=\s*$)/,
+ lookbehind: true
+ }
+ ],
+ 'operator': /[|~*^$]?=/
+ }
+ },
+ 'n-th': [
+ {
+ pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
lookbehind: true,
inside: {
- 'punctuation': /\|$/
+ 'number': /[\dn]+/,
+ 'operator': /[+-]/
}
},
- 'attribute': {
- pattern: /^(\s*)[-\w\xA0-\uFFFF]+/,
+ {
+ pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
lookbehind: true
- },
- 'value': [
- /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
- {
- pattern: /(=\s*)[-\w\xA0-\uFFFF]+(?=\s*$)/,
- lookbehind: true
- }
- ],
- 'operator': /[|~*^$]?=/
- }
+ }
+ ],
+ 'punctuation': /[()]/
+ }
+ };
+
+ Prism.languages.css['atrule'].inside['selector-function-argument'].inside = selectorInside;
+
+ Prism.languages.insertBefore('css', 'property', {
+ 'variable': {
+ pattern: /(^|[^-\w\xA0-\uFFFF])--[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*/i,
+ lookbehind: true
+ }
+ });
+
+ var unit = {
+ pattern: /(\d)(?:%|[a-z]+)/,
+ lookbehind: true
+ };
+ // 123 -123 .123 -.123 12.3 -12.3
+ var number = {
+ pattern: /(^|[^\w.-])-?\d*\.?\d+/,
+ lookbehind: true
+ };
+
+ Prism.languages.insertBefore('css', 'function', {
+ 'operator': {
+ pattern: /(\s)[+\-*\/](?=\s)/,
+ lookbehind: true
+ },
+ // CAREFUL!
+ // Previewers and Inline color use hexcode and color.
+ 'hexcode': {
+ pattern: /\B#(?:[\da-f]{1,2}){3,4}\b/i,
+ alias: 'color'
},
- 'n-th': [
+ 'color': [
+ /\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,
{
- pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
- lookbehind: true,
+ pattern: /\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
inside: {
- 'number': /[\dn]+/,
- 'operator': /[+-]/
+ 'unit': unit,
+ 'number': number,
+ 'function': /[\w-]+(?=\()/,
+ 'punctuation': /[(),]/
}
- },
- {
- pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
- lookbehind: true
}
],
- 'punctuation': /[()]/
- }
-};
-
-Prism.languages.insertBefore('css', 'property', {
- 'variable': {
- pattern: /(^|[^-\w\xA0-\uFFFF])--[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*/i,
- lookbehind: true
- }
-});
+ 'entity': /\\[\da-f]{1,8}/i,
+ 'unit': unit,
+ 'number': number
+ });
-Prism.languages.insertBefore('css', 'function', {
- 'operator': {
- pattern: /(\s)[+\-*\/](?=\s)/,
- lookbehind: true
- },
- 'hexcode': /#[\da-f]{3,8}/i,
- 'entity': /\\[\da-f]{1,8}/i,
- 'unit': {
- pattern: /(\d)(?:%|[a-z]+)/,
- lookbehind: true
- },
- 'number': /-?[\d.]+/
-});
+})(Prism);
return Prism; })
\ No newline at end of file
-define(["prism/prism","prism/components/prism-markup"], function () {
+define(["prism/prism"], function () {
(function (Prism) {
var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
'atrule': {
pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,
inside: {
- 'rule': /@[\w-]+/
+ 'rule': /^@[\w-]+/,
+ 'selector-function-argument': {
+ pattern: /(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,
+ lookbehind: true,
+ alias: 'selector'
+ }
// See rest below
}
},
'url': {
pattern: RegExp('url\\((?:' + string.source + '|[^\n\r()]*)\\)', 'i'),
+ greedy: true,
inside: {
'function': /^url/i,
'punctuation': /^\(|\)$/
define(["prism/prism","prism/components/prism-clike"], function () {
Prism.languages.d = Prism.languages.extend('clike', {
+ 'comment': [
+ {
+ // Shebang
+ pattern: /^\s*#!.+/,
+ greedy: true
+ },
+ {
+ pattern: RegExp(/(^|[^\\])/.source + '(?:' + [
+ // /+ comment +/
+ // Allow one level of nesting
+ /\/\+(?:\/\+[\s\S]*?\+\/|(?!\/\+)[\s\S])*?\+\//.source,
+ // // comment
+ /\/\/.*/.source,
+ // /* comment */
+ /\/\*[\s\S]*?\*\//.source
+ ].join('|') + ')'),
+ lookbehind: true,
+ greedy: true
+ }
+ ],
'string': [
- // r"", x""
- /\b[rx]"(?:\\[\s\S]|[^\\"])*"[cwd]?/,
- // q"[]", q"()", q"<>", q"{}"
- /\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/,
- // q"IDENT
- // ...
- // IDENT"
- /\bq"([_a-zA-Z][_a-zA-Z\d]*)(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\1"/,
- // q"//", q"||", etc.
- /\bq"(.)[\s\S]*?\1"/,
- // Characters
- /'(?:\\'|\\?[^']+)'/,
+ {
+ pattern: RegExp([
+ // r"", x""
+ /\b[rx]"(?:\\[\s\S]|[^\\"])*"[cwd]?/.source,
+
+ // q"[]", q"()", q"<>", q"{}"
+ /\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/.source,
+
+ // q"IDENT
+ // ...
+ // IDENT"
+ /\bq"((?!\d)\w+)$[\s\S]*?^\1"/.source,
+
+ // q"//", q"||", etc.
+ /\bq"(.)[\s\S]*?\2"/.source,
+
+ // Characters
+ // 'a', '\\', '\n', '\xFF', '\377', '\uFFFF', '\U0010FFFF', '\quot'
+ /'(?:\\(?:\W|\w+)|[^\\])'/.source,
- /(["`])(?:\\[\s\S]|(?!\1)[^\\])*\1[cwd]?/
+ /(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source
+ ].join('|'), 'm'),
+ greedy: true
+ },
+ {
+ pattern: /\bq\{(?:\{[^{}]*\}|[^{}])*\}/,
+ greedy: true,
+ alias: 'token-string'
+ }
],
'number': [
'operator': /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/
});
-
-Prism.languages.d.comment = [
- // Shebang
- /^\s*#!.+/,
- // /+ +/
- {
- // Allow one level of nesting
- pattern: /(^|[^\\])\/\+(?:\/\+[\s\S]*?\+\/|[\s\S])*?\+\//,
- lookbehind: true
- }
-].concat(Prism.languages.d.comment);
-
-Prism.languages.insertBefore('d', 'comment', {
- 'token-string': {
- // Allow one level of nesting
- pattern: /\bq\{(?:\{[^}]*\}|[^}])*\}/,
- alias: 'string'
- }
-});
-
Prism.languages.insertBefore('d', 'keyword', {
'property': /\B@\w*/
});
alias: 'variable'
}
});
+
return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.dax = {
+ 'comment': {
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/).*)/,
+ lookbehind: true
+ },
+ 'data-field': {
+ pattern: /'(?:[^']|'')*'(?!')(?:\[[ \w\xA0-\uFFFF]+\])?|\w+\[[ \w\xA0-\uFFFF]+\]/,
+ alias: 'symbol'
+ },
+ 'measure': {
+ pattern: /\[[ \w\xA0-\uFFFF]+\]/,
+ alias: 'constant'
+ },
+ 'string': {
+ pattern: /"(?:[^"]|"")*"(?!")/,
+ greedy: true
+ },
+ 'function': /\b(?:ABS|ACOS|ACOSH|ACOT|ACOTH|ADDCOLUMNS|ADDMISSINGITEMS|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|AND|APPROXIMATEDISTINCTCOUNT|ASIN|ASINH|ATAN|ATANH|AVERAGE|AVERAGEA|AVERAGEX|BETA\.DIST|BETA\.INV|BLANK|CALCULATE|CALCULATETABLE|CALENDAR|CALENDARAUTO|CEILING|CHISQ\.DIST|CHISQ\.DIST\.RT|CHISQ\.INV|CHISQ\.INV\.RT|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|COALESCE|COMBIN|COMBINA|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONFIDENCE\.NORM|CONFIDENCE\.T|CONTAINS|CONTAINSROW|CONTAINSSTRING|CONTAINSSTRINGEXACT|CONVERT|COS|COSH|COT|COTH|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSFILTER|CROSSJOIN|CURRENCY|CURRENTGROUP|CUSTOMDATA|DATATABLE|DATE|DATEADD|DATEDIFF|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|DATEVALUE|DAY|DEGREES|DETAILROWS|DISTINCT|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|DIVIDE|EARLIER|EARLIEST|EDATE|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|EOMONTH|ERROR|EVEN|EXACT|EXCEPT|EXP|EXPON\.DIST|FACT|FALSE|FILTER|FILTERS|FIND|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|FIXED|FLOOR|FORMAT|GCD|GENERATE|GENERATEALL|GENERATESERIES|GEOMEAN|GEOMEANX|GROUPBY|HASONEFILTER|HASONEVALUE|HOUR|IF|IF\.EAGER|IFERROR|IGNORE|INT|INTERSECT|ISBLANK|ISCROSSFILTERED|ISEMPTY|ISERROR|ISEVEN|ISFILTERED|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISO\.CEILING|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|KEEPFILTERS|KEYWORDMATCH|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|LCM|LEFT|LEN|LN|LOG|LOG10|LOOKUPVALUE|LOWER|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MID|MIN|MINA|MINUTE|MINX|MOD|MONTH|MROUND|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|NONVISUAL|NORM\.DIST|NORM\.INV|NORM\.S\.DIST|NORM\.S\.INV|NOT|NOW|ODD|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|OR|PARALLELPERIOD|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|PERCENTILE\.EXC|PERCENTILE\.INC|PERCENTILEX\.EXC|PERCENTILEX\.INC|PERMUT|PI|POISSON\.DIST|POWER|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|PRODUCT|PRODUCTX|QUARTER|QUOTIENT|RADIANS|RAND|RANDBETWEEN|RANK\.EQ|RANKX|RELATED|RELATEDTABLE|REMOVEFILTERS|REPLACE|REPT|RIGHT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|ROUND|ROUNDDOWN|ROUNDUP|ROW|SAMEPERIODLASTYEAR|SAMPLE|SEARCH|SECOND|SELECTCOLUMNS|SELECTEDMEASURE|SELECTEDMEASUREFORMATSTRING|SELECTEDMEASURENAME|SELECTEDVALUE|SIGN|SIN|SINH|SQRT|SQRTPI|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|STDEV\.P|STDEV\.S|STDEVX\.P|STDEVX\.S|SUBSTITUTE|SUBSTITUTEWITHINDEX|SUM|SUMMARIZE|SUMMARIZECOLUMNS|SUMX|SWITCH|T\.DIST|T\.DIST\.2T|T\.DIST\.RT|T\.INV|T\.INV\.2T|TAN|TANH|TIME|TIMEVALUE|TODAY|TOPN|TOPNPERLEVEL|TOPNSKIP|TOTALMTD|TOTALQTD|TOTALYTD|TREATAS|TRIM|TRUE|TRUNC|UNICHAR|UNICODE|UNION|UPPER|USERELATIONSHIP|USERNAME|USEROBJECTID|USERPRINCIPALNAME|UTCNOW|UTCTODAY|VALUE|VALUES|VAR\.P|VAR\.S|VARX\.P|VARX\.S|WEEKDAY|WEEKNUM|XIRR|XNPV|YEAR|YEARFRAC)(?=\s*\()/i,
+ 'keyword': /\b(?:DEFINE|MEASURE|EVALUATE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i,
+ 'boolean': {
+ pattern: /\b(?:TRUE|FALSE|NULL)\b/i,
+ alias: 'constant'
+ },
+ 'number': /\b\d+\.?\d*|\B\.\d+\b/i,
+ 'operator': /:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i,
+ 'punctuation': /[;\[\](){}`,.]/
+};
+
+return Prism; })
\ No newline at end of file
define(["prism/prism"], function () {
-Prism.languages.diff = {
- 'coord': [
- // Match all kinds of coord lines (prefixed by "+++", "---" or "***").
- /^(?:\*{3}|-{3}|\+{3}).*$/m,
- // Match "@@ ... @@" coord lines in unified diff.
- /^@@.*@@$/m,
- // Match coord lines in normal diff (starts with a number).
- /^\d+.*$/m
- ],
-
- // Match inserted and deleted lines. Support both +/- and >/< styles.
- 'deleted': /^[-<].*$/m,
- 'inserted': /^[+>].*$/m,
-
- // Match "different" lines (prefixed with "!") in context diff.
- 'diff': {
- 'pattern': /^!(?!!).+$/m,
- 'alias': 'important'
- }
-};
+(function (Prism) {
+
+ Prism.languages.diff = {
+ 'coord': [
+ // Match all kinds of coord lines (prefixed by "+++", "---" or "***").
+ /^(?:\*{3}|-{3}|\+{3}).*$/m,
+ // Match "@@ ... @@" coord lines in unified diff.
+ /^@@.*@@$/m,
+ // Match coord lines in normal diff (starts with a number).
+ /^\d+.*$/m
+ ]
+
+ // deleted, inserted, unchanged, diff
+ };
+
+ /**
+ * A map from the name of a block to its line prefix.
+ *
+ * @type {Object<string, string>}
+ */
+ var PREFIXES = {
+ 'deleted-sign': '-',
+ 'deleted-arrow': '<',
+ 'inserted-sign': '+',
+ 'inserted-arrow': '>',
+ 'unchanged': ' ',
+ 'diff': '!',
+ };
+
+ // add a token for each prefix
+ Object.keys(PREFIXES).forEach(function (name) {
+ var prefix = PREFIXES[name];
+
+ var alias = [];
+ if (!/^\w+$/.test(name)) { // "deleted-sign" -> "deleted"
+ alias.push(/\w+/.exec(name)[0]);
+ }
+ if (name === "diff") {
+ alias.push("bold");
+ }
+
+ Prism.languages.diff[name] = {
+ // pattern: /^(?:[_].*(?:\r\n?|\n|(?![\s\S])))+/m
+ pattern: RegExp('^(?:[' + prefix + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'),
+ alias: alias
+ };
+ });
+
+ // make prefixes available to Diff plugin
+ Object.defineProperty(Prism.languages.diff, 'PREFIXES', {
+ value: PREFIXES
+ });
+
+}(Prism));
return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages['dns-zone-file'] = {
+ 'comment': /;.*/,
+ 'string': {
+ pattern: /"(?:\\.|[^"\\\r\n])*"/,
+ greedy: true
+ },
+ 'variable': [
+ {
+ pattern: /(^\$ORIGIN[ \t]+)\S+/m,
+ lookbehind: true,
+ },
+ {
+ pattern: /(^|\s)@(?=\s|$)/,
+ lookbehind: true,
+ }
+ ],
+ 'keyword': /^\$(?:ORIGIN|INCLUDE|TTL)(?=\s|$)/m,
+ 'class': {
+ // https://tools.ietf.org/html/rfc1035#page-13
+ pattern: /(^|\s)(?:IN|CH|CS|HS)(?=\s|$)/,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+ 'type': {
+ // https://en.wikipedia.org/wiki/List_of_DNS_record_types
+ pattern: /(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+ 'punctuation': /[()]/
+};
+
+Prism.languages['dns-zone'] = Prism.languages['dns-zone-file']
+
+return Prism; })
\ No newline at end of file
alias: 'symbol'
},
// Look-ahead prevents bad highlighting of the :: operator
- 'attr-name': /\w+:(?!:)/,
+ 'attr-name': /\w+\??:(?!:)/,
'capture': {
// Look-behind prevents bad highlighting of the && operator
pattern: /(^|[^&])&(?:[^&\s\d()][^\s()]*|(?=\())/,
// The imported or hidden names are not included in this import
// statement. This is because we want to highlight those exactly like
// we do for the names in the program.
- pattern: /^\s*import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+([A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,
+ pattern: /^\s*import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,
inside: {
keyword: /\b(?:import|as|exposing)\b/
}
--- /dev/null
+define(["prism/prism","prism/components/prism-lua","prism/components/prism-markup-templating"], function () {
+(function (Prism) {
+
+ Prism.languages.etlua = {
+ 'delimiter': {
+ pattern: /^<%[-=]?|-?%>$/,
+ alias: 'punctuation'
+ },
+ 'language-lua': {
+ pattern: /[\s\S]+/,
+ inside: Prism.languages.lua
+ }
+ };
+
+ Prism.hooks.add('before-tokenize', function (env) {
+ var pattern = /<%[\s\S]+?%>/g;
+ Prism.languages['markup-templating'].buildPlaceholders(env, 'etlua', pattern);
+ });
+
+ Prism.hooks.add('after-tokenize', function (env) {
+ Prism.languages['markup-templating'].tokenizePlaceholders(env, 'etlua');
+ });
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages['excel-formula'] = {
+ 'comment': {
+ pattern: /(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i,
+ lookbehind: true,
+ greedy: true
+ },
+ 'string': {
+ pattern: /"(?:[^"]|"")*"(?!")/,
+ greedy: true
+ },
+ 'reference': {
+ // https://www.ablebits.com/office-addins-blog/2015/12/08/excel-reference-another-sheet-workbook/
+
+ // Sales!B2
+ // 'Winter sales'!B2
+ // [Sales.xlsx]Jan!B2:B5
+ // D:\Reports\[Sales.xlsx]Jan!B2:B5
+ // '[Sales.xlsx]Jan sales'!B2:B5
+ // 'D:\Reports\[Sales.xlsx]Jan sales'!B2:B5
+
+ pattern: /(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/,
+ greedy: true,
+ alias: 'string',
+ inside: {
+ 'operator': /!$/,
+ 'punctuation': /'/,
+ 'sheet': {
+ pattern: /[^[\]]+$/,
+ alias: 'function'
+ },
+ 'file': {
+ pattern: /\[[^[\]]+\]$/,
+ inside: {
+ 'punctuation': /[[\]]/
+ }
+ },
+ 'path': /[\s\S]+/
+ }
+ },
+ 'function-name': {
+ pattern: /[A-Z]\w*(?=\()/i,
+ alias: 'keyword'
+ },
+ 'range': {
+ pattern: /\$?(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)/i,
+ alias: 'property',
+ inside: {
+ 'operator': /:/,
+ 'cell': /\$?[A-Z]+\$?\d+/i,
+ 'column': /\$?[A-Z]+/i,
+ 'row': /\$?\d+/
+ }
+ },
+ 'cell': {
+ // Excel is case insensitive, so the string "foo1" could be either a variable or a cell.
+ // To combat this, we match cells case insensitive, if the contain at least one "$", and case sensitive otherwise.
+ pattern: /[A-Z]+\d+|\$[A-Za-z]+\$?\d+|[A-Za-z]+\$\d+/,
+ alias: 'property'
+ },
+ 'number': /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,
+ 'boolean': /\b(?:TRUE|FALSE)\b/i,
+ 'operator': /[-+*/^%=&,]|<[=>]?|>=?/,
+ 'punctuation': /[[\]();{}|]/
+};
+
+Prism.languages['xlsx'] = Prism.languages['xls'] = Prism.languages['excel-formula'];
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+(function (Prism) {
+
+ var comment_inside = {
+ 'function': /\b(?:TODOS?|FIX(?:MES?)?|NOTES?|BUGS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/
+ };
+ var string_inside = {
+ 'number': /\\[^\s']|%\w/
+ };
+
+ var factor = {
+ 'comment': [
+ {
+ // ! single-line exclamation point comments with whitespace after/around the !
+ pattern: /(^|\s)(?:! .*|!$)/,
+ lookbehind: true,
+ inside: comment_inside
+ },
+
+ /* from basis/multiline: */
+ {
+ // /* comment */, /* comment*/
+ pattern: /(^|\s)\/\*\s[\s\S]*?\*\/(?=\s|$)/,
+ lookbehind: true,
+ greedy: true,
+ inside: comment_inside
+ },
+ {
+ // ![[ comment ]] , ![===[ comment]===]
+ pattern: /(^|\s)!\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,
+ lookbehind: true,
+ greedy: true,
+ inside: comment_inside
+ }
+ ],
+
+ 'number': [
+ {
+ // basic base 10 integers 9, -9
+ pattern: /(^|\s)[+-]?\d+(?=\s|$)/,
+ lookbehind: true
+ },
+ {
+ // base prefix integers 0b010 0o70 0xad 0d10 0XAD -0xa9
+ pattern: /(^|\s)[+-]?0(?:b[01]+|o[0-7]+|d\d+|x[\dA-F]+)(?=\s|$)/i,
+ lookbehind: true
+ },
+ {
+ // fractional ratios 1/5 -1/5 and the literal float approximations 1/5. -1/5.
+ pattern: /(^|\s)[+-]?\d+\/\d+\.?(?=\s|$)/,
+ lookbehind: true
+ },
+ {
+ // positive mixed numbers 23+1/5 +23+1/5
+ pattern: /(^|\s)\+?\d+\+\d+\/\d+(?=\s|$)/,
+ lookbehind: true
+ },
+ {
+ // negative mixed numbers -23-1/5
+ pattern: /(^|\s)-\d+-\d+\/\d+(?=\s|$)/,
+ lookbehind: true
+ },
+ {
+ // basic decimal floats -0.01 0. .0 .1 -.1 -1. -12.13 +12.13
+ // and scientific notation with base 10 exponents 3e4 3e-4 .3e-4
+ pattern: /(^|\s)[+-]?(?:\d*\.\d+|\d+\.\d*|\d+)(?:e[+-]?\d+)?(?=\s|$)/i,
+ lookbehind: true
+ },
+ {
+ // NAN literal syntax NAN: 80000deadbeef, NAN: a
+ pattern: /(^|\s)NAN:\s+[\da-fA-F]+(?=\s|$)/,
+ lookbehind: true
+ },
+ {
+ /*
+ base prefix floats 0x1.0p3 (8.0) 0b1.010p2 (5.0) 0x1.p1 0b1.11111111p11111...
+ "The normalized hex form ±0x1.MMMMMMMMMMMMM[pP]±EEEE allows any floating-point number to be specified precisely.
+ The values of MMMMMMMMMMMMM and EEEE map directly to the mantissa and exponent fields of the binary IEEE 754 representation."
+ <https://docs.factorcode.org/content/article-syntax-floats.html>
+ */
+ pattern: /(^|\s)[+-]?0(?:b1\.[01]*|o1\.[0-7]*|d1\.\d*|x1\.[\dA-F]*)p\d+(?=\s|$)/i,
+ lookbehind: true
+ }
+ ],
+
+ // R/ regexp?\/\\/
+ 'regexp': {
+ pattern: /(^|\s)R\/\s+(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/,
+ lookbehind: true,
+ alias: 'number',
+ inside: {
+ 'variable': /\\\S/,
+ 'keyword': /[+?*\[\]^$(){}.|]/,
+ 'operator': {
+ pattern: /(\/)[idmsr]+(?:-[idmsr]+)?/,
+ lookbehind: true
+ }
+ }
+ },
+
+ 'boolean': {
+ pattern: /(^|\s)[tf](?=\s|$)/,
+ lookbehind: true
+ },
+
+ // SBUF" asd", URL" ://...", P" /etc/"
+ 'custom-string': {
+ pattern: /(^|\s)[A-Z0-9\-]+"\s(?:\\\S|[^"\\])*"/,
+ lookbehind: true,
+ greedy: true,
+ alias: 'string',
+ inside: {
+ 'number': /\\\S|%\w|\//
+ }
+ },
+
+ 'multiline-string': [
+ {
+ // STRING: name \n content \n ; -> CONSTANT: name "content" (symbol)
+ pattern: /(^|\s)STRING:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*;(?=\s|$)/,
+ lookbehind: true,
+ greedy: true,
+ alias: 'string',
+ inside: {
+ 'number': string_inside.number,
+ // trailing semicolon on its own line
+ 'semicolon-or-setlocal': {
+ pattern: /((?:\n|\r\n)\s*);(?=\s|$)/,
+ lookbehind: true,
+ alias: 'function'
+ }
+ }
+ },
+ {
+ // HEREDOC: marker \n content \n marker ; -> "content" (immediate)
+ pattern: /(^|\s)HEREDOC:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*\S+(?=\s|$)/,
+ lookbehind: true,
+ greedy: true,
+ alias: 'string',
+ inside: string_inside
+ },
+ {
+ // [[ string ]], [==[ string]==]
+ pattern: /(^|\s)\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,
+ lookbehind: true,
+ greedy: true,
+ alias: 'string',
+ inside: string_inside
+ }
+ ],
+
+ 'special-using': {
+ pattern: /(^|\s)USING:(?:\s\S+)*(?=\s+;(?:\s|$))/,
+ lookbehind: true,
+ alias: 'function',
+ inside: {
+ // this is essentially a regex for vocab names, which i don't want to specify
+ // but the USING: gets picked up as a vocab name
+ 'string': {
+ pattern: /(\s)[^:\s]+/,
+ lookbehind: true
+ }
+ }
+ },
+
+ /* this description of stack effect literal syntax is not complete and not as specific as theoretically possible
+ trying to do better is more work and regex-computation-time than it's worth though.
+ - we'd like to have the "delimiter" parts of the stack effect [ (, --, and ) ] be a different (less-important or comment-like) colour to the stack effect contents
+ - we'd like if nested stack effects were treated as such rather than just appearing flat (with `inside`)
+ - we'd like if the following variable name conventions were recognised specifically:
+ special row variables = ..a b..
+ type and stack effect annotations end with a colon = ( quot: ( a: ( -- ) -- b ) -- x ), ( x: number -- )
+ word throws unconditional error = *
+ any other word-like variable name = a ? q' etc
+
+ https://docs.factorcode.org/content/article-effects.html
+
+ these are pretty complicated to highlight properly without a real parser, and therefore out of scope
+ the old pattern, which may be later useful, was: (^|\s)(?:call|execute|eval)?\((?:\s+[^"\r\n\t ]\S*)*?\s+--(?:\s+[^"\n\t ]\S*)*?\s+\)(?=\s|$)
+ */
+
+ // current solution is not great
+ 'stack-effect-delimiter': [
+ {
+ // opening parenthesis
+ pattern: /(^|\s)(?:call|execute|eval)?\((?=\s)/,
+ lookbehind: true,
+ alias: 'operator'
+ },
+ {
+ // middle --
+ pattern: /(\s)--(?=\s)/,
+ lookbehind: true,
+ alias: 'operator'
+ },
+ {
+ // closing parenthesis
+ pattern: /(\s)\)(?=\s|$)/,
+ lookbehind: true,
+ alias: 'operator'
+ }
+ ],
+
+ 'combinators': {
+ pattern: null,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+
+ 'kernel-builtin': {
+ pattern: null,
+ lookbehind: true,
+ alias: 'variable'
+ },
+
+ 'sequences-builtin': {
+ pattern: null,
+ lookbehind: true,
+ alias: 'variable'
+ },
+
+ 'math-builtin': {
+ pattern: null,
+ lookbehind: true,
+ alias: 'variable'
+ },
+
+ 'constructor-word': {
+ // <array> but not <=>
+ pattern: /(^|\s)<(?!=+>|-+>)\S+>(?=\s|$)/,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+
+ 'other-builtin-syntax': {
+ pattern: null,
+ lookbehind: true,
+ alias: 'operator'
+ },
+
+ /*
+ full list of supported word naming conventions: (the convention appears outside of the [brackets])
+ set-[x]
+ change-[x]
+ with-[x]
+ new-[x]
+ >[string]
+ [base]>
+ [string]>[number]
+ +[symbol]+
+ [boolean-word]?
+ ?[of]
+ [slot-reader]>>
+ >>[slot-setter]
+ [slot-writer]<<
+ ([implementation-detail])
+ [mutater]!
+ [variant]*
+ [prettyprint].
+ $[help-markup]
+
+ <constructors>, SYNTAX:, etc are supported by their own patterns.
+
+ `with` and `new` from `kernel` are their own builtins.
+
+ see <https://docs.factorcode.org/content/article-conventions.html>
+ */
+ 'conventionally-named-word': {
+ pattern: /(^|\s)(?!")(?:(?:set|change|with|new)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+
+ 'colon-syntax': {
+ pattern: /(^|\s)(?:[A-Z0-9\-]+#?)?:{1,2}\s+(?:;\S+|(?!;)\S+)(?=\s|$)/,
+ lookbehind: true,
+ greedy: true,
+ alias: 'function'
+ },
+
+ 'semicolon-or-setlocal': {
+ pattern: /(\s)(?:;|:>)(?=\s|$)/,
+ lookbehind: true,
+ alias: 'function'
+ },
+
+ // do not highlight leading } or trailing X{ at the begin/end of the file as it's invalid syntax
+ 'curly-brace-literal-delimiter': [
+ {
+ // opening
+ pattern: /(^|\s)[a-z]*\{(?=\s)/i,
+ lookbehind: true,
+ alias: 'operator'
+ },
+ {
+ // closing
+ pattern: /(\s)\}(?=\s|$)/,
+ lookbehind: true,
+ alias: 'operator'
+ },
+
+ ],
+
+ // do not highlight leading ] or trailing [ at the begin/end of the file as it's invalid syntax
+ 'quotation-delimiter': [
+ {
+ // opening
+ pattern: /(^|\s)\[(?=\s)/,
+ lookbehind: true,
+ alias: 'operator'
+ },
+ {
+ // closing
+ pattern: /(\s)\](?=\s|$)/,
+ lookbehind: true,
+ alias: 'operator'
+ },
+ ],
+
+ 'normal-word': {
+ pattern: /(^|\s)[^"\s]\S*(?=\s|$)/,
+ lookbehind: true
+ },
+
+ /*
+ basic first-class string "a"
+ with escaped double-quote "a\""
+ escaped backslash "\\"
+ and general escapes since Factor has so many "\N"
+
+ syntax that works in the reference implementation that isn't fully
+ supported because it's an implementation detail:
+ "string 1""string 2" -> 2 strings (works anyway)
+ "string"5 -> string, 5
+ "string"[ ] -> string, quotation
+ { "a"} -> array<string>
+
+ the rest of those examples all properly recognise the string, but not
+ the other object (number, quotation, etc)
+ this is fine for a regex-only implementation.
+ */
+ 'string': {
+ pattern: /"(?:\\\S|[^"\\])*"/,
+ greedy: true,
+ inside: string_inside
+ }
+ };
+
+ var escape = function (str) {
+ return (str+'').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1');
+ };
+
+ var arrToWordsRegExp = function (arr) {
+ return new RegExp(
+ '(^|\\s)(?:' + arr.map(escape).join('|') + ')(?=\\s|$)'
+ );
+ };
+
+ var builtins = {
+ 'kernel-builtin': [
+ 'or', '2nipd', '4drop', 'tuck', 'wrapper', 'nip', 'wrapper?', 'callstack>array', 'die', 'dupd', 'callstack', 'callstack?', '3dup', 'hashcode', 'pick', '4nip', 'build', '>boolean', 'nipd', 'clone', '5nip', 'eq?', '?', '=', 'swapd', '2over', 'clear', '2dup', 'get-retainstack', 'not', 'tuple?', 'dup', '3nipd', 'call', '-rotd', 'object', 'drop', 'assert=', 'assert?', '-rot', 'execute', 'boa', 'get-callstack', 'curried?', '3drop', 'pickd', 'overd', 'over', 'roll', '3nip', 'swap', 'and', '2nip', 'rotd', 'throw', '(clone)', 'hashcode*', 'spin', 'reach', '4dup', 'equal?', 'get-datastack', 'assert', '2drop', '<wrapper>', 'boolean?', 'identity-hashcode', 'identity-tuple?', 'null', 'composed?', 'new', '5drop', 'rot', '-roll', 'xor', 'identity-tuple', 'boolean'
+ ],
+ 'other-builtin-syntax': [
+ // syntax
+ '=======', 'recursive', 'flushable', '>>', '<<<<<<', 'M\\', 'B', 'PRIVATE>', '\\', '======', 'final', 'inline', 'delimiter', 'deprecated', '<PRIVATE', '>>>>>>', '<<<<<<<', 'parse-complex', 'malformed-complex', 'read-only', '>>>>>>>', 'call-next-method', '<<', 'foldable',
+ // literals
+ '$', '$[', '${'
+ ],
+ 'sequences-builtin': [
+ 'member-eq?', 'mismatch', 'append', 'assert-sequence=', 'longer', 'repetition', 'clone-like', '3sequence', 'assert-sequence?', 'last-index-from', 'reversed', 'index-from', 'cut*', 'pad-tail', 'join-as', 'remove-eq!', 'concat-as', 'but-last', 'snip', 'nths', 'nth', 'sequence', 'longest', 'slice?', '<slice>', 'remove-nth', 'tail-slice', 'empty?', 'tail*', 'member?', 'virtual-sequence?', 'set-length', 'drop-prefix', 'iota', 'unclip', 'bounds-error?', 'unclip-last-slice', 'non-negative-integer-expected', 'non-negative-integer-expected?', 'midpoint@', 'longer?', '?set-nth', '?first', 'rest-slice', 'prepend-as', 'prepend', 'fourth', 'sift', 'subseq-start', 'new-sequence', '?last', 'like', 'first4', '1sequence', 'reverse', 'slice', 'virtual@', 'repetition?', 'set-last', 'index', '4sequence', 'max-length', 'set-second', 'immutable-sequence', 'first2', 'first3', 'supremum', 'unclip-slice', 'suffix!', 'insert-nth', 'tail', '3append', 'short', 'suffix', 'concat', 'flip', 'immutable?', 'reverse!', '2sequence', 'sum', 'delete-all', 'indices', 'snip-slice', '<iota>', 'check-slice', 'sequence?', 'head', 'append-as', 'halves', 'sequence=', 'collapse-slice', '?second', 'slice-error?', 'product', 'bounds-check?', 'bounds-check', 'immutable', 'virtual-exemplar', 'harvest', 'remove', 'pad-head', 'last', 'set-fourth', 'cartesian-product', 'remove-eq', 'shorten', 'shorter', 'reversed?', 'shorter?', 'shortest', 'head-slice', 'pop*', 'tail-slice*', 'but-last-slice', 'iota?', 'append!', 'cut-slice', 'new-resizable', 'head-slice*', 'sequence-hashcode', 'pop', 'set-nth', '?nth', 'second', 'join', 'immutable-sequence?', '<reversed>', '3append-as', 'virtual-sequence', 'subseq?', 'remove-nth!', 'length', 'last-index', 'lengthen', 'assert-sequence', 'copy', 'move', 'third', 'first', 'tail?', 'set-first', 'prefix', 'bounds-error', '<repetition>', 'exchange', 'surround', 'cut', 'min-length', 'set-third', 'push-all', 'head?', 'subseq-start-from', 'delete-slice', 'rest', 'sum-lengths', 'head*', 'infimum', 'remove!', 'glue', 'slice-error', 'subseq', 'push', 'replace-slice', 'subseq-as', 'unclip-last'
+ ],
+ 'math-builtin': [
+ 'number=', 'next-power-of-2', '?1+', 'fp-special?', 'imaginary-part', 'float>bits', 'number?', 'fp-infinity?', 'bignum?', 'fp-snan?', 'denominator', 'gcd', '*', '+', 'fp-bitwise=', '-', 'u>=', '/', '>=', 'bitand', 'power-of-2?', 'log2-expects-positive', 'neg?', '<', 'log2', '>', 'integer?', 'number', 'bits>double', '2/', 'zero?', 'bits>float', 'float?', 'shift', 'ratio?', 'rect>', 'even?', 'ratio', 'fp-sign', 'bitnot', '>fixnum', 'complex?', '/i', 'integer>fixnum', '/f', 'sgn', '>bignum', 'next-float', 'u<', 'u>', 'mod', 'recip', 'rational', '>float', '2^', 'integer', 'fixnum?', 'neg', 'fixnum', 'sq', 'bignum', '>rect', 'bit?', 'fp-qnan?', 'simple-gcd', 'complex', '<fp-nan>', 'real', '>fraction', 'double>bits', 'bitor', 'rem', 'fp-nan-payload', 'real-part', 'log2-expects-positive?', 'prev-float', 'align', 'unordered?', 'float', 'fp-nan?', 'abs', 'bitxor', 'integer>fixnum-strict', 'u<=', 'odd?', '<=', '/mod', '>integer', 'real?', 'rational?', 'numerator'
+ ]
+ // that's all for now
+ };
+
+ Object.keys(builtins).forEach(function (k) {
+ factor[k].pattern = arrToWordsRegExp( builtins[k] );
+ });
+
+ var combinators = [
+ // kernel
+ '2bi', 'while', '2tri', 'bi*', '4dip', 'both?', 'same?', 'tri@', 'curry', 'prepose', '3bi', '?if', 'tri*', '2keep', '3keep', 'curried', '2keepd', 'when', '2bi*', '2tri*', '4keep', 'bi@', 'keepdd', 'do', 'unless*', 'tri-curry', 'if*', 'loop', 'bi-curry*', 'when*', '2bi@', '2tri@', 'with', '2with', 'either?', 'bi', 'until', '3dip', '3curry', 'tri-curry*', 'tri-curry@', 'bi-curry', 'keepd', 'compose', '2dip', 'if', '3tri', 'unless', 'tuple', 'keep', '2curry', 'tri', 'most', 'while*', 'dip', 'composed', 'bi-curry@',
+ // sequences
+ 'find-last-from', 'trim-head-slice', 'map-as', 'each-from', 'none?', 'trim-tail', 'partition', 'if-empty', 'accumulate*', 'reject!', 'find-from', 'accumulate-as', 'collector-for-as', 'reject', 'map', 'map-sum', 'accumulate!', '2each-from', 'follow', 'supremum-by', 'map!', 'unless-empty', 'collector', 'padding', 'reduce-index', 'replicate-as', 'infimum-by', 'trim-tail-slice', 'count', 'find-index', 'filter', 'accumulate*!', 'reject-as', 'map-integers', 'map-find', 'reduce', 'selector', 'interleave', '2map', 'filter-as', 'binary-reduce', 'map-index-as', 'find', 'produce', 'filter!', 'replicate', 'cartesian-map', 'cartesian-each', 'find-index-from', 'map-find-last', '3map-as', '3map', 'find-last', 'selector-as', '2map-as', '2map-reduce', 'accumulate', 'each', 'each-index', 'accumulate*-as', 'when-empty', 'all?', 'collector-as', 'push-either', 'new-like', 'collector-for', '2selector', 'push-if', '2all?', 'map-reduce', '3each', 'any?', 'trim-slice', '2reduce', 'change-nth', 'produce-as', '2each', 'trim', 'trim-head', 'cartesian-find', 'map-index',
+ // math
+ 'if-zero', 'each-integer', 'unless-zero', '(find-integer)', 'when-zero', 'find-last-integer', '(all-integers?)', 'times', '(each-integer)', 'find-integer', 'all-integers?',
+ // math.combinators
+ 'unless-negative', 'if-positive', 'when-positive', 'when-negative', 'unless-positive', 'if-negative',
+ // combinators
+ 'case', '2cleave', 'cond>quot', 'case>quot', '3cleave', 'wrong-values', 'to-fixed-point', 'alist>quot', 'cond', 'cleave', 'call-effect', 'recursive-hashcode', 'spread', 'deep-spread>quot',
+ // combinators.short-circuit
+ '2||', '0||', 'n||', '0&&', '2&&', '3||', '1||', '1&&', 'n&&', '3&&',
+ // combinators.smart
+ 'smart-unless*', 'keep-inputs', 'reduce-outputs', 'smart-when*', 'cleave>array', 'smart-with', 'smart-apply', 'smart-if', 'inputs/outputs', 'output>sequence-n', 'map-outputs', 'map-reduce-outputs', 'dropping', 'output>array', 'smart-map-reduce', 'smart-2map-reduce', 'output>array-n', 'nullary', 'input<sequence', 'append-outputs', 'drop-inputs', 'inputs', 'smart-2reduce', 'drop-outputs', 'smart-reduce', 'preserving', 'smart-when', 'outputs', 'append-outputs-as', 'smart-unless', 'smart-if*', 'sum-outputs', 'input<sequence-unsafe', 'output>sequence',
+ // tafn
+ ];
+
+ factor.combinators.pattern = arrToWordsRegExp(combinators);
+
+ Prism.languages.factor = factor;
+
+})(Prism);
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism","prism/components/prism-clike"], function () {
+Prism.languages['firestore-security-rules'] = Prism.languages.extend('clike', {
+ 'comment': /\/\/.*/,
+ 'keyword': /\b(?:allow|function|if|match|null|return|rules_version|service)\b/,
+ 'operator': /&&|\|\||[<>!=]=?|[-+*/%=]|\b(?:in|is)\b/,
+});
+
+delete Prism.languages['firestore-security-rules']['class-name'];
+
+Prism.languages.insertBefore('firestore-security-rules', 'keyword', {
+ 'path': {
+ pattern: /(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,
+ lookbehind: true,
+ greedy: true,
+ inside: {
+ 'variable': {
+ pattern: /\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,
+ inside: {
+ 'operator': /=/,
+ 'keyword': /\*\*/,
+ 'punctuation': /[.$(){}]/
+ }
+ },
+ 'punctuation': /[/]/
+ }
+ },
+ 'method': {
+ // to make the pattern shorter, the actual method names are omitted
+ pattern: /(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,
+ lookbehind: true,
+ alias: 'builtin',
+ inside: {
+ 'punctuation': /,/
+ }
+ },
+});
+
+return Prism; })
\ No newline at end of file
}
],
'string': {
- pattern: /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?|'(?:[^\\']|\\.)'B?/,
+ pattern: /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?|'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/,
greedy: true
},
'class-name': {
'punctuation': /\./
}
},
- 'keyword': /\b(?:let|return|use|yield)(?:!\B|\b)|\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,
+ 'keyword': /\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,
'number': [
/\b0x[\da-fA-F]+(?:un|lf|LF)?\b/,
/\b0b[01]+(?:y|uy)?\b/,
--- /dev/null
+define(["prism/prism","prism/components/prism-markup-templating"], function () {
+(function (Prism) {
+
+ // https://freemarker.apache.org/docs/dgui_template_exp.html
+
+ // FTL expression with 4 levels of nesting supported
+ var FTL_EXPR = /(?!<#--)[^()"']|\((?:<expr>)*\)|<#--[\s\S]*?-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/.source;
+ for (var i = 0; i < 2; i++) {
+ FTL_EXPR = FTL_EXPR.replace(/<expr>/g, function () { return FTL_EXPR; });
+ }
+ FTL_EXPR = FTL_EXPR.replace(/<expr>/g, '[^\s\S]');
+
+ var ftl = {
+ 'comment': /<#--[\s\S]*?-->/,
+ 'string': [
+ {
+ // raw string
+ pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/,
+ greedy: true
+ },
+ {
+ pattern: RegExp(/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:<expr>)*?\})*\1/.source.replace(/<expr>/g, function () { return FTL_EXPR; })),
+ greedy: true,
+ inside: {
+ 'interpolation': {
+ pattern: RegExp(/((?:^|[^\\])(?:\\\\)*)\$\{(?:<expr>)*?\}/.source.replace(/<expr>/g, function () { return FTL_EXPR; })),
+ lookbehind: true,
+ inside: {
+ 'interpolation-punctuation': {
+ pattern: /^\$\{|\}$/,
+ alias: 'punctuation'
+ },
+ rest: null
+ }
+ }
+ }
+ }
+ ],
+ 'keyword': /\b(?:as)\b/,
+ 'boolean': /\b(?:true|false)\b/,
+ 'builtin-function': {
+ pattern: /((?:^|[^?])\?\s*)\w+/,
+ lookbehind: true,
+ alias: 'function'
+ },
+ 'function': /\w+(?=\s*\()/,
+ 'number': /\d+(?:\.\d+)?/,
+ 'operator': /\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,
+ 'punctuation': /[,;.:()[\]{}]/
+ };
+
+ ftl.string[1].inside.interpolation.inside.rest = ftl;
+
+ Prism.languages.ftl = {
+ 'ftl-comment': {
+ // the pattern is shortened to be more efficient
+ pattern: /^<#--[\s\S]*/,
+ alias: 'comment'
+ },
+ 'ftl-directive': {
+ pattern: /^<[\s\S]+>$/,
+ inside: {
+ 'directive': {
+ pattern: /(^<\/?)[#@][a-z]\w*/i,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+ 'punctuation': /^<\/?|\/?>$/,
+ 'content': {
+ pattern: /[\s\S]*\S[\s\S]*/,
+ alias: 'ftl',
+ inside: ftl
+ }
+ }
+ },
+ 'ftl-interpolation': {
+ pattern: /^\$\{[\s\S]*\}$/,
+ inside: {
+ 'punctuation': /^\$\{|\}$/,
+ 'content': {
+ pattern: /[\s\S]*\S[\s\S]*/,
+ alias: 'ftl',
+ inside: ftl
+ }
+ }
+ }
+ };
+
+ Prism.hooks.add('before-tokenize', function (env) {
+ var pattern = RegExp(/<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:<expr>)*?>|\$\{(?:<expr>)*?\}/.source.replace(/<expr>/g, function () { return FTL_EXPR; }), 'gi');
+ Prism.languages['markup-templating'].buildPlaceholders(env, 'ftl', pattern);
+ });
+
+ Prism.hooks.add('after-tokenize', function (env) {
+ Prism.languages['markup-templating'].tokenizePlaceholders(env, 'ftl');
+ });
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.gdscript = {
+ 'comment': /#.*/,
+ 'string': {
+ pattern: /@?(?:("|')(?:(?!\1)[^\n\\]|\\[\s\S])*\1(?!"|')|"""(?:[^\\]|\\[\s\S])*?""")/,
+ greedy: true
+ },
+ 'class-name': {
+ // class_name Foo, extends Bar, class InnerClass
+ // export(int) var baz, export(int, 0) var i
+ // as Node
+ // const FOO: int = 9, var bar: bool = true
+ // func add(reference: Item, amount: int) -> Item:
+ pattern: /(^(?:class_name|class|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m,
+ lookbehind: true
+ },
+ 'keyword': /\b(?:and|as|assert|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|if|in|is|master|mastersync|match|not|null|onready|or|pass|preload|puppet|puppetsync|remote|remotesync|return|self|setget|signal|static|tool|var|while|yield)\b/,
+ 'function': /[a-z_]\w*(?=[ \t]*\()/i,
+ 'variable': /\$\w+/,
+ 'number': [
+ /\b0b[01_]+\b|\b0x[\da-fA-F_]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.[\d_]+)(?:e[+-]?[\d_]+)?\b/,
+ /\b(?:INF|NAN|PI|TAU)\b/
+ ],
+ 'constant': /\b[A-Z][A-Z_\d]*\b/,
+ 'boolean': /\b(?:false|true)\b/,
+ 'operator': /->|:=|&&|\|\||<<|>>|[-+*/%&|!<>=]=?|[~^]/,
+ 'punctuation': /[.:,;()[\]{}]/
+};
+
+return Prism; })
\ No newline at end of file
define(["prism/prism"], function () {
-Prism.languages.gherkin = {
- 'pystring': {
- pattern: /("""|''')[\s\S]+?\1/,
- alias: 'string'
- },
- 'comment': {
- pattern: /((?:^|\r?\n|\r)[ \t]*)#.*/,
- lookbehind: true
- },
- 'tag': {
- pattern: /((?:^|\r?\n|\r)[ \t]*)@\S*/,
- lookbehind: true
- },
- 'feature': {
- pattern: /((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:]+(?:\r?\n|\r|$))*/,
- lookbehind: true,
- inside: {
- 'important': {
- pattern: /(:)[^\r\n]+/,
- lookbehind: true
- },
- keyword: /[^:\r\n]+:/
- }
- },
- 'scenario': {
- pattern: /((?:^|\r?\n|\r)[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo\-ho\-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/,
- lookbehind: true,
- inside: {
- 'important': {
- pattern: /(:)[^\r\n]*/,
- lookbehind: true
- },
- keyword: /[^:\r\n]+:/
- }
- },
- 'table-body': {
- // Look-behind is used to skip the table head, which has the same format as any table row
- pattern: /((?:\r?\n|\r)[ \t]*\|.+\|[^\r\n]*)+/,
- lookbehind: true,
- inside: {
- 'outline': {
- pattern: /<[^>]+?>/,
- alias: 'variable'
- },
- 'td': {
- pattern: /\s*[^\s|][^|]*/,
- alias: 'string'
- },
- 'punctuation': /\|/
- }
- },
- 'table-head': {
- pattern: /(?:\r?\n|\r)[ \t]*\|.+\|[^\r\n]*/,
- inside: {
- 'th': {
- pattern: /\s*[^\s|][^|]*/,
- alias: 'variable'
- },
- 'punctuation': /\|/
- }
- },
- 'atrule': {
- pattern: /((?:\r?\n|\r)[ \t]+)(?:'ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t]+)/,
- lookbehind: true
- },
- 'string': {
- pattern: /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,
- inside: {
- 'outline': {
- pattern: /<[^>]+?>/,
- alias: 'variable'
+(function (Prism) {
+
+ var tableRow = /(?:\r?\n|\r)[ \t]*\|.+\|.*/.source;
+
+ Prism.languages.gherkin = {
+ 'pystring': {
+ pattern: /("""|''')[\s\S]+?\1/,
+ alias: 'string'
+ },
+ 'comment': {
+ pattern: /(^[ \t]*)#.*/m,
+ lookbehind: true
+ },
+ 'tag': {
+ pattern: /(^[ \t]*)@\S*/m,
+ lookbehind: true
+ },
+ 'feature': {
+ pattern: /((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:]+(?:\r?\n|\r|$))*/,
+ lookbehind: true,
+ inside: {
+ 'important': {
+ pattern: /(:)[^\r\n]+/,
+ lookbehind: true
+ },
+ 'keyword': /[^:\r\n]+:/
}
+ },
+ 'scenario': {
+ pattern: /(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo\-ho\-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m,
+ lookbehind: true,
+ inside: {
+ 'important': {
+ pattern: /(:)[^\r\n]*/,
+ lookbehind: true
+ },
+ 'keyword': /[^:\r\n]+:/
+ }
+ },
+ 'table-body': {
+ // Look-behind is used to skip the table head, which has the same format as any table row
+ pattern: RegExp('(' + tableRow + ')(?:' + tableRow + ')+'),
+ lookbehind: true,
+ inside: {
+ 'outline': {
+ pattern: /<[^>]+?>/,
+ alias: 'variable'
+ },
+ 'td': {
+ pattern: /\s*[^\s|][^|]*/,
+ alias: 'string'
+ },
+ 'punctuation': /\|/
+ }
+ },
+ 'table-head': {
+ pattern: RegExp(tableRow),
+ inside: {
+ 'th': {
+ pattern: /\s*[^\s|][^|]*/,
+ alias: 'variable'
+ },
+ 'punctuation': /\|/
+ }
+ },
+ 'atrule': {
+ pattern: /(^[ \t]+)(?:'ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m,
+ lookbehind: true
+ },
+ 'string': {
+ pattern: /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,
+ inside: {
+ 'outline': {
+ pattern: /<[^>]+?>/,
+ alias: 'variable'
+ }
+ }
+ },
+ 'outline': {
+ pattern: /<[^>]+?>/,
+ alias: 'variable'
}
- },
- 'outline': {
- pattern: /<[^>]+?>/,
- alias: 'variable'
- }
-};
+ };
+
+}(Prism));
return Prism; })
\ No newline at end of file
'number': /(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ulf]*/i,
'keyword': /\b(?:if|else|switch|case|default|break|for|repeat|while|do|until|continue|exit|return|globalvar|var|enum)\b/,
'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not|with|at|xor|not)\b/,
- 'constant': /\b(self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|spritespeed_framesper(?:second|gameframe)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(obj|scr|spr|rm)\w+)\b/,
- 'variable': /\b(x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/
+ 'constant': /\b(?:self|other|all|noone|global|local|undefined|pointer_(?:invalid|null)|action_(?:stop|restart|continue|reverse)|pi|GM_build_date|GM_version|timezone_(?:local|utc)|gamespeed_(?:fps|microseconds)|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|pre|post)|keypress|keyrelease|trigger|(?:left|right|middle|no)_button|(?:left|right|middle)_press|(?:left|right|middle)_release|mouse_(?:enter|leave|wheel_up|wheel_down)|global_(?:left|right|middle)_button|global_(?:left|right|middle)_press|global_(?:left|right|middle)_release|joystick(?:1|2)_(?:left|right|up|down|button1|button2|button3|button4|button5|button6|button7|button8)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|step_(?:normal|begin|end)|gui|gui_begin|gui_end)|vk_(?:nokey|anykey|enter|return|shift|control|alt|escape|space|backspace|tab|pause|printscreen|left|right|up|down|home|end|delete|insert|pageup|pagedown|f\d|numpad\d|divide|multiply|subtract|add|decimal|lshift|lcontrol|lalt|rshift|rcontrol|ralt)|mb_(?:any|none|left|right|middle)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|purple|red|silver|teal|white|yellow|orange)|fa_(?:left|center|right|top|middle|bottom|readonly|hidden|sysfile|volumeid|directory|archive)|pr_(?:pointlist|linelist|linestrip|trianglelist|trianglestrip|trianglefan)|bm_(?:complex|normal|add|max|subtract|zero|one|src_colour|inv_src_colour|src_color|inv_src_color|src_alpha|inv_src_alpha|dest_alpha|inv_dest_alpha|dest_colour|inv_dest_colour|dest_color|inv_dest_color|src_alpha_sat)|audio_(?:falloff_(?:none|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|exponent_distance|exponent_distance_clamped)|old_system|new_system|mono|stereo|3d)|cr_(?:default|none|arrow|cross|beam|size_nesw|size_ns|size_nwse|size_we|uparrow|hourglass|drag|appstart|handpoint|size_all)|spritespeed_framesper(?:second|gameframe)|asset_(?:object|unknown|sprite|sound|room|path|script|font|timeline|tiles|shader)|ds_type_(?:map|list|stack|queue|grid|priority)|ef_(?:explosion|ring|ellipse|firework|smoke|smokeup|star|spark|flare|cloud|rain|snow)|pt_shape_(?:pixel|disk|square|line|star|circle|ring|sphere|flare|spark|explosion|cloud|smoke|snow)|ps_(?:distr|shape)_(?:linear|gaussian|invgaussian|rectangle|ellipse|diamond|line)|ty_(?:real|string)|dll_(?:cdel|cdecl|stdcall)|matrix_(?:view|projection|world)|os_(?:win32|windows|macosx|ios|android|linux|unknown|winphone|win8native|psvita|ps4|xboxone|ps3|uwp)|browser_(?:not_a_browser|unknown|ie|firefox|chrome|safari|safari_mobile|opera|tizen|windows_store|ie_mobile)|device_ios_(?:unknown|iphone|iphone_retina|ipad|ipad_retina|iphone5|iphone6|iphone6plus)|device_(?:emulator|tablet)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|of_challenge_(?:win|lose|tie)|leaderboard_type_(?:number|time_mins_secs)|cmpfunc_(?:never|less|equal|lessequal|greater|notequal|greaterequal|always)|cull_(?:noculling|clockwise|counterclockwise)|lighttype_(?:dir|point)|iap_(?:ev_storeload|ev_product|ev_purchase|ev_consume|ev_restore|storeload_ok|storeload_failed|status_uninitialised|status_unavailable|status_loading|status_available|status_processing|status_restoring|failed|unavailable|available|purchased|canceled|refunded)|fb_login_(?:default|fallback_to_webview|no_fallback_to_webview|forcing_webview|use_system_account|forcing_safari)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|reaction_force_x|reaction_force_y|reaction_torque|motor_speed|angle|motor_torque|max_motor_torque|translation|speed|motor_force|max_motor_force|length_1|length_2|damping_ratio|frequency|lower_angle_limit|upper_angle_limit|angle_limits|max_length|max_torque|max_force)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_particle_flag_(?:water|zombie|wall|spring|elastic|viscous|powder|tensile|colourmixing|colormixing)|phy_particle_group_flag_(?:solid|rigid)|phy_particle_data_flag_(?:typeflags|position|velocity|colour|color|category)|achievement_(?:our_info|friends_info|leaderboard_info|info|filter_(?:all_players|friends_only|favorites_only)|type_challenge|type_score_challenge|pic_loaded|show_(?:ui|profile|leaderboard|achievement|bank|friend_picker|purchase_prompt))|network_(?:socket_(?:tcp|udp|bluetooth)|type_(?:connect|disconnect|data|non_blocking_connect)|config_(?:connect_timeout|use_non_blocking_socket|enable_reliable_udp|disable_reliable_udp))|buffer_(?:fixed|grow|wrap|fast|vbuffer|network|u8|s8|u16|s16|u32|s32|u64|f16|f32|f64|bool|text|string|seek_start|seek_relative|seek_end|generalerror|outofspace|outofbounds|invalidtype)|gp_(?:face\d|shoulderl|shoulderr|shoulderlb|shoulderrb|select|start|stickl|stickr|padu|padd|padl|padr|axislh|axislv|axisrh|axisrv)|ov_(?:friends|community|players|settings|gamegroup|achievements)|lb_sort_(?:none|ascending|descending)|lb_disp_(?:none|numeric|time_sec|time_ms)|ugc_(?:result_success|filetype_(?:community|microtrans)|visibility_(?:public|friends_only|private)|query_RankedBy(?:Vote|PublicationDate|Trend|NumTimesReported|TotalVotesAsc|VotesUp|TextSearch)|query_(?:AcceptedForGameRankedByAcceptanceDate|FavoritedByFriendsRankedByPublicationDate|CreatedByFriendsRankedByPublicationDate|NotYetRated)|sortorder_CreationOrder(?:Desc|Asc)|sortorder_(?:TitleAsc|LastUpdatedDesc|SubscriptionDateDesc|VoteScoreDesc|ForModeration)|list_(?:Published|VotedOn|VotedUp|VotedDown|WillVoteLater|Favorited|Subscribed|UsedOrPlayed|Followed)|match_(?:Items|Items_Mtx|Items_ReadyToUse|Collections|Artwork|Videos|Screenshots|AllGuides|WebGuides|IntegratedGuides|UsableInGame|ControllerBindings))|vertex_usage_(?:position|colour|color|normal|texcoord|textcoord|blendweight|blendindices|psize|tangent|binormal|fog|depth|sample)|vertex_type_(?:float\d|colour|color|ubyte4)|layerelementtype_(?:undefined|background|instance|oldtilemap|sprite|tilemap|particlesystem|tile)|tile_(?:rotate|flip|mirror|index_mask)|input_type|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|(?:obj|scr|spr|rm)\w+)\b/,
+ 'variable': /\b(?:x|y|(?:x|y)(?:previous|start)|(?:h|v)speed|direction|speed|friction|gravity|gravity_direction|path_(?:index|position|positionprevious|speed|scale|orientation|endaction)|object_index|id|solid|persistent|mask_index|instance_(?:count|id)|alarm|timeline_(?:index|position|speed|running|loop)|visible|sprite_(?:index|width|height|xoffset|yoffset)|image_(?:number|index|speed|depth|xscale|yscale|angle|alpha|blend)|bbox_(?:left|right|top|bottom)|layer|phy_(?:rotation|(?:position|linear_velocity|speed|com|collision|col_normal)_(?:x|y)|angular_(?:velocity|damping)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|working_directory|webgl_enabled|view_(?:(?:y|x|w|h)view|(?:y|x|w|h)port|(?:v|h)(?:speed|border)|visible|surface_id|object|enabled|current|angle)|undefined|transition_(?:steps|kind|color)|temp_directory|show_(?:score|lives|health)|secure_mode|score|room_(?:width|speed|persistent|last|height|first|caption)|room|pointer_(?:null|invalid)|os_(?:version|type|device|browser)|mouse_(?:y|x|lastbutton|button)|lives|keyboard_(?:string|lastkey|lastchar|key)|iap_data|health|gamemaker_(?:version|registered|pro)|game_(?:save|project|display)_(?:id|name)|fps_real|fps|event_(?:type|object|number|action)|error_(?:occurred|last)|display_aa|delta_time|debug_mode|cursor_sprite|current_(?:year|weekday|time|second|month|minute|hour|day)|caption_(?:score|lives|health)|browser_(?:width|height)|background_(?:yscale|y|xscale|x|width|vtiled|vspeed|visible|showcolour|showcolor|index|htiled|hspeed|height|foreground|colour|color|blend|alpha)|async_load|application_surface|argument(?:_relitive|_count|\d)|argument|global|local|self|other)\b/
});
return Prism; })
\ No newline at end of file
'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
'number': /(?:\b0x[a-f\d]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[-+]?\d+)?)i?/i,
'string': {
- pattern: /(["'`])(\\[\s\S]|(?!\1)[^\\])*\1/,
+ pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
greedy: true
}
});
define(["prism/prism","prism/components/prism-clike"], function () {
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: /("""|''')[\s\S]*?\1|(?:\$\/)(?:\$\/\$|[\s\S])*?\/\$/,
+ pattern: /("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:\$\/\$|[\s\S])*?\/\$/,
greedy: true
},
{
- pattern: /(["'\/])(?:\\.|(?!\1)[^\\\r\n])*\1/,
+ // TODO: Slash strings (e.g. /foo/) can contain line breaks but this will cause a lot of trouble with
+ // simple division (see JS regex), so find a fix maybe?
+ pattern: /(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/,
greedy: true
}
],
+ '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/,
'number': /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?[\d]+)?)[glidf]?\b/i,
'operator': {
- pattern: /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.{1,2}(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,
+ pattern: /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,
lookbehind: true
},
- 'punctuation': /\.+|[{}[\];(),:$]/
+ 'punctuation': /\.+|[{}[\];(),.:$]/
});
Prism.languages.insertBefore('groovy', 'string', {
Prism.languages.insertBefore('groovy', 'function', {
'annotation': {
- alias: 'punctuation',
pattern: /(^|[^.])@\w+/,
- lookbehind: true
+ lookbehind: true,
+ alias: 'punctuation'
}
});
-define(["prism/prism","prism/components/prism-ruby","prism/components/prism-css","prism/components/prism-coffeescript","prism/components/prism-erb","prism/components/prism-javascript","prism/components/prism-less","prism/components/prism-markdown","prism/components/prism-ruby","prism/components/prism-scss","prism/components/prism-textile"], function () {
+define(["prism/prism","prism/components/prism-ruby"], function () {
/* TODO
Handle multiline code after tag
%foo= some |
{
pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ]+.*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ]+.+)/,
lookbehind: true,
- inside: {
- rest: Prism.languages.ruby
- }
+ inside: Prism.languages.ruby
},
{
pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ]+.*\|[\t ]*)*/,
lookbehind: true,
- inside: {
- rest: Prism.languages.ruby
- }
+ inside: Prism.languages.ruby
}
],
'markup': {
pattern: /((?:^|\r?\n|\r)[\t ]*)<.+/,
lookbehind: true,
- inside: {
- rest: Prism.languages.markup
- }
+ inside: Prism.languages.markup
},
'doctype': {
pattern: /((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/,
// Allows for one nested group of braces
pattern: /(^|[^#])\{(?:\{[^}]+\}|[^}])+\}/,
lookbehind: true,
- inside: {
- rest: Prism.languages.ruby
- }
+ inside: Prism.languages.ruby
},
{
pattern: /\([^)]+\)/,
},
{
pattern: /\[[^\]]+\]/,
- inside: {
- rest: Prism.languages.ruby
- }
+ inside: Prism.languages.ruby
}
],
'punctuation': /[<>]/
'code': {
pattern: /((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,
lookbehind: true,
- inside: {
- rest: Prism.languages.ruby
- }
+ inside: Prism.languages.ruby
},
// Interpolations in plain text
'interpolation': {
filter = typeof filter === 'string' ? {filter: filter, language: filter} : filter;
if (Prism.languages[filter.language]) {
all_filters['filter-' + filter.filter] = {
- pattern: RegExp(filter_pattern.replace('{{filter_name}}', filter.filter)),
+ pattern: RegExp(filter_pattern.replace('{{filter_name}}', function () { return filter.filter; })),
lookbehind: true,
inside: {
'filter-name': {
Prism.languages.insertBefore('haml', 'filter', all_filters);
}(Prism));
+
return Prism; })
\ No newline at end of file
variable: /[\s\S]+/
}
},
- 'punctuation': /[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,
- 'variable': /[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/
+ 'punctuation': /[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,
+ 'variable': /[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/
};
Prism.hooks.add('before-tokenize', function(env) {
// It may also be a separator between a module name and an identifier => no
// operator. If it comes together with other special characters it is an
// operator too.
- 'operator': /\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`([A-Z][\w']*\.)*[_a-z][\w']*`/,
+ 'operator': /\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/,
// In Haskell, nearly everything is a variable, do not highlight these.
'hvariable': /\b(?:[A-Z][\w']*\.)*[_a-z][\w']*\b/,
'constant': /\b(?:[A-Z][\w']*\.)*[A-Z][\w']*\b/,
};
Prism.languages.hs = Prism.languages.haskell;
+
return Prism; })
\ No newline at end of file
-define(["prism/prism","prism/components/prism-javascript","prism/components/prism-markup"], function () {
+define(["prism/prism"], function () {
(function (Prism) {
Prism.languages.http = {
'request-line': {
options = options || {};
var pattern = suffixTypes[contentType] ? getSuffixPattern(contentType) : contentType;
- options[contentType] = {
+ options[contentType.replace(/\//g, '-')] = {
pattern: RegExp('(content-type:\\s*' + pattern + '[\\s\\S]*?)(?:\\r?\\n|\\r){2}[\\s\\S]*', 'i'),
lookbehind: true,
- inside: {
- rest: httpLanguages[contentType]
- }
+ inside: httpLanguages[contentType]
};
}
}
'builtin':/\b(?:Array|AudioDevice|AudioMixer|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Regex|SGML|SGMLElement|SGMLParser|SQLite|Server|Sequence|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink|Random|BigNum|Sequence)\b/,
'boolean': /\b(?:true|false|nil)\b/,
'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e-?\d+)?/i,
- 'operator': /[=!*/%+-^&|]=|>>?=?|<<?=?|:?:?=|\+\+?|--?|\*\*?|\/\/?|%|\|\|?|&&?|(\b(?:return|and|or|not)\b)|@@?|\?\??|\.\./,
+ 'operator': /[=!*/%+-^&|]=|>>?=?|<<?=?|:?:?=|\+\+?|--?|\*\*?|\/\/?|%|\|\|?|&&?|\b(?:return|and|or|not)\b|@@?|\?\??|\.\./,
'punctuation': /[{}[\];(),.:]/
};
define(["prism/prism","prism/components/prism-clike"], function () {
(function (Prism) {
- var keywords = /\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|var|null|exports|module|open|opens|provides|requires|to|transitive|uses|with)\b/;
+ var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|record|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
// based on the java naming conventions
var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/;
],
'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
'operator': {
- pattern: /(^|[^.])(?:<<=?|>>>?=?|->|([-+&|])\2|[?:~]|[-+*/%&|^!=<>]=?)/m,
+ pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
lookbehind: true
}
});
+ Prism.languages.insertBefore('java', 'string', {
+ 'triple-quoted-string': {
+ // http://openjdk.java.net/jeps/355#Description
+ pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
+ greedy: true,
+ alias: 'string'
+ }
+ });
+
Prism.languages.insertBefore('java', 'class-name', {
'annotation': {
alias: 'punctuation',
lookbehind: true
},
'namespace': {
- pattern: /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(\.[a-z]\w*)+/,
+ pattern: /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(?:\.[a-z]\w*)+/,
lookbehind: true,
inside: {
'punctuation': /\./,
-define(["prism/prism","prism/components/prism-markup","prism/components/prism-java","prism/components/prism-javadoclike","prism/components/prism-scala"], function () {
+define(["prism/prism","prism/components/prism-markup","prism/components/prism-java","prism/components/prism-javadoclike"], function () {
(function (Prism) {
var codeLines = {
'code': {
- pattern: /(^(\s*(?:\*\s*)*)).*[^*\s].+$/m,
+ pattern: /(^(?:\s*(?:\*\s*)*)).*[^*\s].+$/m,
lookbehind: true,
inside: Prism.languages.java,
alias: 'language-java'
-define(["prism/prism","prism/components/prism-java","prism/components/prism-javascript","prism/components/prism-php"], function () {
+define(["prism/prism"], function () {
(function (Prism) {
var javaDocLike = Prism.languages.javadoclike = {
var definition = {};
definition[tokenName] = {
pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,
+ lookbehind: true,
alias: 'comment'
};
-define(["prism/prism","prism/components/prism-clike","prism/components/prism-markup"], function () {
+define(["prism/prism","prism/components/prism-clike"], function () {
Prism.languages.javascript = Prism.languages.extend('clike', {
'class-name': [
Prism.languages.clike['class-name'],
lookbehind: true
},
{
- pattern: /(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|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|undefined|var|void|while|with|yield)\b/,
+ pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|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|undefined|var|void|while|with|yield)\b/,
lookbehind: true
},
],
'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
- 'function': /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
- 'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/
+ 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
+ 'operator': /--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/
});
Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
Prism.languages.insertBefore('javascript', 'keyword', {
'regex': {
- pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,
+ pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
lookbehind: true,
greedy: true
},
// This must be declared before keyword because we use "function" inside the look-forward
'function-variable': {
- pattern: /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,
+ pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,
alias: 'function'
},
'parameter': [
Prism.languages.insertBefore('javascript', 'string', {
'template-string': {
- pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|[^\\`])*`/,
+ pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,
greedy: true,
inside: {
+ 'template-punctuation': {
+ pattern: /^`|`$/,
+ alias: 'string'
+ },
'interpolation': {
- pattern: /\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,
+ pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,
+ lookbehind: true,
inside: {
'interpolation-punctuation': {
pattern: /^\${|}$/,
pattern: /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,
lookbehind: true,
inside: {
- 'withExtension': {
+ 'with-extension': {
pattern: /\bwith\s+\w+/,
inside: {
'keyword' : /\bwith\b/
}
}
});
+
return Prism; })
\ No newline at end of file
(function (Prism) {
var interpolation = /\\\((?:[^()]|\([^()]*\))*\)/.source;
- var string = RegExp(/"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(/__/g, interpolation));
+ var string = RegExp(/"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(/__/g, function () { return interpolation; }));
var stringInterpolation = {
'interpolation': {
pattern: RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + interpolation),
-define(["prism/prism","prism/components/prism-javascript","prism/components/prism-actionscript","prism/components/prism-coffeescript","prism/components/prism-flow","prism/components/prism-n4js","prism/components/prism-typescript"], function () {
+define(["prism/prism","prism/components/prism-javascript"], function () {
(function (Prism) {
Prism.languages.insertBefore('javascript', 'function-variable', {
Prism.languages.insertBefore('javascript', 'punctuation', {
'property-access': {
- pattern: /(\.\s*)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*/,
+ pattern: /(\.\s*)#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*/,
lookbehind: true
},
'maybe-class-name': {
--- /dev/null
+define(["prism/prism","prism/components/prism-javascript"], function () {
+(function (Prism) {
+
+ var templateString = Prism.languages.javascript['template-string'];
+
+ // see the pattern in prism-javascript.js
+ var templateLiteralPattern = templateString.pattern.source;
+ var interpolationObject = templateString.inside['interpolation'];
+ var interpolationPunctuationObject = interpolationObject.inside['interpolation-punctuation'];
+ var interpolationPattern = interpolationObject.pattern.source;
+
+
+ /**
+ * Creates a new pattern to match a template string with a special tag.
+ *
+ * This will return `undefined` if there is no grammar with the given language id.
+ *
+ * @param {string} language The language id of the embedded language. E.g. `markdown`.
+ * @param {string} tag The regex pattern to match the tag.
+ * @returns {object | undefined}
+ * @example
+ * createTemplate('css', /\bcss/.source);
+ */
+ function createTemplate(language, tag) {
+ if (!Prism.languages[language]) {
+ return undefined;
+ }
+
+ return {
+ pattern: RegExp('((?:' + tag + ')\\s*)' + templateLiteralPattern),
+ lookbehind: true,
+ greedy: true,
+ inside: {
+ 'template-punctuation': {
+ pattern: /^`|`$/,
+ alias: 'string'
+ },
+ 'embedded-code': {
+ pattern: /[\s\S]+/,
+ alias: language
+ }
+ }
+ };
+ }
+
+
+ Prism.languages.javascript['template-string'] = [
+ // styled-jsx:
+ // css`a { color: #25F; }`
+ // styled-components:
+ // styled.h1`color: red;`
+ createTemplate('css', /\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),
+
+ // html`<p></p>`
+ // div.innerHTML = `<p></p>`
+ createTemplate('html', /\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),
+
+ // svg`<path fill="#fff" d="M55.37 ..."/>`
+ createTemplate('svg', /\bsvg/.source),
+
+ // md`# h1`, markdown`## h2`
+ createTemplate('markdown', /\b(?:md|markdown)/.source),
+
+ // gql`...`, graphql`...`, graphql.experimental`...`
+ createTemplate('graphql', /\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),
+
+ // vanilla template string
+ templateString
+ ].filter(Boolean);
+
+
+ /**
+ * Returns a specific placeholder literal for the given language.
+ *
+ * @param {number} counter
+ * @param {string} language
+ * @returns {string}
+ */
+ function getPlaceholder(counter, language) {
+ return '___' + language.toUpperCase() + '_' + counter + '___';
+ }
+
+ /**
+ * Returns the tokens of `Prism.tokenize` but also runs the `before-tokenize` and `after-tokenize` hooks.
+ *
+ * @param {string} code
+ * @param {any} grammar
+ * @param {string} language
+ * @returns {(string|Token)[]}
+ */
+ function tokenizeWithHooks(code, grammar, language) {
+ var env = {
+ code: code,
+ grammar: grammar,
+ language: language
+ };
+ Prism.hooks.run('before-tokenize', env);
+ env.tokens = Prism.tokenize(env.code, env.grammar);
+ Prism.hooks.run('after-tokenize', env);
+ return env.tokens;
+ }
+
+ /**
+ * Returns the token of the given JavaScript interpolation expression.
+ *
+ * @param {string} expression The code of the expression. E.g. `"${42}"`
+ * @returns {Token}
+ */
+ function tokenizeInterpolationExpression(expression) {
+ var tempGrammar = {};
+ tempGrammar['interpolation-punctuation'] = interpolationPunctuationObject;
+
+ /** @type {Array} */
+ var tokens = Prism.tokenize(expression, tempGrammar);
+ if (tokens.length === 3) {
+ /**
+ * The token array will look like this
+ * [
+ * ["interpolation-punctuation", "${"]
+ * "..." // JavaScript expression of the interpolation
+ * ["interpolation-punctuation", "}"]
+ * ]
+ */
+
+ var args = [1, 1];
+ args.push.apply(args, tokenizeWithHooks(tokens[1], Prism.languages.javascript, 'javascript'));
+
+ tokens.splice.apply(tokens, args);
+ }
+
+ return new Prism.Token('interpolation', tokens, interpolationObject.alias, expression);
+ }
+
+ /**
+ * Tokenizes the given code with support for JavaScript interpolation expressions mixed in.
+ *
+ * This function has 3 phases:
+ *
+ * 1. Replace all JavaScript interpolation expression with a placeholder.
+ * The placeholder will have the syntax of a identify of the target language.
+ * 2. Tokenize the code with placeholders.
+ * 3. Tokenize the interpolation expressions and re-insert them into the tokenize code.
+ * The insertion only works if a placeholder hasn't been "ripped apart" meaning that the placeholder has been
+ * tokenized as two tokens by the grammar of the embedded language.
+ *
+ * @param {string} code
+ * @param {object} grammar
+ * @param {string} language
+ * @returns {Token}
+ */
+ function tokenizeEmbedded(code, grammar, language) {
+ // 1. First filter out all interpolations
+
+ // because they might be escaped, we need a lookbehind, so we use Prism
+ /** @type {(Token|string)[]} */
+ var _tokens = Prism.tokenize(code, {
+ 'interpolation': {
+ pattern: RegExp(interpolationPattern),
+ lookbehind: true
+ }
+ });
+
+ // replace all interpolations with a placeholder which is not in the code already
+ var placeholderCounter = 0;
+ /** @type {Object<string, string>} */
+ var placeholderMap = {};
+ var embeddedCode = _tokens.map(function (token) {
+ if (typeof token === 'string') {
+ return token;
+ } else {
+ var interpolationExpression = token.content;
+
+ var placeholder;
+ while (code.indexOf(placeholder = getPlaceholder(placeholderCounter++, language)) !== -1) { }
+ placeholderMap[placeholder] = interpolationExpression;
+ return placeholder;
+ }
+ }).join('');
+
+
+ // 2. Tokenize the embedded code
+
+ var embeddedTokens = tokenizeWithHooks(embeddedCode, grammar, language);
+
+
+ // 3. Re-insert the interpolation
+
+ var placeholders = Object.keys(placeholderMap);
+ placeholderCounter = 0;
+
+ /**
+ *
+ * @param {(Token|string)[]} tokens
+ * @returns {void}
+ */
+ function walkTokens(tokens) {
+ for (var i = 0; i < tokens.length; i++) {
+ if (placeholderCounter >= placeholders.length) {
+ return;
+ }
+
+ var token = tokens[i];
+
+ if (typeof token === 'string' || typeof token.content === 'string') {
+ var placeholder = placeholders[placeholderCounter];
+ var s = typeof token === 'string' ? token : /** @type {string} */ (token.content);
+
+ var index = s.indexOf(placeholder);
+ if (index !== -1) {
+ ++placeholderCounter;
+
+ var before = s.substring(0, index);
+ var middle = tokenizeInterpolationExpression(placeholderMap[placeholder]);
+ var after = s.substring(index + placeholder.length);
+
+ var replacement = [];
+ if (before) {
+ replacement.push(before);
+ }
+ replacement.push(middle);
+ if (after) {
+ var afterTokens = [after];
+ walkTokens(afterTokens);
+ replacement.push.apply(replacement, afterTokens);
+ }
+
+ if (typeof token === 'string') {
+ tokens.splice.apply(tokens, [i, 1].concat(replacement));
+ i += replacement.length - 1;
+ } else {
+ token.content = replacement;
+ }
+ }
+ } else {
+ var content = token.content;
+ if (Array.isArray(content)) {
+ walkTokens(content);
+ } else {
+ walkTokens([content]);
+ }
+ }
+ }
+ }
+ walkTokens(embeddedTokens);
+
+ return new Prism.Token(language, embeddedTokens, 'language-' + language, code);
+ }
+
+ /**
+ * The languages for which JS templating will handle tagged template literals.
+ *
+ * JS templating isn't active for only JavaScript but also related languages like TypeScript, JSX, and TSX.
+ */
+ var supportedLanguages = {
+ 'javascript': true,
+ 'js': true,
+ 'typescript': true,
+ 'ts': true,
+ 'jsx': true,
+ 'tsx': true,
+ };
+ Prism.hooks.add('after-tokenize', function (env) {
+ if (!(env.language in supportedLanguages)) {
+ return;
+ }
+
+ /**
+ * Finds and tokenizes all template strings with an embedded languages.
+ *
+ * @param {(Token | string)[]} tokens
+ * @returns {void}
+ */
+ function findTemplateStrings(tokens) {
+ for (var i = 0, l = tokens.length; i < l; i++) {
+ var token = tokens[i];
+
+ if (typeof token === 'string') {
+ continue;
+ }
+
+ var content = token.content;
+ if (!Array.isArray(content)) {
+ if (typeof content !== 'string') {
+ findTemplateStrings([content]);
+ }
+ continue;
+ }
+
+ if (token.type === 'template-string') {
+ /**
+ * A JavaScript template-string token will look like this:
+ *
+ * ["template-string", [
+ * ["template-punctuation", "`"],
+ * (
+ * An array of "string" and "interpolation" tokens. This is the simple string case.
+ * or
+ * ["embedded-code", "..."] This is the token containing the embedded code.
+ * It also has an alias which is the language of the embedded code.
+ * ),
+ * ["template-punctuation", "`"]
+ * ]]
+ */
+
+ var embedded = content[1];
+ if (content.length === 3 && typeof embedded !== 'string' && embedded.type === 'embedded-code') {
+ // get string content
+ var code = stringContent(embedded);
+
+ var alias = embedded.alias;
+ var language = Array.isArray(alias) ? alias[0] : alias;
+
+ var grammar = Prism.languages[language];
+ if (!grammar) {
+ // the embedded language isn't registered.
+ continue;
+ }
+
+ content[1] = tokenizeEmbedded(code, grammar, language);
+ }
+ } else {
+ findTemplateStrings(content);
+ }
+ }
+ }
+
+ findTemplateStrings(env.tokens);
+ });
+
+
+ /**
+ * Returns the string content of a token or token stream.
+ *
+ * @param {string | Token | (string | Token)[]} value
+ * @returns {string}
+ */
+ function stringContent(value) {
+ if (typeof value === 'string') {
+ return value;
+ } else if (Array.isArray(value)) {
+ return value.map(stringContent).join('');
+ } else {
+ return stringContent(value.content);
+ }
+ }
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
-define(["prism/prism","prism/components/prism-javascript","prism/components/prism-javadoclike","prism/components/prism-actionscript","prism/components/prism-coffeescript"], function () {
+define(["prism/prism","prism/components/prism-javascript","prism/components/prism-javadoclike"], function () {
(function (Prism) {
var javascript = Prism.languages.javascript;
greedy: true
},
'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
- 'number': /-?\d+\.?\d*(e[+-]?\d+)?/i,
+ 'number': /-?\d+\.?\d*(?:e[+-]?\d+)?/i,
'punctuation': /[{}[\],]/,
'operator': /:/,
'boolean': /\b(?:true|false)\b/,
-define(["prism/prism","prism/components/prism-markup","prism/components/prism-javascript","prism/components/prism-jsdoc","prism/components/prism-js-extras"], function () {
+define(["prism/prism","prism/components/prism-markup","prism/components/prism-javascript"], function () {
(function(Prism) {
var javascript = Prism.util.clone(Prism.languages.javascript);
Prism.languages.jsx = Prism.languages.extend('markup', javascript);
-Prism.languages.jsx.tag.pattern= /<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}))*\s*\/?)?>/i;
+Prism.languages.jsx.tag.pattern= /<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:$-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^}]*\}|[^{}])*\}|[^{}])+\}))?|\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}))*\s*\/?)?>/i;
Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/i;
Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">]+)/i;
Prism.languages.insertBefore('inside', 'attr-name', {
'spread': {
- pattern: /\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}/,
+ pattern: /\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}/,
inside: {
'punctuation': /\.{3}|[{}.]/,
'attr-value': /\w+/
Prism.languages.insertBefore('inside', 'attr-value',{
'script': {
// Allow for two levels of nesting
- pattern: /=(\{(?:\{(?:\{[^}]*\}|[^}])*\}|[^}])+\})/i,
+ pattern: /=(?:\{(?:\{(?:\{[^}]*\}|[^}])*\}|[^}])+\})/i,
inside: {
'script-punctuation': {
pattern: /^=(?={)/,
{
pattern: /\$\{[^}]+\}/,
inside: {
- delimiter: {
+ 'delimiter': {
pattern: /^\$\{|\}$/,
alias: 'variable'
},
--- /dev/null
+define(["prism/prism","prism/components/prism-clike","prism/components/prism-markup-templating","prism/components/prism-php"], function () {
+(function (Prism) {
+ Prism.languages.latte = {
+ 'comment': /^\{\*[\s\S]*/,
+ 'ld': {
+ pattern: /^\{(?:[=_]|\/?(?!\d|\w+\()\w+|)/,
+ inside: {
+ 'punctuation': /^\{\/?/,
+ 'tag': {
+ pattern: /.+/,
+ alias: 'important'
+ }
+ }
+ },
+ 'rd': {
+ pattern: /\}$/,
+ inside: {
+ 'punctuation': /.+/
+ }
+ },
+ 'php': {
+ pattern: /\S(?:[\s\S]*\S)?/,
+ alias: 'language-php',
+ inside: Prism.languages.php
+ }
+ };
+
+ var markupLatte = Prism.languages.extend('markup', {});
+ Prism.languages.insertBefore('inside', 'attr-value', {
+ 'n-attr': {
+ pattern: /n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,
+ inside: {
+ 'attr-name': {
+ pattern: /^[^\s=]+/,
+ alias: 'important'
+ },
+ 'attr-value': {
+ pattern: /=[\s\S]+/,
+ inside: {
+ 'punctuation': [
+ /^=/,
+ {
+ pattern: /^(\s*)["']|["']$/,
+ lookbehind: true
+ }
+ ],
+ 'php': {
+ pattern: /\S(?:[\s\S]*\S)?/,
+ inside: Prism.languages.php
+ }
+ }
+ },
+ }
+ },
+ }, markupLatte.tag);
+
+ Prism.hooks.add('before-tokenize', function(env) {
+ if (env.language !== 'latte') {
+ return;
+ }
+ var lattePattern = /\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*[\s\S]*?\*\/)*?\}/g;
+ Prism.languages['markup-templating'].buildPlaceholders(env, 'latte', lattePattern);
+ env.grammar = markupLatte;
+ });
+
+ Prism.hooks.add('after-tokenize', function(env) {
+ Prism.languages['markup-templating'].tokenizePlaceholders(env, 'latte');
+ });
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
}
],
'atrule': {
- pattern: /@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i,
+ pattern: /@[\w-]+?(?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};])*?(?=\s*\{)/,
inside: {
'punctuation': /[:()]/
}
},
// selectors and mixins are considered the same
'selector': {
- pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/,
+ pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@])*?(?=\s*\{)/,
inside: {
// mixin parameters
'variable': /@+[\w-]+/
--- /dev/null
+define(["prism/prism","prism/components/prism-scheme"], function () {
+(function (Prism) {
+
+ var schemeExpression = /\((?:[^();"#\\]|\\[\s\S]|;.*|"(?:[^"\\]|\\.)*"|#(?:\{(?:(?!#\})[\s\S])*#\}|[^{])|<expr>)*\)/.source;
+ // allow for up to pow(2, recursivenessLog2) many levels of recursive brace expressions
+ // For some reason, this can't be 4
+ var recursivenessLog2 = 5;
+ for (var i = 0; i < recursivenessLog2; i++) {
+ schemeExpression = schemeExpression.replace(/<expr>/g, function () { return schemeExpression; });
+ }
+ schemeExpression = schemeExpression.replace(/<expr>/g, /[^\s\S]/.source);
+
+
+ var lilypond = Prism.languages.lilypond = {
+ 'comment': /%(?:(?!\{).*|\{[\s\S]*?%\})/,
+ 'embedded-scheme': {
+ pattern: RegExp(/(^|[=\s])#(?:"(?:[^"\\]|\\.)*"|[^\s()"]*(?:[^\s()]|<expr>))/.source.replace(/<expr>/g, function () { return schemeExpression; }), 'm'),
+ lookbehind: true,
+ greedy: true,
+ inside: {
+ 'scheme': {
+ pattern: /^(#)[\s\S]+$/,
+ lookbehind: true,
+ alias: 'language-scheme',
+ inside: {
+ 'embedded-lilypond': {
+ pattern: /#\{[\s\S]*?#\}/,
+ greedy: true,
+ inside: {
+ 'punctuation': /^#\{|#\}$/,
+ 'lilypond': {
+ pattern: /[\s\S]+/,
+ alias: 'language-lilypond',
+ inside: null // see below
+ }
+ }
+ },
+ rest: Prism.languages.scheme
+ }
+ },
+ 'punctuation': /#/
+ }
+ },
+ 'string': {
+ pattern: /"(?:[^"\\]|\\.)*"/,
+ greedy: true
+ },
+ 'class-name': {
+ pattern: /(\\new\s+)[\w-]+/,
+ lookbehind: true
+ },
+ 'keyword': {
+ pattern: /\\[a-z][-\w]*/i,
+ inside: {
+ 'punctuation': /^\\/
+ }
+ },
+ 'operator': /[=|]|<<|>>/,
+ 'punctuation': {
+ pattern: /(^|[a-z\d])(?:'+|,+|[_^]?-[_^]?(?:[-+^!>._]|(?=\d))|[_^]\.?|[.!])|[{}()[\]<>^~]|\\[()[\]<>\\!]|--|__/,
+ lookbehind: true
+ },
+ 'number': /\b\d+(?:\/\d+)?\b/
+ };
+
+ lilypond['embedded-scheme'].inside['scheme'].inside['embedded-lilypond'].inside['lilypond'].inside = lilypond;
+
+ Prism.languages.ly = lilypond;
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
},
punctuation: [
// open paren, brackets, and close paren
- /(['`,]?\(|[)\[\]])/,
+ /(?:['`,]?\(|[)\[\]])/,
// cons
{
pattern: /(\s)\.(?=\s)/,
],
'regex': [
{
- pattern: /\/\/(\[.+?]|\\.|(?!\/\/)[^\\])+\/\/[gimyu]{0,5}/,
+ pattern: /\/\/(?:\[.+?]|\\.|(?!\/\/)[^\\])+\/\/[gimyu]{0,5}/,
greedy: true,
inside: {
'comment': {
}
},
{
- pattern: /\/(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}/,
+ pattern: /\/(?:\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}/,
greedy: true
}
],
};
Prism.languages.livescript['interpolated-string'].inside['interpolation'].inside.rest = Prism.languages.livescript;
+
return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+(function(Prism) {
+ Prism.languages.llvm = {
+ 'comment': /;.*/,
+ 'string': {
+ pattern: /"[^"]*"/,
+ greedy: true,
+ },
+ 'boolean': /\b(?:true|false)\b/,
+ 'variable': /[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i,
+ 'label': /(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i,
+ 'type': {
+ pattern: /\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/,
+ alias: 'class-name',
+ },
+ 'keyword': /\b[a-z_][a-z_0-9]*\b/,
+ 'number': /[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/,
+ 'punctuation': /[{}[\];(),.!*=<>]/,
+ };
+}(Prism));
+
+return Prism; })
\ No newline at end of file
(function (Prism) {
// Allow only one line break
- var inner = /\\.|[^\\\n\r_]|(?:\r?\n|\r)(?!\r?\n|\r)/.source;
+ var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?!\n|\r\n?))/.source;
/**
* This function is intended for the creation of the bold or italic pattern.
* @returns {RegExp}
*/
function createInline(pattern, starAlternative) {
- pattern = pattern.replace(/<inner>/g, inner);
+ pattern = pattern.replace(/<inner>/g, function () { return inner; });
if (starAlternative) {
pattern = pattern + '|' + pattern.replace(/_/g, '\\*');
}
}
+ var tableCell = /(?:\\.|``.+?``|`[^`\r\n]+`|[^\\|\r\n`])+/.source;
+ var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|$)/.source.replace(/__/g, function () { return tableCell; });
+ var tableLine = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
+
+
Prism.languages.markdown = Prism.languages.extend('markup', {});
Prism.languages.insertBefore('markdown', 'prolog', {
'blockquote': {
pattern: /^>(?:[\t ]*>)*/m,
alias: 'punctuation'
},
+ 'table': {
+ pattern: RegExp('^' + tableRow + tableLine + '(?:' + tableRow + ')*', 'm'),
+ inside: {
+ 'table-data-rows': {
+ pattern: RegExp('^(' + tableRow + tableLine + ')(?:' + tableRow + ')*$'),
+ lookbehind: true,
+ inside: {
+ 'table-data': {
+ pattern: RegExp(tableCell),
+ inside: Prism.languages.markdown
+ },
+ 'punctuation': /\|/
+ }
+ },
+ 'table-line': {
+ pattern: RegExp('^(' + tableRow + ')' + tableLine + '$'),
+ lookbehind: true,
+ inside: {
+ 'punctuation': /\||:?-{3,}:?/
+ }
+ },
+ 'table-header-row': {
+ pattern: RegExp('^' + tableRow + '$'),
+ inside: {
+ 'table-header': {
+ pattern: RegExp(tableCell),
+ alias: 'important',
+ inside: Prism.languages.markdown
+ },
+ 'punctuation': /\|/
+ }
+ }
+ }
+ },
'code': [
{
- // Prefixed by 4 spaces or 1 tab
- pattern: /^(?: {4}|\t).+/m,
+ // Prefixed by 4 spaces or 1 tab and preceded by an empty line
+ pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
+ lookbehind: true,
alias: 'keyword'
},
{
// `code`
// ``code``
- pattern: /``.+?``|`[^`\n]+`/,
+ pattern: /``.+?``|`[^`\r\n]+`/,
alias: 'keyword'
},
{
greedy: true,
inside: {
'code-block': {
- pattern: /^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m,
+ pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
lookbehind: true
},
'code-language': {
// title 2
// -------
- pattern: /\S.*(?:\r?\n|\r)(?:==+|--+)/,
+ pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
alias: 'important',
inside: {
punctuation: /==+$|--+$/
// __strong__
// allow one nested instance of italic text using the same delimiter
- pattern: createInline(/__(?:<inner>|_(?:<inner>)+_)+__/.source, true),
+ pattern: createInline(/__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__/.source, true),
lookbehind: true,
greedy: true,
inside: {
// _em_
// allow one nested instance of bold text using the same delimiter
- pattern: createInline(/_(?:<inner>|__(?:<inner>)+__)+_/.source, true),
+ pattern: createInline(/_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_/.source, true),
lookbehind: true,
greedy: true,
inside: {
'strike': {
// ~~strike through~~
// ~strike~
-
- // extra _ is because the inner pattern intentionally doesn't include it because of bold and italic
- pattern: createInline(/(~~?)(?:<inner>|_)+?\2/.source, false),
+ pattern: createInline(/(~~?)(?:(?!~)<inner>)+?\2/.source, false),
lookbehind: true,
greedy: true,
inside: {
},
'url': {
// [example](http://example.com "Optional title")
+ // [example][id]
// [example] [id]
- pattern: /!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/,
+ pattern: createInline(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[(?:(?!\])<inner>)+\])/.source, false),
+ lookbehind: true,
+ greedy: true,
inside: {
'variable': {
- pattern: /(!?\[)[^\]]+(?=\]$)/,
+ pattern: /(\[)[^\]]+(?=\]$)/,
lookbehind: true
},
+ 'content': {
+ pattern: /(^!?\[)[^\]]+(?=\])/,
+ lookbehind: true,
+ inside: {} // see below
+ },
'string': {
pattern: /"(?:\\.|[^"\\])*"(?=\)$)/
}
}
});
- ['bold', 'italic', 'strike'].forEach(function (token) {
+ ['url', 'bold', 'italic', 'strike'].forEach(function (token) {
['url', 'bold', 'italic', 'strike'].forEach(function (inside) {
if (token !== inside) {
Prism.languages.markdown[token].inside.content.inside[inside] = Prism.languages.markdown[inside];
typeof codeLang.content === 'string') {
// this might be a language that Prism does not support
- var alias = 'language-' + codeLang.content.trim().split(/\s+/)[0].toLowerCase();
+
+ // do some replacements to support C++, C#, and F#
+ var lang = codeLang.content.replace(/\b#/g, 'sharp').replace(/\b\+\+/g, 'pp')
+ // only use the first word
+ lang = (/[a-z][\w-]*/i.exec(lang) || [''])[0].toLowerCase();
+ var alias = 'language-' + lang;
// add alias
if (!codeBlock.alias) {
var grammar = Prism.languages[codeLang];
if (!grammar) {
- return;
- }
+ if (codeLang && codeLang !== 'none' && Prism.plugins.autoloader) {
+ var id = 'md-' + new Date().valueOf() + '-' + Math.floor(Math.random() * 1e16);
+ env.attributes['id'] = id;
- // reverse Prism.util.encode
- var code = env.content.replace(/</g, '<').replace(/&/g, '&');
+ Prism.plugins.autoloader.loadLanguages(codeLang, function () {
+ var ele = document.getElementById(id);
+ if (ele) {
+ ele.innerHTML = Prism.highlight(ele.textContent, Prism.languages[codeLang], codeLang);
+ }
+ });
+ }
+ } else {
+ // reverse Prism.util.encode
+ var code = env.content.replace(/</g, '<').replace(/&/g, '&');
- env.content = Prism.highlight(code, grammar, codeLang);
+ env.content = Prism.highlight(code, grammar, codeLang);
+ }
});
Prism.languages.md = Prism.languages.markdown;
Prism.languages.markup = {
'comment': /<!--[\s\S]*?-->/,
'prolog': /<\?[\s\S]+?\?>/,
- 'doctype': /<!DOCTYPE[\s\S]+?>/i,
+ 'doctype': {
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!<!--)[^"'\]]|"[^"]*"|'[^']*'|<!--[\s\S]*?-->)*\]\s*)?>/i,
+ greedy: true
+ },
'cdata': /<!\[CDATA\[[\s\S]*?]]>/i,
'tag': {
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,
var def = {};
def[tagName] = {
- pattern: RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[[\s\S]*?\]\]>\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g, tagName), 'i'),
+ pattern: RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[[\s\S]*?\]\]>\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
lookbehind: true,
greedy: true,
inside: inside
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.moonscript = {
+ 'comment': /--.*/,
+ 'string': [
+ {
+ pattern: /'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,
+ greedy: true
+ },
+ {
+ pattern: /"[^"]*"/,
+ greedy: true,
+ inside: {
+ 'interpolation': {
+ pattern: /#\{[^{}]*\}/,
+ inside: {
+ 'moonscript': {
+ pattern: /(^#\{)[\s\S]+(?=\})/,
+ lookbehind: true,
+ inside: null // see beow
+ },
+ 'interpolation-punctuation': {
+ pattern: /#\{|\}/,
+ alias: 'punctuation'
+ }
+ }
+ }
+ }
+ }
+ ],
+ 'class-name': [
+ {
+ pattern: /(\b(?:class|extends)[ \t]+)\w+/,
+ lookbehind: true
+ },
+ // class-like names start with a capital letter
+ /\b[A-Z]\w*/
+ ],
+ 'keyword': /\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,
+ 'variable': /@@?\w*/,
+ 'property': {
+ pattern: /\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,
+ lookbehind: true
+ },
+ 'function': {
+ pattern: /\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:running|create|resume|status|wrap|yield)|debug\.(?:debug|gethook|getinfo|getlocal|getupvalue|setlocal|setupvalue|sethook|traceback|getfenv|getmetatable|getregistry|setfenv|setmetatable)|dofile|error|getfenv|getmetatable|io\.(?:stdin|stdout|stderr|close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|sin|cos|tan|deg|exp|floor|log|log10|max|min|fmod|modf|cosh|sinh|tanh|pow|rad|sqrt|frexp|ldexp|random|randomseed|pi)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|len|lower|rep|sub|upper|format|gsub|gmatch|match|reverse)|table\.(?:maxn|concat|sort|insert|remove)|tonumber|tostring|type|unpack|xpcall)\b/,
+ inside: {
+ 'punctuation': /\./
+ }
+ },
+ 'boolean': /\b(?:false|true)\b/,
+ 'number': /(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,
+ 'operator': /\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,
+ 'punctuation': /[.,()[\]{}\\]/
+};
+
+Prism.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside = Prism.languages.moonscript;
+
+Prism.languages.moon = Prism.languages.moonscript;
+
+return Prism; })
\ No newline at end of file
-define(["prism/prism","prism/components/prism-javascript","prism/components/prism-jsdoc"], function () {
+define(["prism/prism","prism/components/prism-javascript"], function () {
Prism.languages.n4js = Prism.languages.extend('javascript', {
// Keywords from N4JS language spec: https://numberfour.github.io/n4js/spec/N4JSSpec.html
'keyword': /\b(?:any|Array|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.neon = {
+ 'comment': {
+ pattern: /#.*/,
+ greedy: true
+ },
+ 'datetime': {
+ pattern: /(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,
+ lookbehind: true,
+ alias: 'number'
+ },
+ 'key': {
+ pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,
+ lookbehind: true,
+ alias: 'atrule'
+ },
+ 'number': {
+ pattern: /(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+\.?\d*|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,
+ lookbehind: true
+ },
+ 'boolean': {
+ pattern: /(^|[[{(=:,\s])(?:true|false|yes|no)(?=$|[\]}),:=\s])/i,
+ lookbehind: true
+ },
+ 'null': {
+ pattern: /(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+ 'string': {
+ pattern: /(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^"\r\n])*")/,
+ lookbehind: true,
+ greedy: true
+ },
+ 'literal': {
+ pattern: /(^|[[{(=:,\s])(?:[^#"\',:=[\]{}()\s`-]|[:-][^"\',=[\]{}()\s])(?:[^,:=\]})(\s]+|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,
+ lookbehind: true,
+ alias: 'string',
+ },
+ 'punctuation': /[,:=[\]{}()-]/,
+};
+
+
+return Prism; })
\ No newline at end of file
*/
Prism.languages.nsis = {
'comment': {
- pattern: /(^|[^\\])(\/\*[\s\S]*?\*\/|[#;].*)/,
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,
lookbehind: true
},
'string': {
pattern: /(^\s*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|Banner|BG(?:Font|Gradient|Image)|BrandingText|BringToFront|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|WriteUTF16LE|Seek|Write|WriteByte|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|LabelAddress|TempFileName)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|Silent)|InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|Name|Nop|ns(?:Dialogs|Exec)|NSISdl|OutFile|Page(?:Callbacks)?|PE(?:DllCharacteristics|SubsysVer)|Pop|Push|Quit|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Unicode|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UninstPage|UnRegDLL|UserInfo|Var|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle)\b/m,
lookbehind: true
},
- 'property': /\b(?:admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user|ARCHIVE|FILE_(ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK((CR|CU|LM)(32|64)?|DD|PD|U)|HKEY_(CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)\b/,
+ 'property': /\b(?:admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user|ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)\b/,
'constant': /\${[\w\.:\^-]+}|\$\([\w\.:\^-]+\)/i,
'variable': /\$\w+/i,
'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/,
}
],
'number': /\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,
- 'type': {
- pattern: /\B['`]\w*/,
- alias: 'variable'
- },
'directive': {
pattern: /\B#\w+/,
+ alias: 'important'
+ },
+ 'label': {
+ pattern: /\B~\w+/,
+ alias: 'function'
+ },
+ 'type_variable': {
+ pattern: /\B'\w+/,
alias: 'function'
},
- 'keyword': /\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|object|of|open|prefix|private|rec|then|sig|struct|to|try|type|val|value|virtual|where|while|with)\b/,
+ 'variant': {
+ pattern: /`\w+/,
+ alias: 'variable'
+ },
+ 'module': {
+ pattern: /\b[A-Z]\w+/,
+ alias: 'variable'
+ },
+ // For the list of keywords and operators,
+ // see: http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sec84
+ 'keyword': /\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,
'boolean': /\b(?:false|true)\b/,
// Custom operators are allowed
- 'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lxor|lsl|lsr|mod|nor|or)\b/,
+ 'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,
'punctuation': /[(){}\[\]|_.,:;]/
};
return Prism; })
\ No newline at end of file
-define(["prism/prism","prism/components/prism-cpp","prism/components/prism-c","prism/components/prism-cpp"], function () {
+define(["prism/prism","prism/components/prism-c"], function () {
(function (Prism) {
/* OpenCL kernel language */
Prism.languages.opencl = Prism.languages.extend('c', {
// Extracted from the official specs (2.0) and http://streamcomputing.eu/downloads/?opencl.lang (opencl-keywords, opencl-types) and http://sourceforge.net/tracker/?func=detail&aid=2957794&group_id=95717&atid=612384 (Words2, partly Words3)
+ // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/scalarDataTypes.html
+ // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/otherDataTypes.html
'keyword': /\b(?:__attribute__|(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|auto|break|case|cl_(?:image_format|mem_fence_flags)|clk_event_t|complex|const|continue|default|do|(?:float|double)(?:16(?:x(?:1|16|2|4|8))?|1x(?:1|16|2|4|8)|2(?:x(?:1|16|2|4|8))?|3|4(?:x(?:1|16|2|4|8))?|8(?:x(?:1|16|2|4|8))?)?|else|enum|event_t|extern|for|goto|(?:u?(?:char|short|int|long)|half|quad|bool)(?:2|3|4|8|16)?|if|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|imaginary|inline|intptr_t|ndrange_t|packed|pipe|ptrdiff_t|queue_t|register|reserve_id_t|restrict|return|sampler_t|signed|size_t|sizeof|static|struct|switch|typedef|uintptr_t|uniform|union|unsigned|void|volatile|while)\b/,
- // Extracted from http://streamcomputing.eu/downloads/?opencl.lang (global-vars, opencl-dev)
- 'function-opencl-kernel': {
- pattern: /\b(?:abs(?:_diff)?|a?(?:cos|sin)(?:h|pi)?|add_sat|aligned|all|and|any|async(?:_work_group_copy|_work_group_strided_copy)?|atan(?:2?(?:pi)?|h)?|atom_(?:add|and|cmpxchg|dec|inc|max|min|or|sub|xchg|xor)|barrier|bitselect|cbrt|ceil|clamp|clz|copies|copysign|cross|degrees|distance|dot|endian|erf|erfc|exp(?:2|10)?|expm1|fabs|fast_(?:distance|length|normalize)|fdim|floor|fma|fmax|fmin|fract|frexp|fro|from|get_(?:global_(?:id|offset|size)|group_id|image_(?:channel_data_type|channel_order|depth|dim|height|width)|local(?:_id|_size)|num_groups|work_dim)|hadd|(?:half|native)_(?:cos|divide|exp(?:2|10)?|log(?:2|10)?|powr|recip|r?sqrt|sin|tan)|hypot|ilogb|is(?:equal|finite|greater(?:equal)?|inf|less(?:equal|greater)?|nan|normal|notequal|(?:un)?ordered)|ldexp|length|lgamma|lgamma_r|log(?:b|1p|2|10)?|mad(?:24|_hi|_sat)?|max|mem(?:_fence)?|min|mix|modf|mul24|mul_hi|nan|nextafter|normalize|pow[nr]?|prefetch|radians|read_(?:image)(?:f|h|u?i)|read_mem_fence|remainder|remquo|reqd_work_group_size|rhadd|rint|rootn|rotate|round|rsqrt|select|shuffle2?|sign|signbit|sincos|smoothstep|sqrt|step|sub_sat|tan|tanh|tanpi|tgamma|to|trunc|upsample|vec_(?:step|type_hint)|v(?:load|store)(?:_half)?(?:2|3|4|8|16)?|v(?:loada_half|storea?(?:_half)?)(?:2|3|4|8|16)?(?:_(?:rte|rtn|rtp|rtz))?|wait_group_events|work_group_size_hint|write_image(?:f|h|u?i)|write_mem_fence)\b/,
- alias: 'function'
- },
// Extracted from http://streamcomputing.eu/downloads/?opencl.lang (opencl-const)
+ // Math Constants: https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/mathConstants.html
+ // Macros and Limits: https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/macroLimits.html
'constant-opencl-kernel': {
- pattern: /\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:LOCAL|GLOBAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT)_(?:DIG|EPSILON|MANT_DIG|(?:MIN|MAX)(?:(?:_10)?_EXP)?)|FLT_RADIX|HUGE_VALF|INFINITY|(?:INT|LONG|SCHAR|SHRT|UCHAR|UINT|ULONG)_(?:MAX|MIN)|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:10|2)E?|PI[24]?|SQRT(?:1_2|2))|NAN)\b/,
+ pattern: /\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:LOCAL|GLOBAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|MANT_DIG|(?:MIN|MAX)(?:(?:_10)?_EXP)?)|FLT_RADIX|HUGE_VALF?|INFINITY|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|(?:UCHAR|USHRT|UINT|ULONG)_MAX|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:10|2)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN)\b/,
alias: 'constant'
- }
+ },
+ 'boolean': /\b(?:false|true)\b/,
+ 'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]*/i
});
var attributes = {
/* OpenCL host API */
Prism.languages.insertBefore('c', 'keyword', attributes);
- // Extracted from doxygen class list http://github.khronos.org/OpenCL-CLHPP/annotated.html
- attributes['type-opencl-host-c++'] = {
- pattern: /\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|Sampler|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|UserEvent)\b/,
- alias: 'keyword'
- };
+
// C++ includes everything from the OpenCL C host API plus the classes defined in cl2.h
- Prism.languages.insertBefore('cpp', 'keyword', attributes);
+ if (Prism.languages.cpp) {
+ // Extracted from doxygen class list http://github.khronos.org/OpenCL-CLHPP/annotated.html
+ attributes['type-opencl-host-cpp'] = {
+ pattern: /\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|Sampler|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|UserEvent)\b/,
+ alias: 'keyword'
+ };
+
+ Prism.languages.insertBefore('cpp', 'keyword', attributes);
+ }
}(Prism));
return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+(function (Prism) {
+
+ // Pascaligo is a layer 2 smart contract language for the tezos blockchain
+
+ var braces = /\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)/.source;
+ var type = /(?:\w+(?:<braces>)?|<braces>)/.source.replace(/<braces>/g, function () { return braces; });
+
+ var pascaligo = Prism.languages.pascaligo = {
+ 'comment': /\(\*[\s\S]+?\*\)|\/\/.*/,
+ 'string': {
+ pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\^[a-z]/i,
+ greedy: true
+ },
+ 'class-name': [
+ {
+ pattern: RegExp(/(\btype\s+\w+\s+is\s+)<type>/.source.replace(/<type>/g, function () { return type; }), 'i'),
+ lookbehind: true,
+ inside: null // see below
+ },
+ {
+ pattern: RegExp(/<type>(?=\s+is\b)/.source.replace(/<type>/g, function () { return type; }), 'i'),
+ inside: null // see below
+ },
+ {
+ pattern: RegExp(/(:\s*)<type>/.source.replace(/<type>/g, function () { return type; })),
+ lookbehind: true,
+ inside: null // see below
+ }
+ ],
+ 'keyword': {
+ pattern: /(^|[^&])\b(?:begin|block|case|const|else|end|fail|for|from|function|if|is|nil|of|remove|return|skip|then|type|var|while|with)\b/i,
+ lookbehind: true
+ },
+ 'boolean': {
+ pattern: /(^|[^&])\b(?:True|False)\b/i,
+ lookbehind: true
+ },
+ 'builtin': {
+ pattern: /(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i,
+ lookbehind: true
+ },
+ 'function': /\w+(?=\s*\()/i,
+ 'number': [
+ // Hexadecimal, octal and binary
+ /%[01]+|&[0-7]+|\$[a-f\d]+/i,
+ // Decimal
+ /\b\d+(?:\.\d+)?(?:e[+-]?\d+)?(?:mtz|n)?/i
+ ],
+ 'operator': /->|=\/=|\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=|]|\b(?:and|mod|or)\b/,
+ 'punctuation': /\(\.|\.\)|[()\[\]:;,.{}]/
+ };
+
+ var classNameInside = ['comment', 'keyword', 'builtin', 'operator', 'punctuation'].reduce(function (accum, key) {
+ accum[key] = pascaligo[key];
+ return accum;
+ }, {});
+
+ pascaligo["class-name"].forEach(function (p) {
+ p.inside = classNameInside;
+ });
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.pcaxis = {
+ 'string': /"[^"]*"/,
+ 'keyword': {
+ pattern: /((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,
+ lookbehind: true,
+ greedy: true,
+ inside: {
+ 'keyword': /^[-A-Z\d]+/,
+ 'language': {
+ pattern: /^(\s*)\[[-\w]+\]/,
+ lookbehind: true,
+ inside: {
+ 'punctuation': /^\[|\]$/,
+ 'property': /[-\w]+/
+ }
+ },
+ 'sub-key': {
+ pattern: /^(\s*)[\s\S]+/,
+ lookbehind: true,
+ inside: {
+ 'parameter': {
+ pattern: /"[^"]*"/,
+ alias: 'property'
+ },
+ 'punctuation': /^\(|\)$|,/
+ }
+ }
+ }
+ },
+ 'operator': /=/,
+ 'tlist': {
+ pattern: /TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,
+ greedy: true,
+ inside: {
+ 'function': /^TLIST/,
+ 'property': {
+ pattern: /^(\s*\(\s*)\w+/,
+ lookbehind: true
+ },
+ 'string': /"[^"]*"/,
+ 'punctuation': /[(),]/,
+ 'operator': /-/
+ }
+ },
+ 'punctuation': /[;,]/,
+ 'number': {
+ pattern: /(^|\s)\d+(?:\.\d+)?(?!\S)/,
+ lookbehind: true
+ },
+ 'boolean': /YES|NO/,
+};
+
+Prism.languages.px = Prism.languages.pcaxis;
+
+return Prism; })
\ No newline at end of file
pattern: /\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,
greedy: true
},
-
+
// q a...a
{
pattern: /\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1/,
greedy: true
},
-
+
// q(...)
{
pattern: /\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/,
greedy: true
},
-
+
// q{...}
{
pattern: /\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/,
greedy: true
},
-
+
// q[...]
{
pattern: /\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/,
greedy: true
},
-
+
// q<...>
{
pattern: /\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/,
pattern: /\b(?:m|qr)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,
greedy: true
},
-
+
// m a...a
{
pattern: /\b(?:m|qr)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/,
greedy: true
},
-
+
// m(...)
{
pattern: /\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/,
greedy: true
},
-
+
// m{...}
{
pattern: /\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/,
greedy: true
},
-
+
// m[...]
{
pattern: /\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/,
greedy: true
},
-
+
// m<...>
{
pattern: /\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/,
lookbehind: true,
greedy: true
},
-
+
// s a...a...a
{
pattern: /(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/,
lookbehind: true,
greedy: true
},
-
+
// s(...)(...)
{
pattern: /(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/,
lookbehind: true,
greedy: true
},
-
+
// s{...}{...}
{
pattern: /(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/,
lookbehind: true,
greedy: true
},
-
+
// s[...][...]
{
pattern: /(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/,
lookbehind: true,
greedy: true
},
-
+
// s<...><...>
{
pattern: /(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/,
lookbehind: true,
greedy: true
},
-
+
// /.../
// The look-ahead tries to prevent two divisions on
// the same line from being highlighted as regex.
// This does not support multi-line regex.
{
- pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/,
+ pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor|x)\b))/,
greedy: true
}
],
var string_interpolation = {
pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/,
lookbehind: true,
- inside: {
- rest: Prism.languages.php
- }
+ inside: Prism.languages.php
};
Prism.languages.insertBefore('php', 'string', {
return;
}
- var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/ig;
+ var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/ig;
Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);
});
define(["prism/prism","prism/components/prism-php","prism/components/prism-javadoclike"], function () {
(function (Prism) {
- var typeExpression = /(?:[a-zA-Z]\w*|[|\\[\]])+/.source;
+ var typeExpression = /(?:\b[a-zA-Z]\w*|[|\\[\]])+/.source;
Prism.languages.phpdoc = Prism.languages.extend('javadoclike', {
'parameter': {
--- /dev/null
+define(["prism/prism"], function () {
+// https://docs.microsoft.com/en-us/powerquery-m/power-query-m-language-specification
+
+Prism.languages.powerquery = {
+ 'comment': {
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/).*)/,
+ lookbehind: true
+ },
+ 'quoted-identifier': {
+ pattern: /#"(?:[^"\r\n]|"")*"(?!")/,
+ greedy: true,
+ alias: 'variable'
+ },
+ 'string': {
+ pattern: /"(?:[^"\r\n]|"")*"(?!")/,
+ greedy: true
+ },
+ 'constant': [
+ /\bDay\.(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)\b/,
+ /\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,
+ /\bOccurrence\.(?:First|Last|All)\b/,
+ /\bOrder\.(?:Ascending|Descending)\b/,
+ /\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,
+ /\bMissingField\.(?:Error|Ignore|UseNull)\b/,
+ /\bQuoteStyle\.(?:Csv|None)\b/,
+ /\bJoinKind\.(?:Inner|LeftOuter|RightOuter|FullOuter|LeftAnti|RightAnti)\b/,
+ /\bGroupKind\.(?:Global|Local)\b/,
+ /\bExtraValues\.(?:List|Ignore|Error)\b/,
+ /\bJoinAlgorithm\.(?:Dynamic|PairwiseHash|SortMerge|LeftHash|RightHash|LeftIndex|RightIndex)\b/,
+ /\bJoinSide\.(?:Left|Right)\b/,
+ /\bPrecision\.(?:Double|Decimal)\b/,
+ /\bRelativePosition\.From(?:End|Start)\b/,
+ /\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf8|Utf16|Windows)\b/,
+ /\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Int8|Int16|Int32|Int64|Function|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,
+ /\bnull\b/
+ ],
+ 'boolean': /\b(?:true|false)\b/,
+ 'keyword': /\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,
+ 'function': {
+ pattern: /(^|[^#\w.])(?!\d)[\w.]+(?=\s*\()/,
+ lookbehind: true
+ },
+ 'data-type': {
+ pattern: /\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time|type)\b/,
+ alias: 'variable'
+ },
+ 'number': {
+ pattern: /\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,
+ lookbehind: true
+ },
+ 'operator': /[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,
+ 'punctuation': /[,;\[\](){}]/
+};
+
+Prism.languages.pq = Prism.languages['powerquery'];
+Prism.languages.mscript = Prism.languages['powerquery']
+return Prism; })
\ No newline at end of file
// per http://technet.microsoft.com/en-us/library/hh847744.aspx
'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,
+ 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: true
},
'punctuation': /[|{}[\];(),.]/
define(["prism/prism","prism/components/prism-clike"], function () {
-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'
- }
-});
+(function (Prism) {
+
+ var builtinTypes = /\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/;
+
+ Prism.languages.protobuf = Prism.languages.extend('clike', {
+ 'class-name': {
+ pattern: /(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,
+ lookbehind: true
+ },
+ 'keyword': /\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|service|syntax|to)\b/
+ });
+
+ Prism.languages.insertBefore('protobuf', 'operator', {
+ 'map': {
+ pattern: /\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[A-Za-z_]\w*\s*[=;])/,
+ alias: 'class-name',
+ inside: {
+ 'punctuation': /[<>.,]/,
+ 'builtin': builtinTypes
+ }
+ },
+ 'builtin': builtinTypes,
+ 'positional-class-name': {
+ pattern: /(?:\b|\B\.)[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s+[A-Za-z_]\w*\s*[=;])/,
+ alias: 'class-name',
+ inside: {
+ 'punctuation': /\./
+ }
+ },
+ 'annotation': {
+ pattern: /(\[\s*)[A-Za-z_]\w*(?=\s*=)/,
+ lookbehind: true
+ }
+ });
+
+}(Prism));
return Prism; })
\ No newline at end of file
-define(["prism/prism","prism/components/prism-markup","prism/components/prism-javascript","prism/components/prism-coffeescript","prism/components/prism-ejs","prism/components/prism-handlebars","prism/components/prism-less","prism/components/prism-livescript","prism/components/prism-markdown","prism/components/prism-scss","prism/components/prism-stylus","prism/components/prism-twig"], function () {
+define(["prism/prism","prism/components/prism-markup","prism/components/prism-javascript"], function () {
(function(Prism) {
// TODO:
// - Add CSS highlighting inside <style> tags
'multiline-script': {
pattern: /(^([\t ]*)script\b.*\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/m,
lookbehind: true,
- inside: {
- rest: Prism.languages.javascript
- }
+ inside: Prism.languages.javascript
},
// See at the end of the file for known filters
'markup': {
pattern: /(^[\t ]*)<.+/m,
lookbehind: true,
- inside: {
- rest: Prism.languages.markup
- }
+ inside: Prism.languages.markup
},
'doctype': {
pattern: /((?:^|\n)[\t ]*)doctype(?: .+)?/,
pattern: /^\+\w+/,
alias: 'function'
},
- 'rest': Prism.languages.javascript
+ rest: Prism.languages.javascript
}
}
],
'script': {
pattern: /(^[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*[\t ]+).+/m,
lookbehind: true,
- inside: {
- rest: Prism.languages.javascript
- }
+ inside: Prism.languages.javascript
},
'plain-text': {
'attributes': [
{
pattern: /&[^(]+\([^)]+\)/,
- inside: {
- rest: Prism.languages.javascript
- }
+ inside: Prism.languages.javascript
},
{
pattern: /\([^)]+\)/,
'attr-value': {
pattern: /(=\s*)(?:\{[^}]*\}|[^,)\r\n]+)/,
lookbehind: true,
- inside: {
- rest: Prism.languages.javascript
- }
+ inside: Prism.languages.javascript
},
'attr-name': /[\w-]+(?=\s*!?=|\s*[,)])/,
'punctuation': /[!=(),]+/
{
pattern: /(^[\t ]*(?:-|!?=)).+/m,
lookbehind: true,
- inside: {
- rest: Prism.languages.javascript
- }
+ inside: Prism.languages.javascript
}
],
'punctuation': /[.\-!=|]+/
filter = typeof filter === 'string' ? {filter: filter, language: filter} : filter;
if (Prism.languages[filter.language]) {
all_filters['filter-' + filter.filter] = {
- pattern: RegExp(filter_pattern.replace('{{filter_name}}', filter.filter), 'm'),
+ pattern: RegExp(filter_pattern.replace('{{filter_name}}', function () { return filter.filter; }), 'm'),
lookbehind: true,
inside: {
'filter-name': {
-define(["prism/prism","prism/components/prism-c","prism/components/prism-cpp","prism/components/prism-fortran"], function () {
+define(["prism/prism"], function () {
(function (Prism) {
Prism.languages.pure = {
'comment': [
lookbehind: true
},
'decorator': {
- pattern: /(^\s*)@\w+(?:\.\w+)*/i,
+ pattern: /(^\s*)@\w+(?:\.\w+)*/im,
lookbehind: true,
alias: ['annotation', 'punctuation'],
inside: {
Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
Prism.languages.py = Prism.languages.python;
+
return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism","prism/components/prism-javascript"], function () {
+(function (Prism) {
+
+ var jsString = /"(?:\\.|[^\\"\r\n])*"|'(?:\\.|[^\\'\r\n])*'/.source;
+ var jsComment = /\/\/.*|\/\*(?:(?!\*\/)[\s\S])*\*\//.source;
+
+ var jsExpr = /(?:[^\\()[\]{}"'/]|<string>|\/(?![*/])|<comment>|\(<expr>*\)|\[<expr>*\]|\{<expr>*\}|\\[\s\S])/
+ .source.replace(/<string>/g, function () { return jsString; }).replace(/<comment>/g, function () { return jsComment; });
+
+ // the pattern will blow up, so only a few iterations
+ for (var i = 0; i < 2; i++) {
+ jsExpr = jsExpr.replace(/<expr>/g, function () { return jsExpr; });
+ }
+ jsExpr = jsExpr.replace(/<expr>/g, '[^\\s\\S]');
+
+
+ Prism.languages.qml = {
+ 'comment': {
+ pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
+ greedy: true
+ },
+ 'javascript-function': {
+ pattern: RegExp(/((?:^|;)[ \t]*)function\s+[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*\(<js>*\)\s*\{<js>*\}/.source.replace(/<js>/g, function () { return jsExpr; }), 'm'),
+ lookbehind: true,
+ greedy: true,
+ alias: 'language-javascript',
+ inside: Prism.languages.javascript
+ },
+ 'class-name': {
+ pattern: /((?:^|[:;])[ \t]*)(?!\d)\w+(?=[ \t]*\{|[ \t]+on\b)/m,
+ lookbehind: true
+ },
+ 'property': [
+ {
+ pattern: /((?:^|[;{])[ \t]*)(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,
+ lookbehind: true
+ },
+ {
+ pattern: /((?:^|[;{])[ \t]*)property[ \t]+(?!\d)\w+(?:\.\w+)*[ \t]+(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,
+ lookbehind: true,
+ inside: {
+ 'keyword': /^property/,
+ 'property': /\w+(?:\.\w+)*/
+ }
+ }
+ ],
+ 'javascript-expression': {
+ pattern: RegExp(/(:[ \t]*)(?![\s;}[])(?:(?!$|[;}])<js>)+/.source.replace(/<js>/g, function () { return jsExpr; }), 'm'),
+ lookbehind: true,
+ greedy: true,
+ alias: 'language-javascript',
+ inside: Prism.languages.javascript
+ },
+ 'string': /"(?:\\.|[^\\"\r\n])*"/,
+ 'keyword': /\b(?:as|import|on)\b/,
+ 'punctuation': /[{}[\]:;,]/
+ };
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
},
// Overridden to allow unescaped multi-line strings
'string': {
- pattern: /("|')(\\[\s\S]|(?!\1)[^\\])*\1/,
+ pattern: /("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,
greedy: true
},
'variable': /\$(?!\d)\w+\b/,
},
'function': /\$?\b(?!\d)\w+(?=\()/
});
+
return Prism; })
\ No newline at end of file
define(["prism/prism","prism/components/prism-clike"], function () {
Prism.languages.reason = Prism.languages.extend('clike', {
- 'comment': {
- pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
- lookbehind: true
- },
'string': {
pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
greedy: true
// We can't match functions property, so let's not even try.
delete Prism.languages.reason.function;
+
return Prism; })
\ No newline at end of file
-define(["prism/prism","prism/components/prism-actionscript","prism/components/prism-coffeescript","prism/components/prism-flow","prism/components/prism-javascript","prism/components/prism-typescript","prism/components/prism-vala"], function () {
+define(["prism/prism"], function () {
(function (Prism) {
var specialEscape = {
}
},
{
- pattern: /(?:\b[a-z\d](?:[_.:+]?[a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,
+ pattern: /(?:\b[a-z\d]+(?:[_.:+][a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,
alias: 'string',
inside: {
'punctuation': /^_?`|`$|`?_?_$/
lookbehind: true
}
};
+
return Prism; })
\ No newline at end of file
'character': /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,
'regex': {
- pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/(?=\s*($|[\r\n,.;})]))/,
+ pattern: /(^|[^/])\/(?!\/)(?:\[.+?]|\\.|[^/\\\r\n])+\/(?=\s*(?:$|[\r\n,.;})]))/,
lookbehind: true,
greedy: true
},
--- /dev/null
+define(["prism/prism"], function () {
+(function (Prism) {
+
+ var comment = {
+ pattern: /(^[ \t]*| {2}|\t)#.*/m,
+ lookbehind: true,
+ greedy: true
+ };
+
+ var variable = {
+ pattern: /((?:^|[^\\])(?:\\{2})*)[$@&%]\{(?:[^{}\r\n]|\{[^{}\r\n]*\})*\}/,
+ lookbehind: true,
+ inside: {
+ 'punctuation': /^[$@&%]\{|\}$/
+ }
+ };
+
+ function createSection(name, inside) {
+ var extendecInside = {};
+
+ extendecInside['section-header'] = {
+ pattern: /^ ?\*{3}.+?\*{3}/,
+ alias: 'keyword'
+ };
+
+ // copy inside tokens
+ for (var token in inside) {
+ extendecInside[token] = inside[token];
+ }
+
+ extendecInside['tag'] = {
+ pattern: /([\r\n](?: |\t)[ \t]*)\[[-\w]+\]/,
+ lookbehind: true,
+ inside: {
+ 'punctuation': /\[|\]/
+ }
+ };
+ extendecInside['variable'] = variable;
+ extendecInside['comment'] = comment;
+
+ return {
+ pattern: RegExp(/^ ?\*{3}[ \t]*<name>[ \t]*\*{3}(?:.|[\r\n](?!\*{3}))*/.source.replace(/<name>/g, function () { return name; }), 'im'),
+ alias: 'section',
+ inside: extendecInside
+ };
+ }
+
+
+ var docTag = {
+ pattern: /(\[Documentation\](?: |\t)[ \t]*)(?![ \t]|#)(?:.|[ \t]*(?:\r\n?|\n)[ \t]*\.{3}[ \t]*)+/,
+ lookbehind: true,
+ alias: 'string'
+ };
+
+ var testNameLike = {
+ pattern: /([\r\n] ?)(?!#)(?:\S(?:[ \t]\S)*)+/,
+ lookbehind: true,
+ alias: 'function',
+ inside: {
+ 'variable': variable
+ }
+ };
+
+ var testPropertyLike = {
+ pattern: /([\r\n](?: |\t)[ \t]*)(?!\[|\.{3}|#)(?:\S(?:[ \t]\S)*)+/,
+ lookbehind: true,
+ inside: {
+ 'variable': variable
+ }
+ };
+
+ Prism.languages['robotframework'] = {
+ 'settings': createSection('Settings', {
+ 'documentation': {
+ pattern: /([\r\n] ?Documentation(?: |\t)[ \t]*)(?![ \t]|#)(?:.|[ \t]*(?:\r\n?|\n)[ \t]*\.{3}[ \t]*)+/,
+ lookbehind: true,
+ alias: 'string'
+ },
+ 'property': {
+ pattern: /([\r\n] ?)(?!\.{3}|#)(?:\S(?:[ \t]\S)*)+/,
+ lookbehind: true
+ }
+ }),
+ 'variables': createSection('Variables'),
+ 'test-cases': createSection('Test Cases', {
+ 'test-name': testNameLike,
+ 'documentation': docTag,
+ 'property': testPropertyLike
+ }),
+ 'keywords': createSection('Keywords', {
+ 'keyword-name': testNameLike,
+ 'documentation': docTag,
+ 'property': testPropertyLike
+ }),
+ 'tasks': createSection('Tasks', {
+ 'task-name': testNameLike,
+ 'documentation': docTag,
+ 'property': testPropertyLike
+ }),
+ 'comment': comment
+ };
+
+ Prism.languages.robot = Prism.languages['robotframework'];
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
* Original by Samuel Flores
*
* Adds the following new token classes:
- * constant, builtin, variable, symbol, regex
+ * constant, builtin, variable, symbol, regex
*/
-(function(Prism) {
+(function (Prism) {
Prism.languages.ruby = Prism.languages.extend('clike', {
'comment': [
/#.*/,
greedy: true
}
],
- 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/
+ 'class-name': {
+ pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,
+ lookbehind: true,
+ inside: {
+ 'punctuation': /[.\\]/
+ }
+ },
+ 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/
});
var interpolation = {
}
},
{
- pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,
+ pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/,
lookbehind: true,
greedy: true
}
},
// Hex, oct, bin, dec numbers with visual separators and type suffix
- 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/,
+ 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/,
// Closure params should not be confused with bitwise OR |
'closure-params': {
define(["prism/prism"], function () {
-Prism.languages.sas = {
- 'datalines': {
- pattern: /^\s*(?:(?:data)?lines|cards);[\s\S]+?(?:\r?\n|\r);/im,
- alias: 'string',
+(function (Prism) {
+
+ var stringPattern = /(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))/.source;
+
+ var number = /\b(?:\d[\da-f]*x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i;
+ var numericConstant = {
+ pattern: RegExp(stringPattern + '[bx]'),
+ alias: 'number'
+ };
+
+ var step = {
+ pattern: /(^|\s+)(?:proc\s+\w+|quit|run|data(?!\=))\b/i,
+ alias: 'keyword',
+ lookbehind: true
+ };
+
+ var comment = [
+ /\/\*[\s\S]*?\*\//,
+ {
+ pattern: /(^\s*|;\s*)\*[^;]*;/m,
+ lookbehind: true
+ }
+ ];
+
+ var string = {
+ pattern: RegExp(stringPattern),
+ greedy: true
+ };
+
+ var punctuation = /[$%@.(){}\[\];,\\]/;
+
+ var func = {
+ pattern: /%?\w+(?=\()/,
+ alias: 'keyword'
+ };
+
+ var args = {
+ 'function': func,
+ 'arg-value': {
+ pattern: /(\s*=\s*)[A-Z\.]+/i,
+ lookbehind: true
+ },
+ 'operator': /=/,
+ 'macro-variable': {
+ pattern: /&[^\.]*\./i,
+ alias: 'string'
+ },
+ 'arg': {
+ pattern: /[A-Z]+/i,
+ alias: 'keyword'
+ },
+ 'number': number,
+ 'numeric-constant': numericConstant,
+ 'punctuation': punctuation,
+ 'string': string
+ };
+
+ var format = {
+ pattern: /\b(?:format|put)\b=?[\w'$.]+/im,
+ inside: {
+ 'keyword': /^(?:format|put)(?=\=)/i,
+ 'equals': /=/,
+ 'format': {
+ pattern: /(?:\w|\$\d)+\.\d?/i,
+ alias: 'number'
+ }
+ }
+ };
+
+ var altformat = {
+ pattern: /\b(?:format|put)\s+[\w']+(?:\s+[$.\w]+)+(?=;)/i,
+ inside: {
+ 'keyword': /^(?:format|put)/i,
+ 'format': {
+ pattern: /[\w$]+\.\d?/,
+ alias: 'number'
+ }
+ }
+ };
+
+ var globalStatements = {
+ pattern: /((?:^|[\s])=?)(?:catname|checkpoint execute_always|dm|endsas|filename|footnote|%include|libname|%list|lock|missing|options|page|resetline|%run|sasfile|skip|sysecho|title\d?)\b/i,
+ lookbehind: true,
+ alias: 'keyword'
+ };
+
+ var submitStatement = {
+ pattern: /(^|\s)(?:submit(?:\s+(?:load|parseonly|norun))?|endsubmit)\b/i,
+ lookbehind: true,
+ alias: 'keyword'
+ };
+
+ var actionSets = /accessControl|cdm|aggregation|aStore|ruleMining|audio|autotune|bayesianNetClassifier|bioMedImage|boolRule|builtins|cardinality|sccasl|clustering|copula|countreg|dataDiscovery|dataPreprocess|dataSciencePilot|dataStep|decisionTree|deepLearn|deepNeural|varReduce|simSystem|ds2|deduplication|ecm|entityRes|espCluster|explainModel|factmac|fastKnn|fcmpact|fedSql|freqTab|gam|gleam|graphSemiSupLearn|gVarCluster|hiddenMarkovModel|hyperGroup|image|iml|ica|kernalPca|langModel|ldaTopic|sparseML|mlTools|mixed|modelPublishing|mbc|network|optNetwork|neuralNet|nonlinear|nmf|nonParametricBayes|optimization|panel|pls|percentile|pca|phreg|qkb|qlim|quantreg|recommend|tsReconcile|deepRnn|regression|reinforcementLearn|robustPca|sampling|sparkEmbeddedProcess|search(?:Analytics)?|sentimentAnalysis|sequence|configuration|session(?:Prop)?|severity|simple|smartData|sandwich|spatialreg|stabilityMonitoring|spc|loadStreams|svDataDescription|svm|table|conditionalRandomFields|text(?:Rule(?:Develop|Score)|Mining|Parse|Topic|Util|Filters|Frequency)|tsInfo|timeData|transpose|uniTimeSeries/.source;
+
+ var casActions = {
+ pattern: RegExp(/(^|\s)(?:action\s+)?(?:<act>)\.[a-z]+\b[^;]+/.source.replace(/<act>/g, function () { return actionSets; }), 'i'),
+ lookbehind: true,
inside: {
- 'keyword': {
- pattern: /^(\s*)(?:(?:data)?lines|cards)/i,
- lookbehind: true
+ 'keyword': RegExp(/(?:<act>)\.[a-z]+\b/.source.replace(/<act>/g, function () { return actionSets; }), 'i'),
+ 'action': {
+ pattern: /(?:action)/i,
+ alias: 'keyword'
},
- 'punctuation': /;/
+ 'function': func,
+ 'arg-value': args['arg-value'],
+ 'operator': args.operator,
+ 'comment': comment,
+ 'argument': args.arg,
+ 'number': number,
+ 'numeric-constant': numericConstant,
+ 'punctuation': punctuation,
+ 'string': string
}
- },
- 'comment': [
- {
- pattern: /(^\s*|;\s*)\*.*;/m,
- lookbehind: true
+ };
+
+ var keywords = {
+ pattern: /((?:^|\s)=?)(?:after|analysis|and|array|barchart|barwidth|begingraph|by|call|cas|cbarline|cfill|class(?:lev)?|close|column|computed?|contains|continue|data(?=\=)|define|delete|describe|document|do\s+over|do|dol|drop|dul|end(?:source|comp)?|entryTitle|else|eval(?:uate)?|exec(?:ute)?|exit|fill(?:attrs)?|file(?:name)?|flist|fnc|function(?:list)?|goto|global|group(?:by)?|headline|headskip|histogram|if|infile|keep|keylabel|keyword|label|layout|leave|legendlabel|length|libname|loadactionset|merge|midpoints|name|noobs|nowd|_?null_|ods|options|or|otherwise|out(?:put)?|over(?:lay)?|plot|put|print|raise|ranexp|rannor|rbreak|retain|return|select|set|session|sessref|source|statgraph|sum|summarize|table|temp|terminate|then\s+do|then|title\d?|to|var|when|where|xaxisopts|yaxisopts|y2axisopts)\b/i,
+ lookbehind: true,
+ };
+
+ Prism.languages.sas = {
+ 'datalines': {
+ pattern: /^(\s*)(?:(?:data)?lines|cards);[\s\S]+?^\s*;/im,
+ lookbehind: true,
+ alias: 'string',
+ inside: {
+ 'keyword': {
+ pattern: /^(?:(?:data)?lines|cards)/i
+ },
+ 'punctuation': /;/
+ }
},
- /\/\*[\s\S]+?\*\//
- ],
- 'datetime': {
- // '1jan2013'd, '9:25:19pm't, '18jan2003:9:27:05am'dt
- pattern: /'[^']+'(?:dt?|t)\b/i,
- alias: 'number'
- },
- 'string': {
- pattern: /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
- greedy: true
- },
- 'keyword': /\b(?:data|else|format|if|input|proc\s\w+|quit|run|then|libname|set|output|options)\b/i,
- // Decimal (1.2e23), hexadecimal (0c1x)
- 'number': /\b(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,
- 'operator': /\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,
- 'punctuation': /[$%@.(){}\[\];,\\]/
-};
+
+ 'proc-sql': {
+ pattern: /(^proc\s+(?:fed)?sql(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,
+ lookbehind: true,
+ inside: {
+ 'sql': {
+ pattern: RegExp(/^[ \t]*(?:select|alter\s+table|(?:create|describe|drop)\s+(?:index|table(?:\s+constraints)?|view)|create\s+unique\s+index|insert\s+into|update)(?:<str>|[^;"'])+;/.source.replace(/<str>/g, function () { return stringPattern; }), 'im'),
+ alias: 'language-sql',
+ inside: Prism.languages.sql
+ },
+ 'global-statements': globalStatements,
+ 'sql-statements': {
+ pattern: /(^|\s)(?:disconnect\s+from|exec(?:ute)?|begin|commit|rollback|reset|validate)\b/i,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+ 'number': number,
+ 'numeric-constant': numericConstant,
+ 'punctuation': punctuation,
+ 'string': string
+ }
+ },
+
+ 'proc-groovy': {
+ pattern: /(^proc\s+groovy(?:\s+[\w|=]+)?;)(?:\s*submit)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,
+ lookbehind: true,
+ inside: {
+ 'groovy': {
+ pattern: RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:<str>|[^"'])+?(?=endsubmit;)/.source.replace(/<str>/g, function () { return stringPattern; }), 'im'),
+ lookbehind: true,
+ alias: 'language-groovy',
+ inside: Prism.languages.groovy
+ },
+ 'submit-statement': submitStatement,
+ 'global-statements': globalStatements,
+ 'number': number,
+ 'numeric-constant': numericConstant,
+ 'punctuation': punctuation,
+ 'string': string
+ }
+ },
+
+ 'proc-lua': {
+ pattern: /(^proc\s+lua(?:\s+[\w|=]+)?;)(?:\s*submit)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im,
+ lookbehind: true,
+ inside: {
+ 'lua': {
+ pattern: RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:<str>|[^"'])+?(?=endsubmit;)/.source.replace(/<str>/g, function () { return stringPattern; }), 'im'),
+ lookbehind: true,
+ alias: 'language-lua',
+ inside: Prism.languages.lua
+ },
+ 'submit-statement': submitStatement,
+ 'global-statements': globalStatements,
+ 'number': number,
+ 'numeric-constant': numericConstant,
+ 'punctuation': punctuation,
+ 'string': string
+ }
+ },
+
+ 'proc-cas': {
+ pattern: /(^proc\s+cas(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|data);|(?![\s\S]))/im,
+ lookbehind: true,
+ inside: {
+ 'statement-var': {
+ pattern: /((?:^|\s)=?)saveresult\s+[^;]+/im,
+ lookbehind: true,
+ inside: {
+ 'statement': {
+ pattern: /^saveresult\s+\S+/i,
+ inside: {
+ keyword: /^(?:saveresult)/i
+ }
+ },
+ rest: args
+ }
+ },
+ 'cas-actions': casActions,
+ 'statement': {
+ pattern: /((?:^|\s)=?)(?:default|(?:un)?set|on|output|upload)[^;]+/im,
+ lookbehind: true,
+ inside: args
+ },
+ 'step': step,
+ 'keyword': keywords,
+ 'function': func,
+ 'comment': comment,
+ 'format': format,
+ 'altformat': altformat,
+ 'global-statements': globalStatements,
+ 'number': number,
+ 'numeric-constant': numericConstant,
+ 'punctuation': punctuation,
+ 'string': string
+ }
+ },
+
+ 'proc-args': {
+ pattern: RegExp(/(^proc\s+\w+\s+)(?!\s)(?:[^;"']|<str>)+;/.source.replace(/<str>/g, function () { return stringPattern; }), 'im'),
+ lookbehind: true,
+ inside: args
+ },
+
+ /*Special keywords within macros*/
+ 'macro-keyword': {
+ pattern: /((?:^|\s)=?)%(?:ABORT|BQUOTE|BY|CMS|COPY|DISPLAY|DO|ELSE|END|EVAL|GLOBAL|GO|GOTO|IF|INC|INCLUDE|INDEX|INPUT|KTRIM|LENGTH|LET|LIST|LOCAL|NRBQUOTE|NRQUOTE|NRSTR|PUT|QKTRIM|QSCAN|QSUBSTR|QSYSFUNC|QUOTE|QUPCASE|RETURN|RUN|SCAN|STR|SUBSTR|SUPERQ|SYMDEL|SYMGLOBL|SYMLOCAL|SYMEXIST|SYSCALL|SYSEVALF|SYSEXEC|SYSFUNC|SYSGET|SYSRPUT|THEN|TO|TSO|UNQUOTE|UNTIL|UPCASE|WHILE|WINDOW)\b/i,
+ lookbehind: true,
+ alias: 'keyword'
+ },
+ 'macro-declaration': {
+ pattern: /^%macro[^;]+(?=;)/im,
+ inside: {
+ 'keyword': /%macro/i,
+ }
+ },
+ 'macro-end': {
+ pattern: /^%mend[^;]+(?=;)/im,
+ inside: {
+ 'keyword': /%mend/i,
+ }
+ },
+ /*%_zscore(headcir, _lhc, _mhc, _shc, headcz, headcpct, _Fheadcz); */
+ 'macro': {
+ pattern: /%_\w+(?=\()/,
+ alias: 'keyword'
+ },
+ 'input': {
+ pattern: /\binput\s+[-\w\s/*.$&]+;/i,
+ inside: {
+ 'input': {
+ alias: 'keyword',
+ pattern: /^input/i,
+ },
+ 'comment': comment,
+ 'number': number,
+ 'numeric-constant': numericConstant
+ }
+ },
+ 'options-args': {
+ pattern: /(^options)[-'"|/\\<>*+=:()\w\s]*(?=;)/im,
+ lookbehind: true,
+ inside: args
+ },
+ 'cas-actions': casActions,
+ 'comment': comment,
+ 'function': func,
+ 'format': format,
+ 'altformat': altformat,
+ 'numeric-constant': numericConstant,
+ 'datetime': {
+ // '1jan2013'd, '9:25:19pm't, '18jan2003:9:27:05am'dt
+ pattern: RegExp(stringPattern + '(?:dt?|t)'),
+ alias: 'number'
+ },
+ 'string': string,
+ 'step': step,
+ 'keyword': keywords,
+ // In SAS Studio syntax highlighting, these operators are styled like keywords
+ 'operator-keyword': {
+ pattern: /\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,
+ alias: 'operator'
+ },
+ // Decimal (1.2e23), hexadecimal (0c1x)
+ 'number': number,
+ 'operator': /\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?/i,
+ 'punctuation': punctuation
+ };
+
+}(Prism));
return Prism; })
\ No newline at end of file
define(["prism/prism","prism/components/prism-java"], 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: /"""[\s\S]*?"""/,
- greedy: true
- },
- {
- pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
- greedy: true
- }
- ],
+ 'triple-quoted-string': {
+ pattern: /"""[\s\S]*?"""/,
+ greedy: true,
+ alias: 'string'
+ },
+ 'string': {
+ pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
+ greedy: true
+ },
'builtin': /\b(?:String|Int|Long|Short|Byte|Boolean|Double|Float|Char|Any|AnyRef|AnyVal|Unit|Nothing)\b/,
'number': /\b0x[\da-f]*\.?[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e\d+)?[dfl]?/i,
'symbol': /'[^\d\s\\]\w*/
lookbehind: true
},
'number': {
- pattern: /([\s()])[-+]?\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?\b/,
+ pattern: /([\s()])[-+]?(?:\d+\/\d+|\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?)\b/,
lookbehind: true
},
'boolean': /#[tf]/,
define(["prism/prism","prism/components/prism-bash"], function () {
-Prism.languages['shell-session'] = {
- 'command': {
- pattern: /\$(?:[^\r\n'"<]|(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1|((?:^|[^<])<<\s*)["']?(\w+?)["']?\s*(?:\r\n?|\n)(?:[\s\S])*?(?:\r\n?|\n)\3)+/,
- inside: {
- 'bash': {
- pattern: /(\$\s*)[\s\S]+/,
- lookbehind: true,
- alias: 'language-bash',
- inside: Prism.languages.bash
- },
- 'sh': {
- pattern: /^\$/,
- alias: 'important'
+(function (Prism) {
+
+ // CAREFUL!
+ // The following patterns are concatenated, so the group referenced by a back reference is non-obvious!
+
+ var strings = [
+ // normal string
+ // 1 capturing group
+ /(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1/.source,
+
+ // here doc
+ // 1 capturing group
+ /<<-?\s*(\w+?)\s*(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\2/.source,
+
+ // here doc quoted
+ // 2 capturing group
+ /<<-?\s*(["'])(\w+)\3\s*(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\4/.source
+ ].join('|');
+
+ Prism.languages['shell-session'] = {
+ 'info': {
+ // foo@bar:~/files$ exit
+ // foo@bar$ exit
+ pattern: /^[^\r\n$#*!]+(?=[$#])/m,
+ alias: 'punctuation',
+ inside: {
+ 'path': {
+ pattern: /(:)[\s\S]+/,
+ lookbehind: true
+ },
+ 'user': /^[^\s@:$#*!/\\]+@[^\s@:$#*!/\\]+(?=:|$)/,
+ 'punctuation': /:/
+ }
+ },
+ 'command': {
+ pattern: RegExp(/[$#](?:[^\\\r\n'"<]|\\.|<<str>>)+/.source.replace(/<<str>>/g, function () { return strings; })),
+ greedy: true,
+ inside: {
+ 'bash': {
+ pattern: /(^[$#]\s*)[\s\S]+/,
+ lookbehind: true,
+ alias: 'language-bash',
+ inside: Prism.languages.bash
+ },
+ 'shell-symbol': {
+ pattern: /^[$#]/,
+ alias: 'important'
+ }
}
- }
- },
- 'output': {
- pattern: /.(?:.*(?:\r\n?|\n|.$))*/
- // output highlighting?
- }
-}
+ },
+ 'output': /.(?:.*(?:\r\n?|\n|.$))*/
+ };
+
+}(Prism));
return Prism; })
\ No newline at end of file
define(["prism/prism"], function () {
Prism.languages.smalltalk = {
'comment': /"(?:""|[^"])*"/,
+ 'character': {
+ pattern: /\$./,
+ alias: 'string'
+ },
'string': /'(?:''|[^'])*'/,
'symbol': /#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,
'block-arguments': {
}
},
'keyword': /\b(?:nil|true|false|self|super|new)\b/,
- 'character': {
- pattern: /\$./,
- alias: 'string'
- },
'number': [
/\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/,
/\b\d+(?:\.\d+)?(?:e-?\d+)?/
--- /dev/null
+define(["prism/prism","prism/components/prism-clike"], function () {
+Prism.languages.solidity = Prism.languages.extend('clike', {
+ 'class-name': {
+ pattern: /(\b(?:contract|enum|interface|library|new|struct|using)\s+)(?!\d)[\w$]+/,
+ lookbehind: true
+ },
+ 'keyword': /\b(?:_|anonymous|as|assembly|assert|break|calldata|case|constant|constructor|continue|contract|default|delete|do|else|emit|enum|event|external|for|from|function|if|import|indexed|inherited|interface|internal|is|let|library|mapping|memory|modifier|new|payable|pragma|private|public|pure|require|returns?|revert|selfdestruct|solidity|storage|struct|suicide|switch|this|throw|using|var|view|while)\b/,
+ 'operator': /=>|->|:=|=:|\*\*|\+\+|--|\|\||&&|<<=?|>>=?|[-+*/%^&|<>!=]=?|[~?]/
+});
+
+Prism.languages.insertBefore('solidity', 'keyword', {
+ 'builtin': /\b(?:address|bool|string|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?|byte|bytes(?:[1-9]|[12]\d|3[0-2])?)\b/
+});
+
+Prism.languages.insertBefore('solidity', 'number', {
+ 'version': {
+ pattern: /([<>]=?|\^)\d+\.\d+\.\d+\b/,
+ lookbehind: true,
+ alias: 'number',
+ }
+});
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+(function (Prism){
+
+ var guid = {
+ // https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
+ pattern: /\{[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}\}/i,
+ alias: 'constant',
+ inside: {
+ 'punctuation': /[{}]/
+ }
+ };
+
+ Prism.languages['solution-file'] = {
+ 'comment': {
+ pattern: /#.*/,
+ greedy: true
+ },
+ 'string': {
+ pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
+ greedy: true,
+ inside: {
+ 'guid': guid
+ }
+ },
+ 'object': {
+ // Foo
+ // Bar("abs") = 9
+ // EndBar
+ // Prop = TRUE
+ // EndFoo
+ pattern: /^([ \t]*)(?:([A-Z]\w*)\b(?=.*(?:\r\n?|\n)(?:\1[ \t].*(?:\r\n?|\n))*\1End\2(?=[ \t]*$))|End[A-Z]\w*(?=[ \t]*$))/m,
+ lookbehind: true,
+ greedy: true,
+ alias: 'keyword'
+ },
+ 'property': {
+ pattern: /^([ \t]*)[^\r\n"#=()]*[^\s"#=()](?=\s*=)/m,
+ lookbehind: true,
+ inside: {
+ 'guid': guid
+ }
+ },
+ 'guid': guid,
+ 'number': /\b\d+(?:\.\d+)*\b/,
+ 'boolean': /\b(?:FALSE|TRUE)\b/,
+ 'operator': /=/,
+ 'punctuation': /[(),]/
+ };
+
+ Prism.languages['sln'] = Prism.languages['solution-file'];
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism","prism/components/prism-turtle"], function () {
+Prism.languages.sparql = Prism.languages.extend('turtle', {
+ 'variable': {
+ pattern: /[?$]\w+/,
+ greedy: true
+ },
+ 'boolean': /\b(?:true|false)\b/i,
+ }
+);
+
+Prism.languages.insertBefore('sparql', 'punctuation', {
+ 'keyword': [
+ /\b(?:A|ADD|ALL|AS|ASC|ASK|BNODE|BY|CLEAR|CONSTRUCT|COPY|CREATE|DATA|DEFAULT|DELETE|DESC|DESCRIBE|DISTINCT|DROP|EXISTS|FILTER|FROM|GROUP|HAVING|INSERT|INTO|LIMIT|LOAD|MINUS|MOVE|NAMED|NOT|NOW|OFFSET|OPTIONAL|ORDER|RAND|REDUCED|SELECT|SEPARATOR|SERVICE|SILENT|STRUUID|UNION|USING|UUID|VALUES|WHERE)\b/i,
+ /\b(?:ABS|AVG|BIND|BOUND|CEIL|COALESCE|CONCAT|CONTAINS|COUNT|DATATYPE|DAY|ENCODE_FOR_URI|FLOOR|GROUP_CONCAT|HOURS|IF|IRI|isBLANK|isIRI|isLITERAL|isNUMERIC|isURI|LANG|LANGMATCHES|LCASE|MAX|MD5|MIN|MINUTES|MONTH|ROUND|REGEX|REPLACE|sameTerm|SAMPLE|SECONDS|SHA1|SHA256|SHA384|SHA512|STR|STRAFTER|STRBEFORE|STRDT|STRENDS|STRLANG|STRLEN|STRSTARTS|SUBSTR|SUM|TIMEZONE|TZ|UCASE|URI|YEAR)\b(?=\s*\()/i,
+ /\b(?:GRAPH|BASE|PREFIX)\b/i
+ ]
+});
+
+Prism.languages.rq = Prism.languages.sparql;
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages['splunk-spl'] = {
+ 'comment': /`comment\("(?:\\.|[^\\"])*"\)`/,
+ 'string': {
+ pattern: /"(?:\\.|[^\\"])*"/,
+ greedy: true
+ },
+ // https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/ListOfSearchCommands
+ 'keyword': /\b(?:abstract|accum|addcoltotals|addinfo|addtotals|analyzefields|anomalies|anomalousvalue|anomalydetection|append|appendcols|appendcsv|appendlookup|appendpipe|arules|associate|audit|autoregress|bin|bucket|bucketdir|chart|cluster|cofilter|collect|concurrency|contingency|convert|correlate|datamodel|dbinspect|dedup|delete|delta|diff|erex|eval|eventcount|eventstats|extract|fieldformat|fields|fieldsummary|filldown|fillnull|findtypes|folderize|foreach|format|from|gauge|gentimes|geom|geomfilter|geostats|head|highlight|history|iconify|input|inputcsv|inputlookup|iplocation|join|kmeans|kv|kvform|loadjob|localize|localop|lookup|makecontinuous|makemv|makeresults|map|mcollect|metadata|metasearch|meventcollect|mstats|multikv|multisearch|mvcombine|mvexpand|nomv|outlier|outputcsv|outputlookup|outputtext|overlap|pivot|predict|rangemap|rare|regex|relevancy|reltime|rename|replace|rest|return|reverse|rex|rtorder|run|savedsearch|script|scrub|search|searchtxn|selfjoin|sendemail|set|setfields|sichart|sirare|sistats|sitimechart|sitop|sort|spath|stats|strcat|streamstats|table|tags|tail|timechart|timewrap|top|transaction|transpose|trendline|tscollect|tstats|typeahead|typelearner|typer|union|uniq|untable|where|x11|xmlkv|xmlunescape|xpath|xyseries)\b/i,
+ 'operator-word': {
+ pattern: /\b(?:and|as|by|not|or|xor)\b/i,
+ alias: 'operator'
+ },
+ 'function': /\w+(?=\s*\()/,
+ 'property': /\w+(?=\s*=(?!=))/,
+ 'date': {
+ // MM/DD/YYYY(:HH:MM:SS)?
+ pattern: /\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/,
+ alias: 'number'
+ },
+ 'number': /\b\d+(?:\.\d+)?\b/,
+ 'boolean': /\b(?:f|false|t|true)\b/i,
+ 'operator': /[<>=]=?|[-+*/%|]/,
+ 'punctuation': /[()[\],]/
+}
+
+return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism","prism/components/prism-clike"], function () {
+Prism.languages.sqf = Prism.languages.extend('clike', {
+ 'string': {
+ pattern: /"(?:(?:"")?[^"])*"(?!")|'(?:[^'])*'/,
+ greedy: true
+ },
+ 'keyword': /\b(?:breakOut|breakTo|call|case|catch|default|do|echo|else|execVM|execFSM|exitWith|for|forEach|forEachMember|forEachMemberAgent|forEachMemberTeam|from|goto|if|nil|preprocessFile|preprocessFileLineNumbers|private|scopeName|spawn|step|switch|then|throw|to|try|while|with)\b/i,
+ 'magic-variable': {
+ pattern: /\b(?:_exception|_fnc_scriptName|_fnc_scriptNameParent|_forEachIndex|_this|_thisEventHandler|_thisFSM|_thisScript|_x|this|thisList|thisTrigger)\b/i,
+ alias: 'keyword'
+ },
+ 'boolean': /\b(?:true|false)\b/i,
+ 'function': /\b(?:abs|accTime|acos|action|actionIDs|actionKeys|actionKeysImages|actionKeysNames|actionKeysNamesArray|actionName|actionParams|activateAddons|activatedAddons|activateKey|add3DENConnection|add3DENEventHandler|add3DENLayer|addAction|addBackpack|addBackpackCargo|addBackpackCargoGlobal|addBackpackGlobal|addCamShake|addCuratorAddons|addCuratorCameraArea|addCuratorEditableObjects|addCuratorEditingArea|addCuratorPoints|addEditorObject|addEventHandler|addForce|addForceGeneratorRTD|addGoggles|addGroupIcon|addHandgunItem|addHeadgear|addItem|addItemCargo|addItemCargoGlobal|addItemPool|addItemToBackpack|addItemToUniform|addItemToVest|addLiveStats|addMagazine|addMagazineAmmoCargo|addMagazineCargo|addMagazineCargoGlobal|addMagazineGlobal|addMagazinePool|addMagazines|addMagazineTurret|addMenu|addMenuItem|addMissionEventHandler|addMPEventHandler|addMusicEventHandler|addOwnedMine|addPlayerScores|addPrimaryWeaponItem|addPublicVariableEventHandler|addRating|addResources|addScore|addScoreSide|addSecondaryWeaponItem|addSwitchableUnit|addTeamMember|addToRemainsCollector|addTorque|addUniform|addVehicle|addVest|addWaypoint|addWeapon|addWeaponCargo|addWeaponCargoGlobal|addWeaponGlobal|addWeaponItem|addWeaponPool|addWeaponTurret|admin|agent|agents|AGLToASL|aimedAtTarget|aimPos|airDensityCurveRTD|airDensityRTD|airplaneThrottle|airportSide|AISFinishHeal|alive|all3DENEntities|allAirports|allControls|allCurators|allCutLayers|allDead|allDeadMen|allDisplays|allGroups|allMapMarkers|allMines|allMissionObjects|allow3DMode|allowCrewInImmobile|allowCuratorLogicIgnoreAreas|allowDamage|allowDammage|allowFileOperations|allowFleeing|allowGetIn|allowSprint|allPlayers|allSimpleObjects|allSites|allTurrets|allUnits|allUnitsUAV|allVariables|ammo|ammoOnPylon|animate|animateBay|animateDoor|animatePylon|animateSource|animationNames|animationPhase|animationSourcePhase|animationState|append|apply|armoryPoints|arrayIntersect|asin|ASLToAGL|ASLToATL|assert|assignAsCargo|assignAsCargoIndex|assignAsCommander|assignAsDriver|assignAsGunner|assignAsTurret|assignCurator|assignedCargo|assignedCommander|assignedDriver|assignedGunner|assignedItems|assignedTarget|assignedTeam|assignedVehicle|assignedVehicleRole|assignItem|assignTeam|assignToAirport|atan|atan2|atg|ATLToASL|attachedObject|attachedObjects|attachedTo|attachObject|attachTo|attackEnabled|backpack|backpackCargo|backpackContainer|backpackItems|backpackMagazines|backpackSpaceFor|behaviour|benchmark|binocular|blufor|boundingBox|boundingBoxReal|boundingCenter|briefingName|buildingExit|buildingPos|buldozer_EnableRoadDiag|buldozer_IsEnabledRoadDiag|buldozer_LoadNewRoads|buldozer_reloadOperMap|buttonAction|buttonSetAction|cadetMode|callExtension|camCommand|camCommit|camCommitPrepared|camCommitted|camConstuctionSetParams|camCreate|camDestroy|cameraEffect|cameraEffectEnableHUD|cameraInterest|cameraOn|cameraView|campaignConfigFile|camPreload|camPreloaded|camPrepareBank|camPrepareDir|camPrepareDive|camPrepareFocus|camPrepareFov|camPrepareFovRange|camPreparePos|camPrepareRelPos|camPrepareTarget|camSetBank|camSetDir|camSetDive|camSetFocus|camSetFov|camSetFovRange|camSetPos|camSetRelPos|camSetTarget|camTarget|camUseNVG|canAdd|canAddItemToBackpack|canAddItemToUniform|canAddItemToVest|cancelSimpleTaskDestination|canFire|canMove|canSlingLoad|canStand|canSuspend|canTriggerDynamicSimulation|canUnloadInCombat|canVehicleCargo|captive|captiveNum|cbChecked|cbSetChecked|ceil|channelEnabled|cheatsEnabled|checkAIFeature|checkVisibility|civilian|className|clear3DENAttribute|clear3DENInventory|clearAllItemsFromBackpack|clearBackpackCargo|clearBackpackCargoGlobal|clearForcesRTD|clearGroupIcons|clearItemCargo|clearItemCargoGlobal|clearItemPool|clearMagazineCargo|clearMagazineCargoGlobal|clearMagazinePool|clearOverlay|clearRadio|clearVehicleInit|clearWeaponCargo|clearWeaponCargoGlobal|clearWeaponPool|clientOwner|closeDialog|closeDisplay|closeOverlay|collapseObjectTree|collect3DENHistory|collectiveRTD|combatMode|commandArtilleryFire|commandChat|commander|commandFire|commandFollow|commandFSM|commandGetOut|commandingMenu|commandMove|commandRadio|commandStop|commandSuppressiveFire|commandTarget|commandWatch|comment|commitOverlay|compile|compileFinal|completedFSM|composeText|configClasses|configFile|configHierarchy|configName|configNull|configProperties|configSourceAddonList|configSourceMod|configSourceModList|confirmSensorTarget|connectTerminalToUAV|controlNull|controlsGroupCtrl|copyFromClipboard|copyToClipboard|copyWaypoints|cos|count|countEnemy|countFriendly|countSide|countType|countUnknown|create3DENComposition|create3DENEntity|createAgent|createCenter|createDialog|createDiaryLink|createDiaryRecord|createDiarySubject|createDisplay|createGearDialog|createGroup|createGuardedPoint|createLocation|createMarker|createMarkerLocal|createMenu|createMine|createMissionDisplay|createMPCampaignDisplay|createSimpleObject|createSimpleTask|createSite|createSoundSource|createTask|createTeam|createTrigger|createUnit|createVehicle|createVehicleCrew|createVehicleLocal|crew|ctAddHeader|ctAddRow|ctClear|ctCurSel|ctData|ctFindHeaderRows|ctFindRowHeader|ctHeaderControls|ctHeaderCount|ctRemoveHeaders|ctRemoveRows|ctrlActivate|ctrlAddEventHandler|ctrlAngle|ctrlAutoScrollDelay|ctrlAutoScrollRewind|ctrlAutoScrollSpeed|ctrlChecked|ctrlClassName|ctrlCommit|ctrlCommitted|ctrlCreate|ctrlDelete|ctrlEnable|ctrlEnabled|ctrlFade|ctrlHTMLLoaded|ctrlIDC|ctrlIDD|ctrlMapAnimAdd|ctrlMapAnimClear|ctrlMapAnimCommit|ctrlMapAnimDone|ctrlMapCursor|ctrlMapMouseOver|ctrlMapScale|ctrlMapScreenToWorld|ctrlMapWorldToScreen|ctrlModel|ctrlModelDirAndUp|ctrlModelScale|ctrlParent|ctrlParentControlsGroup|ctrlPosition|ctrlRemoveAllEventHandlers|ctrlRemoveEventHandler|ctrlScale|ctrlSetActiveColor|ctrlSetAngle|ctrlSetAutoScrollDelay|ctrlSetAutoScrollRewind|ctrlSetAutoScrollSpeed|ctrlSetBackgroundColor|ctrlSetChecked|ctrlSetDisabledColor|ctrlSetEventHandler|ctrlSetFade|ctrlSetFocus|ctrlSetFont|ctrlSetFontH1|ctrlSetFontH1B|ctrlSetFontH2|ctrlSetFontH2B|ctrlSetFontH3|ctrlSetFontH3B|ctrlSetFontH4|ctrlSetFontH4B|ctrlSetFontH5|ctrlSetFontH5B|ctrlSetFontH6|ctrlSetFontH6B|ctrlSetFontHeight|ctrlSetFontHeightH1|ctrlSetFontHeightH2|ctrlSetFontHeightH3|ctrlSetFontHeightH4|ctrlSetFontHeightH5|ctrlSetFontHeightH6|ctrlSetFontHeightSecondary|ctrlSetFontP|ctrlSetFontPB|ctrlSetFontSecondary|ctrlSetForegroundColor|ctrlSetModel|ctrlSetModelDirAndUp|ctrlSetModelScale|ctrlSetPixelPrecision|ctrlSetPosition|ctrlSetScale|ctrlSetStructuredText|ctrlSetText|ctrlSetTextColor|ctrlSetTextColorSecondary|ctrlSetTextSecondary|ctrlSetTooltip|ctrlSetTooltipColorBox|ctrlSetTooltipColorShade|ctrlSetTooltipColorText|ctrlShow|ctrlShown|ctrlText|ctrlTextHeight|ctrlTextSecondary|ctrlTextWidth|ctrlType|ctrlVisible|ctRowControls|ctRowCount|ctSetCurSel|ctSetData|ctSetHeaderTemplate|ctSetRowTemplate|ctSetValue|ctValue|curatorAddons|curatorCamera|curatorCameraArea|curatorCameraAreaCeiling|curatorCoef|curatorEditableObjects|curatorEditingArea|curatorEditingAreaType|curatorMouseOver|curatorPoints|curatorRegisteredObjects|curatorSelected|curatorWaypointCost|current3DENOperation|currentChannel|currentCommand|currentMagazine|currentMagazineDetail|currentMagazineDetailTurret|currentMagazineTurret|currentMuzzle|currentNamespace|currentTask|currentTasks|currentThrowable|currentVisionMode|currentWaypoint|currentWeapon|currentWeaponMode|currentWeaponTurret|currentZeroing|cursorObject|cursorTarget|customChat|customRadio|cutFadeOut|cutObj|cutRsc|cutText|damage|date|dateToNumber|daytime|deActivateKey|debriefingText|debugFSM|debugLog|deg|delete3DENEntities|deleteAt|deleteCenter|deleteCollection|deleteEditorObject|deleteGroup|deleteGroupWhenEmpty|deleteIdentity|deleteLocation|deleteMarker|deleteMarkerLocal|deleteRange|deleteResources|deleteSite|deleteStatus|deleteTeam|deleteVehicle|deleteVehicleCrew|deleteWaypoint|detach|detectedMines|diag_activeMissionFSMs|diag_activeScripts|diag_activeSQFScripts|diag_activeSQSScripts|diag_captureFrame|diag_captureFrameToFile|diag_captureSlowFrame|diag_codePerformance|diag_drawMode|diag_dynamicSimulationEnd|diag_enable|diag_enabled|diag_fps|diag_fpsMin|diag_frameNo|diag_lightNewLoad|diag_list|diag_log|diag_logSlowFrame|diag_mergeConfigFile|diag_recordTurretLimits|diag_setLightNew|diag_tickTime|diag_toggle|dialog|diarySubjectExists|didJIP|didJIPOwner|difficulty|difficultyEnabled|difficultyEnabledRTD|difficultyOption|direction|directSay|disableAI|disableCollisionWith|disableConversation|disableDebriefingStats|disableMapIndicators|disableNVGEquipment|disableRemoteSensors|disableSerialization|disableTIEquipment|disableUAVConnectability|disableUserInput|displayAddEventHandler|displayCtrl|displayNull|displayParent|displayRemoveAllEventHandlers|displayRemoveEventHandler|displaySetEventHandler|dissolveTeam|distance|distance2D|distanceSqr|distributionRegion|do3DENAction|doArtilleryFire|doFire|doFollow|doFSM|doGetOut|doMove|doorPhase|doStop|doSuppressiveFire|doTarget|doWatch|drawArrow|drawEllipse|drawIcon|drawIcon3D|drawLine|drawLine3D|drawLink|drawLocation|drawPolygon|drawRectangle|drawTriangle|driver|drop|dynamicSimulationDistance|dynamicSimulationDistanceCoef|dynamicSimulationEnabled|dynamicSimulationSystemEnabled|east|edit3DENMissionAttributes|editObject|editorSetEventHandler|effectiveCommander|emptyPositions|enableAI|enableAIFeature|enableAimPrecision|enableAttack|enableAudioFeature|enableAutoStartUpRTD|enableAutoTrimRTD|enableCamShake|enableCaustics|enableChannel|enableCollisionWith|enableCopilot|enableDebriefingStats|enableDiagLegend|enableDynamicSimulation|enableDynamicSimulationSystem|enableEndDialog|enableEngineArtillery|enableEnvironment|enableFatigue|enableGunLights|enableInfoPanelComponent|enableIRLasers|enableMimics|enablePersonTurret|enableRadio|enableReload|enableRopeAttach|enableSatNormalOnDetail|enableSaving|enableSentences|enableSimulation|enableSimulationGlobal|enableStamina|enableStressDamage|enableTeamSwitch|enableTraffic|enableUAVConnectability|enableUAVWaypoints|enableVehicleCargo|enableVehicleSensor|enableWeaponDisassembly|endl|endLoadingScreen|endMission|engineOn|enginesIsOnRTD|enginesPowerRTD|enginesRpmRTD|enginesTorqueRTD|entities|environmentEnabled|estimatedEndServerTime|estimatedTimeLeft|evalObjectArgument|everyBackpack|everyContainer|exec|execEditorScript|exp|expectedDestination|exportJIPMessages|eyeDirection|eyePos|face|faction|fadeMusic|fadeRadio|fadeSound|fadeSpeech|failMission|fillWeaponsFromPool|find|findCover|findDisplay|findEditorObject|findEmptyPosition|findEmptyPositionReady|findIf|findNearestEnemy|finishMissionInit|finite|fire|fireAtTarget|firstBackpack|flag|flagAnimationPhase|flagOwner|flagSide|flagTexture|fleeing|floor|flyInHeight|flyInHeightASL|fog|fogForecast|fogParams|forceAddUniform|forceAtPositionRTD|forcedMap|forceEnd|forceFlagTexture|forceFollowRoad|forceGeneratorRTD|forceMap|forceRespawn|forceSpeed|forceWalk|forceWeaponFire|forceWeatherChange|forgetTarget|format|formation|formationDirection|formationLeader|formationMembers|formationPosition|formationTask|formatText|formLeader|freeLook|fromEditor|fuel|fullCrew|gearIDCAmmoCount|gearSlotAmmoCount|gearSlotData|get3DENActionState|get3DENAttribute|get3DENCamera|get3DENConnections|get3DENEntity|get3DENEntityID|get3DENGrid|get3DENIconsVisible|get3DENLayerEntities|get3DENLinesVisible|get3DENMissionAttribute|get3DENMouseOver|get3DENSelected|getAimingCoef|getAllEnvSoundControllers|getAllHitPointsDamage|getAllOwnedMines|getAllSoundControllers|getAmmoCargo|getAnimAimPrecision|getAnimSpeedCoef|getArray|getArtilleryAmmo|getArtilleryComputerSettings|getArtilleryETA|getAssignedCuratorLogic|getAssignedCuratorUnit|getBackpackCargo|getBleedingRemaining|getBurningValue|getCameraViewDirection|getCargoIndex|getCenterOfMass|getClientState|getClientStateNumber|getCompatiblePylonMagazines|getConnectedUAV|getContainerMaxLoad|getCursorObjectParams|getCustomAimCoef|getDammage|getDescription|getDir|getDirVisual|getDLCAssetsUsage|getDLCAssetsUsageByName|getDLCs|getDLCUsageTime|getEditorCamera|getEditorMode|getEditorObjectScope|getElevationOffset|getEngineTargetRpmRTD|getEnvSoundController|getFatigue|getFieldManualStartPage|getForcedFlagTexture|getFriend|getFSMVariable|getFuelCargo|getGroupIcon|getGroupIconParams|getGroupIcons|getHideFrom|getHit|getHitIndex|getHitPointDamage|getItemCargo|getMagazineCargo|getMarkerColor|getMarkerPos|getMarkerSize|getMarkerType|getMass|getMissionConfig|getMissionConfigValue|getMissionDLCs|getMissionLayerEntities|getMissionLayers|getModelInfo|getMousePosition|getMusicPlayedTime|getNumber|getObjectArgument|getObjectChildren|getObjectDLC|getObjectMaterials|getObjectProxy|getObjectTextures|getObjectType|getObjectViewDistance|getOxygenRemaining|getPersonUsedDLCs|getPilotCameraDirection|getPilotCameraPosition|getPilotCameraRotation|getPilotCameraTarget|getPlateNumber|getPlayerChannel|getPlayerScores|getPlayerUID|getPlayerUIDOld|getPos|getPosASL|getPosASLVisual|getPosASLW|getPosATL|getPosATLVisual|getPosVisual|getPosWorld|getPylonMagazines|getRelDir|getRelPos|getRemoteSensorsDisabled|getRepairCargo|getResolution|getRotorBrakeRTD|getShadowDistance|getShotParents|getSlingLoad|getSoundController|getSoundControllerResult|getSpeed|getStamina|getStatValue|getSuppression|getTerrainGrid|getTerrainHeightASL|getText|getTotalDLCUsageTime|getTrimOffsetRTD|getUnitLoadout|getUnitTrait|getUserMFDText|getUserMFDValue|getVariable|getVehicleCargo|getWeaponCargo|getWeaponSway|getWingsOrientationRTD|getWingsPositionRTD|getWPPos|glanceAt|globalChat|globalRadio|goggles|group|groupChat|groupFromNetId|groupIconSelectable|groupIconsVisible|groupId|groupOwner|groupRadio|groupSelectedUnits|groupSelectUnit|grpNull|gunner|gusts|halt|handgunItems|handgunMagazine|handgunWeapon|handsHit|hasInterface|hasPilotCamera|hasWeapon|hcAllGroups|hcGroupParams|hcLeader|hcRemoveAllGroups|hcRemoveGroup|hcSelected|hcSelectGroup|hcSetGroup|hcShowBar|hcShownBar|headgear|hideBody|hideObject|hideObjectGlobal|hideSelection|hint|hintC|hintCadet|hintSilent|hmd|hostMission|htmlLoad|HUDMovementLevels|humidity|image|importAllGroups|importance|in|inArea|inAreaArray|incapacitatedState|independent|inflame|inflamed|infoPanel|infoPanelComponentEnabled|infoPanelComponents|infoPanels|inGameUISetEventHandler|inheritsFrom|initAmbientLife|inPolygon|inputAction|inRangeOfArtillery|insertEditorObject|intersect|is3DEN|is3DENMultiplayer|isAbleToBreathe|isAgent|isAimPrecisionEnabled|isArray|isAutoHoverOn|isAutonomous|isAutoStartUpEnabledRTD|isAutotest|isAutoTrimOnRTD|isBleeding|isBurning|isClass|isCollisionLightOn|isCopilotEnabled|isDamageAllowed|isDedicated|isDLCAvailable|isEngineOn|isEqualTo|isEqualType|isEqualTypeAll|isEqualTypeAny|isEqualTypeArray|isEqualTypeParams|isFilePatchingEnabled|isFlashlightOn|isFlatEmpty|isForcedWalk|isFormationLeader|isGroupDeletedWhenEmpty|isHidden|isInRemainsCollector|isInstructorFigureEnabled|isIRLaserOn|isKeyActive|isKindOf|isLaserOn|isLightOn|isLocalized|isManualFire|isMarkedForCollection|isMultiplayer|isMultiplayerSolo|isNil|isNull|isNumber|isObjectHidden|isObjectRTD|isOnRoad|isPipEnabled|isPlayer|isRealTime|isRemoteExecuted|isRemoteExecutedJIP|isServer|isShowing3DIcons|isSimpleObject|isSprintAllowed|isStaminaEnabled|isSteamMission|isStreamFriendlyUIEnabled|isStressDamageEnabled|isText|isTouchingGround|isTurnedOut|isTutHintsEnabled|isUAVConnectable|isUAVConnected|isUIContext|isUniformAllowed|isVehicleCargo|isVehicleRadarOn|isVehicleSensorEnabled|isWalking|isWeaponDeployed|isWeaponRested|itemCargo|items|itemsWithMagazines|join|joinAs|joinAsSilent|joinSilent|joinString|kbAddDatabase|kbAddDatabaseTargets|kbAddTopic|kbHasTopic|kbReact|kbRemoveTopic|kbTell|kbWasSaid|keyImage|keyName|knowsAbout|land|landAt|landResult|language|laserTarget|lbAdd|lbClear|lbColor|lbColorRight|lbCurSel|lbData|lbDelete|lbIsSelected|lbPicture|lbPictureRight|lbSelection|lbSetColor|lbSetColorRight|lbSetCurSel|lbSetData|lbSetPicture|lbSetPictureColor|lbSetPictureColorDisabled|lbSetPictureColorSelected|lbSetPictureRight|lbSetPictureRightColor|lbSetPictureRightColorDisabled|lbSetPictureRightColorSelected|lbSetSelectColor|lbSetSelectColorRight|lbSetSelected|lbSetText|lbSetTextRight|lbSetTooltip|lbSetValue|lbSize|lbSort|lbSortByValue|lbText|lbTextRight|lbValue|leader|leaderboardDeInit|leaderboardGetRows|leaderboardInit|leaderboardRequestRowsFriends|leaderboardRequestRowsGlobal|leaderboardRequestRowsGlobalAroundUser|leaderboardsRequestUploadScore|leaderboardsRequestUploadScoreKeepBest|leaderboardState|leaveVehicle|libraryCredits|libraryDisclaimers|lifeState|lightAttachObject|lightDetachObject|lightIsOn|lightnings|limitSpeed|linearConversion|lineBreak|lineIntersects|lineIntersectsObjs|lineIntersectsSurfaces|lineIntersectsWith|linkItem|list|listObjects|listRemoteTargets|listVehicleSensors|ln|lnbAddArray|lnbAddColumn|lnbAddRow|lnbClear|lnbColor|lnbColorRight|lnbCurSelRow|lnbData|lnbDeleteColumn|lnbDeleteRow|lnbGetColumnsPosition|lnbPicture|lnbPictureRight|lnbSetColor|lnbSetColorRight|lnbSetColumnsPos|lnbSetCurSelRow|lnbSetData|lnbSetPicture|lnbSetPictureColor|lnbSetPictureColorRight|lnbSetPictureColorSelected|lnbSetPictureColorSelectedRight|lnbSetPictureRight|lnbSetText|lnbSetTextRight|lnbSetValue|lnbSize|lnbSort|lnbSortByValue|lnbText|lnbTextRight|lnbValue|load|loadAbs|loadBackpack|loadFile|loadGame|loadIdentity|loadMagazine|loadOverlay|loadStatus|loadUniform|loadVest|local|localize|locationNull|locationPosition|lock|lockCameraTo|lockCargo|lockDriver|locked|lockedCargo|lockedDriver|lockedTurret|lockIdentity|lockTurret|lockWP|log|logEntities|logNetwork|logNetworkTerminate|lookAt|lookAtPos|magazineCargo|magazines|magazinesAllTurrets|magazinesAmmo|magazinesAmmoCargo|magazinesAmmoFull|magazinesDetail|magazinesDetailBackpack|magazinesDetailUniform|magazinesDetailVest|magazinesTurret|magazineTurretAmmo|mapAnimAdd|mapAnimClear|mapAnimCommit|mapAnimDone|mapCenterOnCamera|mapGridPosition|markAsFinishedOnSteam|markerAlpha|markerBrush|markerColor|markerDir|markerPos|markerShape|markerSize|markerText|markerType|max|members|menuAction|menuAdd|menuChecked|menuClear|menuCollapse|menuData|menuDelete|menuEnable|menuEnabled|menuExpand|menuHover|menuPicture|menuSetAction|menuSetCheck|menuSetData|menuSetPicture|menuSetValue|menuShortcut|menuShortcutText|menuSize|menuSort|menuText|menuURL|menuValue|min|mineActive|mineDetectedBy|missionConfigFile|missionDifficulty|missionName|missionNamespace|missionStart|missionVersion|modelToWorld|modelToWorldVisual|modelToWorldVisualWorld|modelToWorldWorld|modParams|moonIntensity|moonPhase|morale|move|move3DENCamera|moveInAny|moveInCargo|moveInCommander|moveInDriver|moveInGunner|moveInTurret|moveObjectToEnd|moveOut|moveTime|moveTo|moveToCompleted|moveToFailed|musicVolume|name|nameSound|nearEntities|nearestBuilding|nearestLocation|nearestLocations|nearestLocationWithDubbing|nearestObject|nearestObjects|nearestTerrainObjects|nearObjects|nearObjectsReady|nearRoads|nearSupplies|nearTargets|needReload|netId|netObjNull|newOverlay|nextMenuItemIndex|nextWeatherChange|nMenuItems|numberOfEnginesRTD|numberToDate|objectCurators|objectFromNetId|objectParent|objNull|objStatus|onBriefingGear|onBriefingGroup|onBriefingNotes|onBriefingPlan|onBriefingTeamSwitch|onCommandModeChanged|onDoubleClick|onEachFrame|onGroupIconClick|onGroupIconOverEnter|onGroupIconOverLeave|onHCGroupSelectionChanged|onMapSingleClick|onPlayerConnected|onPlayerDisconnected|onPreloadFinished|onPreloadStarted|onShowNewObject|onTeamSwitch|openCuratorInterface|openDLCPage|openDSInterface|openMap|openSteamApp|openYoutubeVideo|opfor|orderGetIn|overcast|overcastForecast|owner|param|params|parseNumber|parseSimpleArray|parseText|parsingNamespace|particlesQuality|pi|pickWeaponPool|pitch|pixelGrid|pixelGridBase|pixelGridNoUIScale|pixelH|pixelW|playableSlotsNumber|playableUnits|playAction|playActionNow|player|playerRespawnTime|playerSide|playersNumber|playGesture|playMission|playMove|playMoveNow|playMusic|playScriptedMission|playSound|playSound3D|position|positionCameraToWorld|posScreenToWorld|posWorldToScreen|ppEffectAdjust|ppEffectCommit|ppEffectCommitted|ppEffectCreate|ppEffectDestroy|ppEffectEnable|ppEffectEnabled|ppEffectForceInNVG|precision|preloadCamera|preloadObject|preloadSound|preloadTitleObj|preloadTitleRsc|primaryWeapon|primaryWeaponItems|primaryWeaponMagazine|priority|processDiaryLink|processInitCommands|productVersion|profileName|profileNamespace|profileNameSteam|progressLoadingScreen|progressPosition|progressSetPosition|publicVariable|publicVariableClient|publicVariableServer|pushBack|pushBackUnique|putWeaponPool|queryItemsPool|queryMagazinePool|queryWeaponPool|rad|radioChannelAdd|radioChannelCreate|radioChannelRemove|radioChannelSetCallSign|radioChannelSetLabel|radioVolume|rain|rainbow|random|rank|rankId|rating|rectangular|registeredTasks|registerTask|reload|reloadEnabled|remoteControl|remoteExec|remoteExecCall|remoteExecutedOwner|remove3DENConnection|remove3DENEventHandler|remove3DENLayer|removeAction|removeAll3DENEventHandlers|removeAllActions|removeAllAssignedItems|removeAllContainers|removeAllCuratorAddons|removeAllCuratorCameraAreas|removeAllCuratorEditingAreas|removeAllEventHandlers|removeAllHandgunItems|removeAllItems|removeAllItemsWithMagazines|removeAllMissionEventHandlers|removeAllMPEventHandlers|removeAllMusicEventHandlers|removeAllOwnedMines|removeAllPrimaryWeaponItems|removeAllWeapons|removeBackpack|removeBackpackGlobal|removeCuratorAddons|removeCuratorCameraArea|removeCuratorEditableObjects|removeCuratorEditingArea|removeDrawIcon|removeDrawLinks|removeEventHandler|removeFromRemainsCollector|removeGoggles|removeGroupIcon|removeHandgunItem|removeHeadgear|removeItem|removeItemFromBackpack|removeItemFromUniform|removeItemFromVest|removeItems|removeMagazine|removeMagazineGlobal|removeMagazines|removeMagazinesTurret|removeMagazineTurret|removeMenuItem|removeMissionEventHandler|removeMPEventHandler|removeMusicEventHandler|removeOwnedMine|removePrimaryWeaponItem|removeSecondaryWeaponItem|removeSimpleTask|removeSwitchableUnit|removeTeamMember|removeUniform|removeVest|removeWeapon|removeWeaponAttachmentCargo|removeWeaponCargo|removeWeaponGlobal|removeWeaponTurret|reportRemoteTarget|requiredVersion|resetCamShake|resetSubgroupDirection|resistance|resize|resources|respawnVehicle|restartEditorCamera|reveal|revealMine|reverse|reversedMouseY|roadAt|roadsConnectedTo|roleDescription|ropeAttachedObjects|ropeAttachedTo|ropeAttachEnabled|ropeAttachTo|ropeCreate|ropeCut|ropeDestroy|ropeDetach|ropeEndPosition|ropeLength|ropes|ropeUnwind|ropeUnwound|rotorsForcesRTD|rotorsRpmRTD|round|runInitScript|safeZoneH|safeZoneW|safeZoneWAbs|safeZoneX|safeZoneXAbs|safeZoneY|save3DENInventory|saveGame|saveIdentity|saveJoysticks|saveOverlay|saveProfileNamespace|saveStatus|saveVar|savingEnabled|say|say2D|say3D|score|scoreSide|screenshot|screenToWorld|scriptDone|scriptName|scriptNull|scudState|secondaryWeapon|secondaryWeaponItems|secondaryWeaponMagazine|select|selectBestPlaces|selectDiarySubject|selectedEditorObjects|selectEditorObject|selectionNames|selectionPosition|selectLeader|selectMax|selectMin|selectNoPlayer|selectPlayer|selectRandom|selectRandomWeighted|selectWeapon|selectWeaponTurret|sendAUMessage|sendSimpleCommand|sendTask|sendTaskResult|sendUDPMessage|serverCommand|serverCommandAvailable|serverCommandExecutable|serverName|serverTime|set|set3DENAttribute|set3DENAttributes|set3DENGrid|set3DENIconsVisible|set3DENLayer|set3DENLinesVisible|set3DENLogicType|set3DENMissionAttribute|set3DENMissionAttributes|set3DENModelsVisible|set3DENObjectType|set3DENSelected|setAccTime|setActualCollectiveRTD|setAirplaneThrottle|setAirportSide|setAmmo|setAmmoCargo|setAmmoOnPylon|setAnimSpeedCoef|setAperture|setApertureNew|setArmoryPoints|setAttributes|setAutonomous|setBehaviour|setBleedingRemaining|setBrakesRTD|setCameraInterest|setCamShakeDefParams|setCamShakeParams|setCamUseTI|setCaptive|setCenterOfMass|setCollisionLight|setCombatMode|setCompassOscillation|setConvoySeparation|setCuratorCameraAreaCeiling|setCuratorCoef|setCuratorEditingAreaType|setCuratorWaypointCost|setCurrentChannel|setCurrentTask|setCurrentWaypoint|setCustomAimCoef|setCustomWeightRTD|setDamage|setDammage|setDate|setDebriefingText|setDefaultCamera|setDestination|setDetailMapBlendPars|setDir|setDirection|setDrawIcon|setDriveOnPath|setDropInterval|setDynamicSimulationDistance|setDynamicSimulationDistanceCoef|setEditorMode|setEditorObjectScope|setEffectCondition|setEngineRpmRTD|setFace|setFaceAnimation|setFatigue|setFeatureType|setFlagAnimationPhase|setFlagOwner|setFlagSide|setFlagTexture|setFog|setForceGeneratorRTD|setFormation|setFormationTask|setFormDir|setFriend|setFromEditor|setFSMVariable|setFuel|setFuelCargo|setGroupIcon|setGroupIconParams|setGroupIconsSelectable|setGroupIconsVisible|setGroupId|setGroupIdGlobal|setGroupOwner|setGusts|setHideBehind|setHit|setHitIndex|setHitPointDamage|setHorizonParallaxCoef|setHUDMovementLevels|setIdentity|setImportance|setInfoPanel|setLeader|setLightAmbient|setLightAttenuation|setLightBrightness|setLightColor|setLightDayLight|setLightFlareMaxDistance|setLightFlareSize|setLightIntensity|setLightnings|setLightUseFlare|setLocalWindParams|setMagazineTurretAmmo|setMarkerAlpha|setMarkerAlphaLocal|setMarkerBrush|setMarkerBrushLocal|setMarkerColor|setMarkerColorLocal|setMarkerDir|setMarkerDirLocal|setMarkerPos|setMarkerPosLocal|setMarkerShape|setMarkerShapeLocal|setMarkerSize|setMarkerSizeLocal|setMarkerText|setMarkerTextLocal|setMarkerType|setMarkerTypeLocal|setMass|setMimic|setMousePosition|setMusicEffect|setMusicEventHandler|setName|setNameSound|setObjectArguments|setObjectMaterial|setObjectMaterialGlobal|setObjectProxy|setObjectTexture|setObjectTextureGlobal|setObjectViewDistance|setOvercast|setOwner|setOxygenRemaining|setParticleCircle|setParticleClass|setParticleFire|setParticleParams|setParticleRandom|setPilotCameraDirection|setPilotCameraRotation|setPilotCameraTarget|setPilotLight|setPiPEffect|setPitch|setPlateNumber|setPlayable|setPlayerRespawnTime|setPos|setPosASL|setPosASL2|setPosASLW|setPosATL|setPosition|setPosWorld|setPylonLoadOut|setPylonsPriority|setRadioMsg|setRain|setRainbow|setRandomLip|setRank|setRectangular|setRepairCargo|setRotorBrakeRTD|setShadowDistance|setShotParents|setSide|setSimpleTaskAlwaysVisible|setSimpleTaskCustomData|setSimpleTaskDescription|setSimpleTaskDestination|setSimpleTaskTarget|setSimpleTaskType|setSimulWeatherLayers|setSize|setSkill|setSlingLoad|setSoundEffect|setSpeaker|setSpeech|setSpeedMode|setStamina|setStaminaScheme|setStatValue|setSuppression|setSystemOfUnits|setTargetAge|setTaskMarkerOffset|setTaskResult|setTaskState|setTerrainGrid|setText|setTimeMultiplier|setTitleEffect|setToneMapping|setToneMappingParams|setTrafficDensity|setTrafficDistance|setTrafficGap|setTrafficSpeed|setTriggerActivation|setTriggerArea|setTriggerStatements|setTriggerText|setTriggerTimeout|setTriggerType|setType|setUnconscious|setUnitAbility|setUnitLoadout|setUnitPos|setUnitPosWeak|setUnitRank|setUnitRecoilCoefficient|setUnitTrait|setUnloadInCombat|setUserActionText|setUserMFDText|setUserMFDValue|setVariable|setVectorDir|setVectorDirAndUp|setVectorUp|setVehicleAmmo|setVehicleAmmoDef|setVehicleArmor|setVehicleCargo|setVehicleId|setVehicleInit|setVehicleLock|setVehiclePosition|setVehicleRadar|setVehicleReceiveRemoteTargets|setVehicleReportOwnPosition|setVehicleReportRemoteTargets|setVehicleTIPars|setVehicleVarName|setVelocity|setVelocityModelSpace|setVelocityTransformation|setViewDistance|setVisibleIfTreeCollapsed|setWantedRpmRTD|setWaves|setWaypointBehaviour|setWaypointCombatMode|setWaypointCompletionRadius|setWaypointDescription|setWaypointForceBehaviour|setWaypointFormation|setWaypointHousePosition|setWaypointLoiterRadius|setWaypointLoiterType|setWaypointName|setWaypointPosition|setWaypointScript|setWaypointSpeed|setWaypointStatements|setWaypointTimeout|setWaypointType|setWaypointVisible|setWeaponReloadingTime|setWind|setWindDir|setWindForce|setWindStr|setWingForceScaleRTD|setWPPos|show3DIcons|showChat|showCinemaBorder|showCommandingMenu|showCompass|showCuratorCompass|showGPS|showHUD|showLegend|showMap|shownArtilleryComputer|shownChat|shownCompass|shownCuratorCompass|showNewEditorObject|shownGPS|shownHUD|shownMap|shownPad|shownRadio|shownScoretable|shownUAVFeed|shownWarrant|shownWatch|showPad|showRadio|showScoretable|showSubtitles|showUAVFeed|showWarrant|showWatch|showWaypoint|showWaypoints|side|sideAmbientLife|sideChat|sideEmpty|sideEnemy|sideFriendly|sideLogic|sideRadio|sideUnknown|simpleTasks|simulationEnabled|simulCloudDensity|simulCloudOcclusion|simulInClouds|simulWeatherSync|sin|size|sizeOf|skill|skillFinal|skipTime|sleep|sliderPosition|sliderRange|sliderSetPosition|sliderSetRange|sliderSetSpeed|sliderSpeed|slingLoadAssistantShown|soldierMagazines|someAmmo|sort|soundVolume|speaker|speed|speedMode|splitString|sqrt|squadParams|stance|startLoadingScreen|stop|stopEngineRTD|stopped|str|sunOrMoon|supportInfo|suppressFor|surfaceIsWater|surfaceNormal|surfaceType|swimInDepth|switchableUnits|switchAction|switchCamera|switchGesture|switchLight|switchMove|synchronizedObjects|synchronizedTriggers|synchronizedWaypoints|synchronizeObjectsAdd|synchronizeObjectsRemove|synchronizeTrigger|synchronizeWaypoint|systemChat|systemOfUnits|tan|targetKnowledge|targets|targetsAggregate|targetsQuery|taskAlwaysVisible|taskChildren|taskCompleted|taskCustomData|taskDescription|taskDestination|taskHint|taskMarkerOffset|taskNull|taskParent|taskResult|taskState|taskType|teamMember|teamMemberNull|teamName|teams|teamSwitch|teamSwitchEnabled|teamType|terminate|terrainIntersect|terrainIntersectASL|terrainIntersectAtASL|text|textLog|textLogFormat|tg|time|timeMultiplier|titleCut|titleFadeOut|titleObj|titleRsc|titleText|toArray|toFixed|toLower|toString|toUpper|triggerActivated|triggerActivation|triggerArea|triggerAttachedVehicle|triggerAttachObject|triggerAttachVehicle|triggerDynamicSimulation|triggerStatements|triggerText|triggerTimeout|triggerTimeoutCurrent|triggerType|turretLocal|turretOwner|turretUnit|tvAdd|tvClear|tvCollapse|tvCollapseAll|tvCount|tvCurSel|tvData|tvDelete|tvExpand|tvExpandAll|tvPicture|tvPictureRight|tvSetColor|tvSetCurSel|tvSetData|tvSetPicture|tvSetPictureColor|tvSetPictureColorDisabled|tvSetPictureColorSelected|tvSetPictureRight|tvSetPictureRightColor|tvSetPictureRightColorDisabled|tvSetPictureRightColorSelected|tvSetSelectColor|tvSetText|tvSetTooltip|tvSetValue|tvSort|tvSortByValue|tvText|tvTooltip|tvValue|type|typeName|typeOf|UAVControl|uiNamespace|uiSleep|unassignCurator|unassignItem|unassignTeam|unassignVehicle|underwater|uniform|uniformContainer|uniformItems|uniformMagazines|unitAddons|unitAimPosition|unitAimPositionVisual|unitBackpack|unitIsUAV|unitPos|unitReady|unitRecoilCoefficient|units|unitsBelowHeight|unlinkItem|unlockAchievement|unregisterTask|updateDrawIcon|updateMenuItem|updateObjectTree|useAIOperMapObstructionTest|useAISteeringComponent|useAudioTimeForMoves|userInputDisabled|vectorAdd|vectorCos|vectorCrossProduct|vectorDiff|vectorDir|vectorDirVisual|vectorDistance|vectorDistanceSqr|vectorDotProduct|vectorFromTo|vectorMagnitude|vectorMagnitudeSqr|vectorModelToWorld|vectorModelToWorldVisual|vectorMultiply|vectorNormalized|vectorUp|vectorUpVisual|vectorWorldToModel|vectorWorldToModelVisual|vehicle|vehicleCargoEnabled|vehicleChat|vehicleRadio|vehicleReceiveRemoteTargets|vehicleReportOwnPosition|vehicleReportRemoteTargets|vehicles|vehicleVarName|velocity|velocityModelSpace|verifySignature|vest|vestContainer|vestItems|vestMagazines|viewDistance|visibleCompass|visibleGPS|visibleMap|visiblePosition|visiblePositionASL|visibleScoretable|visibleWatch|waitUntil|waves|waypointAttachedObject|waypointAttachedVehicle|waypointAttachObject|waypointAttachVehicle|waypointBehaviour|waypointCombatMode|waypointCompletionRadius|waypointDescription|waypointForceBehaviour|waypointFormation|waypointHousePosition|waypointLoiterRadius|waypointLoiterType|waypointName|waypointPosition|waypoints|waypointScript|waypointsEnabledUAV|waypointShow|waypointSpeed|waypointStatements|waypointTimeout|waypointTimeoutCurrent|waypointType|waypointVisible|weaponAccessories|weaponAccessoriesCargo|weaponCargo|weaponDirection|weaponInertia|weaponLowered|weapons|weaponsItems|weaponsItemsCargo|weaponState|weaponsTurret|weightRTD|west|WFSideText|wind|windDir|windRTD|windStr|wingsForcesRTD|worldName|worldSize|worldToModel|worldToModelVisual|worldToScreen)\b/i,
+ 'number': /(?:\$|\b0x)[\da-f]+\b|(?:\B\.\d+|\b\d+(?:\.\d+)?)(?:e[+-]?\d+)?\b/i,
+ 'operator': /##|>>|&&|\|\||[!=<>]=?|[-+*/%#^]|\b(?:and|mod|not|or)\b/i,
+ 'constant': /\bDIK(?:_[a-z\d]+)+\b/i
+});
+
+Prism.languages.insertBefore('sqf', 'string', {
+ 'macro': {
+ pattern: /(^\s*)#[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,
+ lookbehind: true,
+ greedy: true,
+ alias: 'property',
+ inside: {
+ 'directive': {
+ pattern: /#[a-z]+\b/i,
+ alias: 'keyword'
+ },
+ 'comment': Prism.languages.sqf.comment
+ }
+ }
+});
+
+delete Prism.languages.sqf['class-name'];
+
+return Prism; })
\ No newline at end of file
Prism.languages.stylus = {
'comment': {
- pattern: /(^|[^\\])(\/\*[\s\S]*?\*\/|\/\/.*)/,
+ pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,
lookbehind: true
},
'atrule-declaration': {
pattern: /(^[ \t]*)(?:if|else|for|return|unless)[ \t]+.+/m,
lookbehind: true,
inside: {
- keyword: /^\S+/,
+ 'keyword': /^\S+/,
rest: inside
}
},
// A property/value pair cannot end with a comma or a brace
// It cannot have indented content unless it ended with a semicolon
'property-declaration': {
- pattern: /((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)[^{\r\n]*(?:;|[^{\r\n,](?=$)(?!(\r?\n|\r)(?:\{|\2[ \t]+)))/m,
+ pattern: /((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)[^{\r\n]*(?:;|[^{\r\n,](?=$)(?!(?:\r?\n|\r)(?:\{|\2[ \t]+)))/m,
lookbehind: true,
inside: {
'property': {
'punctuation': /[{}()\[\];:.]/
};
}(Prism));
+
return Prism; })
\ No newline at end of file
// issues: nested multiline comments
Prism.languages.swift = Prism.languages.extend('clike', {
'string': {
- pattern: /("|')(\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
+ pattern: /("|')(?:\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
greedy: true,
inside: {
'interpolation': {
-define(["prism/prism","prism/components/prism-markup","prism/components/prism-css"], function () {
+define(["prism/prism","prism/components/prism-markup"], function () {
(function (Prism) {
// We don't allow for pipes inside parentheses
// to not break table pattern |(. foo |). bar |
--- /dev/null
+define(["prism/prism"], function () {
+Prism.languages.turtle = {
+ 'comment': {
+ pattern: /#.*/,
+ greedy: true
+ },
+ 'multiline-string': {
+ pattern: /"""(?:(?:""?)?(?:[^"\\]|\\.))*"""|'''(?:(?:''?)?(?:[^'\\]|\\.))*'''/,
+ greedy: true,
+ alias: 'string',
+ inside: {
+ 'comment': /#.*/
+ }
+ },
+ 'string': {
+ pattern: /"(?:[^\\"\r\n]|\\.)*"|'(?:[^\\'\r\n]|\\.)*'/,
+ greedy: true
+ },
+ 'url': {
+ pattern: /<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-f]{4}|U[\da-f]{8}))*>/i,
+ greedy: true,
+ inside: {
+ 'punctuation': /[<>]/
+ }
+ },
+ 'function': {
+ pattern: /(?:(?![-.\d\xB7])[-.\w\xB7\xC0-\uFFFD]+)?:(?:(?![-.])(?:[-.:\w\xC0-\uFFFD]|%[\da-f]{2}|\\.)+)?/i,
+ inside: {
+ 'local-name': {
+ pattern: /([^:]*:)[\s\S]+/,
+ lookbehind: true
+ },
+ 'prefix': {
+ pattern: /[\s\S]+/,
+ inside: {
+ 'punctuation': /:/
+ }
+ }
+ }
+ },
+ 'number': /[+-]?\b\d+\.?\d*(?:e[+-]?\d+)?/i,
+ 'punctuation': /[{}.,;()[\]]|\^\^/,
+ 'boolean': /\b(?:true|false)\b/,
+ 'keyword': [
+ /(?:\ba|@prefix|@base)\b|=/,
+ /\b(?:graph|base|prefix)\b/i
+ ],
+ 'tag': {
+ pattern: /@[a-z]+(?:-[a-z\d]+)*/i,
+ inside: {
+ 'punctuation': /@/
+ }
+ }
+};
+Prism.languages.trig = Prism.languages['turtle'];
+
+return Prism; })
\ No newline at end of file
define(["prism/prism","prism/components/prism-javascript"], function () {
Prism.languages.typescript = Prism.languages.extend('javascript', {
// From JavaScript Prism keyword list and TypeScript language spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#221-reserved-words
- 'keyword': /\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,
+ 'keyword': /\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/,
'builtin': /\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/,
});
Prism.languages.insertBefore('vala', 'keyword', {
'regex': {
- pattern: /\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[imsx]{0,4}(?=\s*($|[\r\n,.;})\]]))/,
+ pattern: /\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[imsx]{0,4}(?=\s*(?:$|[\r\n,.;})\]]))/,
greedy: true
}
});
+
return Prism; })
\ No newline at end of file
pattern: /(^|[^\\](?:\\\\)*)#@?(?:[a-z][\w-]*|{[a-z][\w-]*})(?:\s*\((?:[^()]|\([^()]*\))*\))?/i,
lookbehind: true,
inside: {
- keyword: {
+ 'keyword': {
pattern: /^#@?(?:[a-z][\w-]*|{[a-z][\w-]*})|\bin\b/,
inside: {
'punctuation': /[{}]/
Prism.languages.velocity['tag'].inside['attr-value'].inside.rest = Prism.languages.velocity;
}(Prism));
+
return Prism; })
\ No newline at end of file
define(["prism/prism"], function () {
Prism.languages['visual-basic'] = {
'comment': {
- pattern: /(?:['‘’]|REM\b).*/i,
+ pattern: /(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,
inside: {
'keyword': /^REM/i
}
greedy: true
},
'string': {
- pattern: /["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,
+ pattern: /\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,
greedy: true
},
'date': {
};
Prism.languages.vb = Prism.languages['visual-basic'];
+
return Prism; })
\ No newline at end of file
// TODO Multi-line
pattern: /('{2,5}).+?\1/,
inside: {
- 'bold italic': {
+ 'bold-italic': {
pattern: /(''''').+?(?=\1)/,
- lookbehind: true
+ lookbehind: true,
+ alias: ['bold', 'italic']
},
'bold': {
pattern: /(''')[^'](?:.*?[^'])?(?=\1)/,
alias: 'function'
},
'directive-block-open': {
- pattern: /\$\w+:{|\$\w(?:#\d+\+?)?(?:\[[-\w.]+])?:[-\w.]+:{(![A-Z]+)?/,
+ pattern: /\$\w+:{|\$\w(?:#\d+\+?)?(?:\[[-\w.]+])?:[-\w.]+:{(?:![A-Z]+)?/,
inside: {
'punctuation': {
pattern: /\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,
Prism.languages.xeoracube = Prism.languages.xeora;
}(Prism));
+
return Prism; })
\ No newline at end of file
Prism.languages.xquery['tag'].inside['attr-value'].inside['expression'] = {
// Allow for two levels of nesting
pattern: /{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}/,
- inside: {
- rest: Prism.languages.xquery
- },
- 'alias': 'language-xquery'
+ inside: Prism.languages.xquery,
+ alias: 'language-xquery'
};
// The following will handle plain text inside tags
});
}(Prism));
+
return Prism; })
\ No newline at end of file
define(["prism/prism"], function () {
-Prism.languages.yaml = {
- 'scalar': {
- pattern: /([\-:]\s*(?:![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\2[^\r\n]+)*)/,
- lookbehind: true,
- alias: 'string'
- },
- 'comment': /#.*/,
- 'key': {
- pattern: /(\s*(?:^|[:\-,[{\r\n?])[ \t]*(?:![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,
- lookbehind: true,
- alias: 'atrule'
- },
- 'directive': {
- pattern: /(^[ \t]*)%.+/m,
- lookbehind: true,
- 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: true,
- alias: 'number'
- },
- 'boolean': {
- pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:true|false)[ \t]*(?=$|,|]|})/im,
- lookbehind: true,
- alias: 'important'
- },
- 'null': {
- pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:null|~)[ \t]*(?=$|,|]|})/im,
- lookbehind: true,
- alias: 'important'
- },
- 'string': {
- pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)("|')(?:(?!\2)[^\\\r\n]|\\.)*\2(?=[ \t]*(?:$|,|]|}|\s*#))/m,
- lookbehind: true,
- greedy: true
- },
- 'number': {
- pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,
- lookbehind: true
- },
- 'tag': /![^\s]+/,
- 'important': /[&*][\w]+/,
- 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
-};
+(function (Prism) {
+
+ // https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
+ // https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
+ var anchorOrAlias = /[*&][^\s[\]{},]+/;
+ // https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
+ var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
+ // https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
+ var properties = '(?:' + tag.source + '(?:[ \t]+' + anchorOrAlias.source + ')?|'
+ + anchorOrAlias.source + '(?:[ \t]+' + tag.source + ')?)';
+
+ /**
+ *
+ * @param {string} value
+ * @param {string} [flags]
+ * @returns {RegExp}
+ */
+ function createValuePattern(value, flags) {
+ flags = (flags || '').replace(/m/g, '') + 'm'; // add m flag
+ var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|]|}|\s*#))/.source
+ .replace(/<<prop>>/g, function () { return properties; }).replace(/<<value>>/g, function () { return value; });
+ return RegExp(pattern, flags)
+ }
+
+ Prism.languages.yaml = {
+ 'scalar': {
+ pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\2[^\r\n]+)*)/.source
+ .replace(/<<prop>>/g, function () { return properties; })),
+ lookbehind: true,
+ alias: 'string'
+ },
+ 'comment': /#.*/,
+ 'key': {
+ pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)[^\r\n{[\]},#\s]+?(?=\s*:\s)/.source
+ .replace(/<<prop>>/g, function () { return properties; })),
+ lookbehind: true,
+ alias: 'atrule'
+ },
+ 'directive': {
+ pattern: /(^[ \t]*)%.+/m,
+ lookbehind: true,
+ alias: 'important'
+ },
+ 'datetime': {
+ pattern: createValuePattern(/\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*)?)?/.source),
+ lookbehind: true,
+ alias: 'number'
+ },
+ 'boolean': {
+ pattern: createValuePattern(/true|false/.source, 'i'),
+ lookbehind: true,
+ alias: 'important'
+ },
+ 'null': {
+ pattern: createValuePattern(/null|~/.source, 'i'),
+ lookbehind: true,
+ alias: 'important'
+ },
+ 'string': {
+ // \2 because of the lookbehind group
+ pattern: createValuePattern(/("|')(?:(?!\2)[^\\\r\n]|\\.)*\2/.source),
+ lookbehind: true,
+ greedy: true
+ },
+ 'number': {
+ pattern: createValuePattern(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, 'i'),
+ lookbehind: true
+ },
+ 'tag': tag,
+ 'important': anchorOrAlias,
+ 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
+ };
+
+ Prism.languages.yml = Prism.languages.yaml;
+
+}(Prism));
-Prism.languages.yml = Prism.languages.yaml;
return Prism; })
\ No newline at end of file
--- /dev/null
+define(["prism/prism"], function () {
+(function (Prism) {
+
+ function literal(str) {
+ return function () { return str; };
+ }
+
+ var keyword = /\b(?:align|allowzero|and|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/;
+
+ var IDENTIFIER = '\\b(?!' + keyword.source + ')(?!\\d)\\w+\\b';
+ var ALIGN = /align\s*\((?:[^()]|\([^()]*\))*\)/.source;
+ var PREFIX_TYPE_OP = /(?:\?|\bpromise->|(?:\[[^[\]]*\]|\*(?!\*)|\*\*)(?:\s*<ALIGN>|\s*const\b|\s*volatile\b|\s*allowzero\b)*)/.source.replace(/<ALIGN>/g, literal(ALIGN));
+ var SUFFIX_EXPR = /(?:\bpromise\b|(?:\berror\.)?<ID>(?:\.<ID>)*(?!\s+<ID>))/.source.replace(/<ID>/g, literal(IDENTIFIER));
+ var TYPE = '(?!\\s)(?:!?\\s*(?:' + PREFIX_TYPE_OP + '\\s*)*' + SUFFIX_EXPR + ')+';
+
+ /*
+ * A simplified grammar for Zig compile time type literals:
+ *
+ * TypeExpr = ( "!"? PREFIX_TYPE_OP* SUFFIX_EXPR )+
+ *
+ * SUFFIX_EXPR = ( \b "promise" \b | ( \b "error" "." )? IDENTIFIER ( "." IDENTIFIER )* (?! \s+ IDENTIFIER ) )
+ *
+ * PREFIX_TYPE_OP = "?"
+ * | \b "promise" "->"
+ * | ( "[" [^\[\]]* "]" | "*" | "**" ) ( ALIGN | "const" \b | "volatile" \b | "allowzero" \b )*
+ *
+ * ALIGN = "align" "(" ( [^()] | "(" [^()]* ")" )* ")"
+ *
+ * IDENTIFIER = \b (?! KEYWORD ) [a-zA-Z_] \w* \b
+ *
+ */
+
+ Prism.languages.zig = {
+ 'comment': [
+ {
+ pattern: /\/{3}.*/,
+ alias: 'doc-comment'
+ },
+ /\/{2}.*/
+ ],
+ 'string': [
+ {
+ // "string" and c"string"
+ pattern: /(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,
+ lookbehind: true,
+ greedy: true
+ },
+ {
+ // multiline strings and c-strings
+ pattern: /([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,
+ lookbehind: true,
+ greedy: true
+ },
+ {
+ // characters 'a', '\n', '\xFF', '\u{10FFFF}'
+ pattern: /(^|[^\\])'(?:[^'\\\r\n]|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,
+ lookbehind: true,
+ greedy: true
+ }
+ ],
+ 'builtin': /\B@(?!\d)\w+(?=\s*\()/,
+ 'label': {
+ pattern: /(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,
+ lookbehind: true
+ },
+ 'class-name': [
+ // const Foo = struct {};
+ /\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,
+ {
+ // const x: i32 = 9;
+ // var x: Bar;
+ // fn foo(x: bool, y: f32) void {}
+ pattern: RegExp(/(:\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?[=;,)])|<TYPE>(?=\s*(?:<ALIGN>\s*)?\{)/.source.replace(/<TYPE>/g, literal(TYPE)).replace(/<ALIGN>/g, literal(ALIGN))),
+ lookbehind: true,
+ inside: null // see below
+ },
+ {
+ // extern fn foo(x: f64) f64; (optional alignment)
+ pattern: RegExp(/(\)\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?;)/.source.replace(/<TYPE>/g, literal(TYPE)).replace(/<ALIGN>/g, literal(ALIGN))),
+ lookbehind: true,
+ inside: null // see below
+ }
+ ],
+ 'builtin-types': {
+ pattern: /\b(?:anyerror|bool|c_u?(?:short|int|long|longlong)|c_longdouble|c_void|comptime_(?:float|int)|[iu](?:8|16|32|64|128|size)|f(?:16|32|64|128)|noreturn|type|void)\b/,
+ alias: 'keyword'
+ },
+ 'keyword': keyword,
+ 'function': /\b(?!\d)\w+(?=\s*\()/,
+ 'number': /\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+\.?[a-fA-F\d]*(?:[pP][+-]?[a-fA-F\d]+)?|\d+\.?\d*(?:[eE][+-]?\d+)?)\b/,
+ 'boolean': /\b(?:false|true)\b/,
+ 'operator': /\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,
+ 'punctuation': /[.:,;(){}[\]]/
+ };
+
+ Prism.languages.zig['class-name'].forEach(function (obj) {
+ if (obj.inside === null) {
+ obj.inside = Prism.languages.zig;
+ }
+ });
+
+}(Prism));
+
+return Prism; })
\ No newline at end of file
-define([],function(){return /*START*/{"markup":{"title":"Markup","file":"markup"},"html":{"title":"HTML","file":"markup"},"xml":{"title":"XML","file":"markup"},"svg":{"title":"SVG","file":"markup"},"mathml":{"title":"MathML","file":"markup"},"css":{"title":"CSS","file":"css"},"clike":{"title":"C-like","file":"clike"},"javascript":{"title":"JavaScript","file":"javascript"},"abap":{"title":"ABAP","file":"abap"},"abnf":{"title":"Augmented Backus–Naur form","file":"abnf"},"actionscript":{"title":"ActionScript","file":"actionscript"},"ada":{"title":"Ada","file":"ada"},"apacheconf":{"title":"Apache Configuration","file":"apacheconf"},"apl":{"title":"APL","file":"apl"},"applescript":{"title":"AppleScript","file":"applescript"},"arduino":{"title":"Arduino","file":"arduino"},"arff":{"title":"ARFF","file":"arff"},"asciidoc":{"title":"AsciiDoc","file":"asciidoc"},"asm6502":{"title":"6502 Assembly","file":"asm6502"},"aspnet":{"title":"ASP.NET (C#)","file":"aspnet"},"autohotkey":{"title":"AutoHotkey","file":"autohotkey"},"autoit":{"title":"AutoIt","file":"autoit"},"bash":{"title":"Bash","file":"bash"},"basic":{"title":"BASIC","file":"basic"},"batch":{"title":"Batch","file":"batch"},"bison":{"title":"Bison","file":"bison"},"bnf":{"title":"Backus–Naur form","file":"bnf"},"brainfuck":{"title":"Brainfuck","file":"brainfuck"},"bro":{"title":"Bro","file":"bro"},"c":{"title":"C","file":"c"},"csharp":{"title":"C#","file":"csharp"},"cpp":{"title":"C++","file":"cpp"},"cil":{"title":"CIL","file":"cil"},"coffeescript":{"title":"CoffeeScript","file":"coffeescript"},"cmake":{"title":"CMake","file":"cmake"},"clojure":{"title":"Clojure","file":"clojure"},"crystal":{"title":"Crystal","file":"crystal"},"csp":{"title":"Content-Security-Policy","file":"csp"},"css-extras":{"title":"CSS Extras","file":"css-extras"},"d":{"title":"D","file":"d"},"dart":{"title":"Dart","file":"dart"},"diff":{"title":"Diff","file":"diff"},"django":{"title":"Django/Jinja2","file":"django"},"docker":{"title":"Docker","file":"docker"},"ebnf":{"title":"Extended Backus–Naur form","file":"ebnf"},"eiffel":{"title":"Eiffel","file":"eiffel"},"ejs":{"title":"EJS","file":"ejs"},"elixir":{"title":"Elixir","file":"elixir"},"elm":{"title":"Elm","file":"elm"},"erb":{"title":"ERB","file":"erb"},"erlang":{"title":"Erlang","file":"erlang"},"fsharp":{"title":"F#","file":"fsharp"},"flow":{"title":"Flow","file":"flow"},"fortran":{"title":"Fortran","file":"fortran"},"gcode":{"title":"G-code","file":"gcode"},"gedcom":{"title":"GEDCOM","file":"gedcom"},"gherkin":{"title":"Gherkin","file":"gherkin"},"git":{"title":"Git","file":"git"},"glsl":{"title":"GLSL","file":"glsl"},"gml":{"title":"GameMaker Language","file":"gml"},"go":{"title":"Go","file":"go"},"graphql":{"title":"GraphQL","file":"graphql"},"groovy":{"title":"Groovy","file":"groovy"},"haml":{"title":"Haml","file":"haml"},"handlebars":{"title":"Handlebars","file":"handlebars"},"haskell":{"title":"Haskell","file":"haskell"},"haxe":{"title":"Haxe","file":"haxe"},"hcl":{"title":"HCL","file":"hcl"},"http":{"title":"HTTP","file":"http"},"hpkp":{"title":"HTTP Public-Key-Pins","file":"hpkp"},"hsts":{"title":"HTTP Strict-Transport-Security","file":"hsts"},"ichigojam":{"title":"IchigoJam","file":"ichigojam"},"icon":{"title":"Icon","file":"icon"},"inform7":{"title":"Inform 7","file":"inform7"},"ini":{"title":"Ini","file":"ini"},"io":{"title":"Io","file":"io"},"j":{"title":"J","file":"j"},"java":{"title":"Java","file":"java"},"javadoc":{"title":"JavaDoc","file":"javadoc"},"javadoclike":{"title":"JavaDoc-like","file":"javadoclike"},"javastacktrace":{"title":"Java stack trace","file":"javastacktrace"},"jolie":{"title":"Jolie","file":"jolie"},"jq":{"title":"JQ","file":"jq"},"jsdoc":{"title":"JSDoc","file":"jsdoc"},"js-extras":{"title":"JS Extras","file":"js-extras"},"json":{"title":"JSON","file":"json"},"jsonp":{"title":"JSONP","file":"jsonp"},"json5":{"title":"JSON5","file":"json5"},"julia":{"title":"Julia","file":"julia"},"keyman":{"title":"Keyman","file":"keyman"},"kotlin":{"title":"Kotlin","file":"kotlin"},"latex":{"title":"LaTeX","file":"latex"},"tex":{"title":"TeX","file":"latex"},"context":{"title":"ConTeXt","file":"latex"},"less":{"title":"Less","file":"less"},"liquid":{"title":"Liquid","file":"liquid"},"lisp":{"title":"Lisp","file":"lisp"},"livescript":{"title":"LiveScript","file":"livescript"},"lolcode":{"title":"LOLCODE","file":"lolcode"},"lua":{"title":"Lua","file":"lua"},"makefile":{"title":"Makefile","file":"makefile"},"markdown":{"title":"Markdown","file":"markdown"},"markup-templating":{"title":"Markup templating","file":"markup-templating"},"matlab":{"title":"MATLAB","file":"matlab"},"mel":{"title":"MEL","file":"mel"},"mizar":{"title":"Mizar","file":"mizar"},"monkey":{"title":"Monkey","file":"monkey"},"n1ql":{"title":"N1QL","file":"n1ql"},"n4js":{"title":"N4JS","file":"n4js"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","file":"nand2tetris-hdl"},"nasm":{"title":"NASM","file":"nasm"},"nginx":{"title":"nginx","file":"nginx"},"nim":{"title":"Nim","file":"nim"},"nix":{"title":"Nix","file":"nix"},"nsis":{"title":"NSIS","file":"nsis"},"objectivec":{"title":"Objective-C","file":"objectivec"},"ocaml":{"title":"OCaml","file":"ocaml"},"opencl":{"title":"OpenCL","file":"opencl"},"oz":{"title":"Oz","file":"oz"},"parigp":{"title":"PARI/GP","file":"parigp"},"parser":{"title":"Parser","file":"parser"},"pascal":{"title":"Pascal","file":"pascal"},"perl":{"title":"Perl","file":"perl"},"php":{"title":"PHP","file":"php"},"phpdoc":{"title":"PHPDoc","file":"phpdoc"},"php-extras":{"title":"PHP Extras","file":"php-extras"},"plsql":{"title":"PL/SQL","file":"plsql"},"powershell":{"title":"PowerShell","file":"powershell"},"processing":{"title":"Processing","file":"processing"},"prolog":{"title":"Prolog","file":"prolog"},"properties":{"title":".properties","file":"properties"},"protobuf":{"title":"Protocol Buffers","file":"protobuf"},"pug":{"title":"Pug","file":"pug"},"puppet":{"title":"Puppet","file":"puppet"},"pure":{"title":"Pure","file":"pure"},"python":{"title":"Python","file":"python"},"q":{"title":"Q (kdb+ database)","file":"q"},"qore":{"title":"Qore","file":"qore"},"r":{"title":"R","file":"r"},"jsx":{"title":"React JSX","file":"jsx"},"tsx":{"title":"React TSX","file":"tsx"},"renpy":{"title":"Ren'py","file":"renpy"},"reason":{"title":"Reason","file":"reason"},"regex":{"title":"Regex","file":"regex"},"rest":{"title":"reST (reStructuredText)","file":"rest"},"rip":{"title":"Rip","file":"rip"},"roboconf":{"title":"Roboconf","file":"roboconf"},"ruby":{"title":"Ruby","file":"ruby"},"rust":{"title":"Rust","file":"rust"},"sas":{"title":"SAS","file":"sas"},"sass":{"title":"Sass (Sass)","file":"sass"},"scss":{"title":"Sass (Scss)","file":"scss"},"scala":{"title":"Scala","file":"scala"},"scheme":{"title":"Scheme","file":"scheme"},"shell-session":{"title":"Shell session","file":"shell-session"},"smalltalk":{"title":"Smalltalk","file":"smalltalk"},"smarty":{"title":"Smarty","file":"smarty"},"sql":{"title":"SQL","file":"sql"},"soy":{"title":"Soy (Closure Template)","file":"soy"},"stylus":{"title":"Stylus","file":"stylus"},"swift":{"title":"Swift","file":"swift"},"tap":{"title":"TAP","file":"tap"},"tcl":{"title":"Tcl","file":"tcl"},"textile":{"title":"Textile","file":"textile"},"toml":{"title":"TOML","file":"toml"},"tt2":{"title":"Template Toolkit 2","file":"tt2"},"twig":{"title":"Twig","file":"twig"},"typescript":{"title":"TypeScript","file":"typescript"},"t4-cs":{"title":"T4 Text Templates (C#)","file":"t4-cs"},"t4-vb":{"title":"T4 Text Templates (VB)","file":"t4-vb"},"t4-templating":{"title":"T4 templating","file":"t4-templating"},"vala":{"title":"Vala","file":"vala"},"vbnet":{"title":"VB.Net","file":"vbnet"},"velocity":{"title":"Velocity","file":"velocity"},"verilog":{"title":"Verilog","file":"verilog"},"vhdl":{"title":"VHDL","file":"vhdl"},"vim":{"title":"vim","file":"vim"},"visual-basic":{"title":"Visual Basic","file":"visual-basic"},"wasm":{"title":"WebAssembly","file":"wasm"},"wiki":{"title":"Wiki markup","file":"wiki"},"xeora":{"title":"Xeora","file":"xeora"},"xojo":{"title":"Xojo (REALbasic)","file":"xojo"},"xquery":{"title":"XQuery","file":"xquery"},"yaml":{"title":"YAML","file":"yaml"}}/*END*/;});
\ No newline at end of file
+define([],function(){return /*START*/{"markup":{"title":"Markup","file":"markup"},"html":{"title":"HTML","file":"markup"},"xml":{"title":"XML","file":"markup"},"svg":{"title":"SVG","file":"markup"},"mathml":{"title":"MathML","file":"markup"},"css":{"title":"CSS","file":"css"},"clike":{"title":"C-like","file":"clike"},"javascript":{"title":"JavaScript","file":"javascript"},"abap":{"title":"ABAP","file":"abap"},"abnf":{"title":"Augmented Backus–Naur form","file":"abnf"},"actionscript":{"title":"ActionScript","file":"actionscript"},"ada":{"title":"Ada","file":"ada"},"antlr4":{"title":"ANTLR4","file":"antlr4"},"apacheconf":{"title":"Apache Configuration","file":"apacheconf"},"apl":{"title":"APL","file":"apl"},"applescript":{"title":"AppleScript","file":"applescript"},"aql":{"title":"AQL","file":"aql"},"arduino":{"title":"Arduino","file":"arduino"},"arff":{"title":"ARFF","file":"arff"},"asciidoc":{"title":"AsciiDoc","file":"asciidoc"},"asm6502":{"title":"6502 Assembly","file":"asm6502"},"aspnet":{"title":"ASP.NET (C#)","file":"aspnet"},"autohotkey":{"title":"AutoHotkey","file":"autohotkey"},"autoit":{"title":"AutoIt","file":"autoit"},"bash":{"title":"Bash","file":"bash"},"basic":{"title":"BASIC","file":"basic"},"batch":{"title":"Batch","file":"batch"},"bbcode":{"title":"BBcode","file":"bbcode"},"bison":{"title":"Bison","file":"bison"},"bnf":{"title":"Backus–Naur form","file":"bnf"},"brainfuck":{"title":"Brainfuck","file":"brainfuck"},"brightscript":{"title":"BrightScript","file":"brightscript"},"bro":{"title":"Bro","file":"bro"},"c":{"title":"C","file":"c"},"concurnas":{"title":"Concurnas","file":"concurnas"},"csharp":{"title":"C#","file":"csharp"},"cpp":{"title":"C++","file":"cpp"},"cil":{"title":"CIL","file":"cil"},"coffeescript":{"title":"CoffeeScript","file":"coffeescript"},"cmake":{"title":"CMake","file":"cmake"},"clojure":{"title":"Clojure","file":"clojure"},"crystal":{"title":"Crystal","file":"crystal"},"csp":{"title":"Content-Security-Policy","file":"csp"},"css-extras":{"title":"CSS Extras","file":"css-extras"},"d":{"title":"D","file":"d"},"dart":{"title":"Dart","file":"dart"},"dax":{"title":"DAX","file":"dax"},"diff":{"title":"Diff","file":"diff"},"django":{"title":"Django/Jinja2","file":"django"},"dns-zone-file":{"title":"DNS zone file","file":"dns-zone-file"},"docker":{"title":"Docker","file":"docker"},"ebnf":{"title":"Extended Backus–Naur form","file":"ebnf"},"eiffel":{"title":"Eiffel","file":"eiffel"},"ejs":{"title":"EJS","file":"ejs"},"elixir":{"title":"Elixir","file":"elixir"},"elm":{"title":"Elm","file":"elm"},"etlua":{"title":"Embedded Lua templating","file":"etlua"},"erb":{"title":"ERB","file":"erb"},"erlang":{"title":"Erlang","file":"erlang"},"excel-formula":{"title":"Excel Formula","file":"excel-formula"},"fsharp":{"title":"F#","file":"fsharp"},"factor":{"title":"Factor","file":"factor"},"firestore-security-rules":{"title":"Firestore security rules","file":"firestore-security-rules"},"flow":{"title":"Flow","file":"flow"},"fortran":{"title":"Fortran","file":"fortran"},"ftl":{"title":"FreeMarker Template Language","file":"ftl"},"gcode":{"title":"G-code","file":"gcode"},"gdscript":{"title":"GDScript","file":"gdscript"},"gedcom":{"title":"GEDCOM","file":"gedcom"},"gherkin":{"title":"Gherkin","file":"gherkin"},"git":{"title":"Git","file":"git"},"glsl":{"title":"GLSL","file":"glsl"},"gml":{"title":"GameMaker Language","file":"gml"},"go":{"title":"Go","file":"go"},"graphql":{"title":"GraphQL","file":"graphql"},"groovy":{"title":"Groovy","file":"groovy"},"haml":{"title":"Haml","file":"haml"},"handlebars":{"title":"Handlebars","file":"handlebars"},"haskell":{"title":"Haskell","file":"haskell"},"haxe":{"title":"Haxe","file":"haxe"},"hcl":{"title":"HCL","file":"hcl"},"http":{"title":"HTTP","file":"http"},"hpkp":{"title":"HTTP Public-Key-Pins","file":"hpkp"},"hsts":{"title":"HTTP Strict-Transport-Security","file":"hsts"},"ichigojam":{"title":"IchigoJam","file":"ichigojam"},"icon":{"title":"Icon","file":"icon"},"inform7":{"title":"Inform 7","file":"inform7"},"ini":{"title":"Ini","file":"ini"},"io":{"title":"Io","file":"io"},"j":{"title":"J","file":"j"},"java":{"title":"Java","file":"java"},"javadoc":{"title":"JavaDoc","file":"javadoc"},"javadoclike":{"title":"JavaDoc-like","file":"javadoclike"},"javastacktrace":{"title":"Java stack trace","file":"javastacktrace"},"jolie":{"title":"Jolie","file":"jolie"},"jq":{"title":"JQ","file":"jq"},"jsdoc":{"title":"JSDoc","file":"jsdoc"},"js-extras":{"title":"JS Extras","file":"js-extras"},"js-templates":{"title":"JS Templates","file":"js-templates"},"json":{"title":"JSON","file":"json"},"jsonp":{"title":"JSONP","file":"jsonp"},"json5":{"title":"JSON5","file":"json5"},"julia":{"title":"Julia","file":"julia"},"keyman":{"title":"Keyman","file":"keyman"},"kotlin":{"title":"Kotlin","file":"kotlin"},"latex":{"title":"LaTeX","file":"latex"},"tex":{"title":"TeX","file":"latex"},"context":{"title":"ConTeXt","file":"latex"},"latte":{"title":"Latte","file":"latte"},"less":{"title":"Less","file":"less"},"lilypond":{"title":"LilyPond","file":"lilypond"},"liquid":{"title":"Liquid","file":"liquid"},"lisp":{"title":"Lisp","file":"lisp"},"livescript":{"title":"LiveScript","file":"livescript"},"llvm":{"title":"LLVM IR","file":"llvm"},"lolcode":{"title":"LOLCODE","file":"lolcode"},"lua":{"title":"Lua","file":"lua"},"makefile":{"title":"Makefile","file":"makefile"},"markdown":{"title":"Markdown","file":"markdown"},"markup-templating":{"title":"Markup templating","file":"markup-templating"},"matlab":{"title":"MATLAB","file":"matlab"},"mel":{"title":"MEL","file":"mel"},"mizar":{"title":"Mizar","file":"mizar"},"monkey":{"title":"Monkey","file":"monkey"},"moonscript":{"title":"MoonScript","file":"moonscript"},"n1ql":{"title":"N1QL","file":"n1ql"},"n4js":{"title":"N4JS","file":"n4js"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","file":"nand2tetris-hdl"},"nasm":{"title":"NASM","file":"nasm"},"neon":{"title":"NEON","file":"neon"},"nginx":{"title":"nginx","file":"nginx"},"nim":{"title":"Nim","file":"nim"},"nix":{"title":"Nix","file":"nix"},"nsis":{"title":"NSIS","file":"nsis"},"objectivec":{"title":"Objective-C","file":"objectivec"},"ocaml":{"title":"OCaml","file":"ocaml"},"opencl":{"title":"OpenCL","file":"opencl"},"oz":{"title":"Oz","file":"oz"},"parigp":{"title":"PARI/GP","file":"parigp"},"parser":{"title":"Parser","file":"parser"},"pascal":{"title":"Pascal","file":"pascal"},"pascaligo":{"title":"Pascaligo","file":"pascaligo"},"pcaxis":{"title":"PC-Axis","file":"pcaxis"},"perl":{"title":"Perl","file":"perl"},"php":{"title":"PHP","file":"php"},"phpdoc":{"title":"PHPDoc","file":"phpdoc"},"php-extras":{"title":"PHP Extras","file":"php-extras"},"plsql":{"title":"PL/SQL","file":"plsql"},"powerquery":{"title":"PowerQuery","file":"powerquery"},"powershell":{"title":"PowerShell","file":"powershell"},"processing":{"title":"Processing","file":"processing"},"prolog":{"title":"Prolog","file":"prolog"},"properties":{"title":".properties","file":"properties"},"protobuf":{"title":"Protocol Buffers","file":"protobuf"},"pug":{"title":"Pug","file":"pug"},"puppet":{"title":"Puppet","file":"puppet"},"pure":{"title":"Pure","file":"pure"},"python":{"title":"Python","file":"python"},"q":{"title":"Q (kdb+ database)","file":"q"},"qml":{"title":"QML","file":"qml"},"qore":{"title":"Qore","file":"qore"},"r":{"title":"R","file":"r"},"jsx":{"title":"React JSX","file":"jsx"},"tsx":{"title":"React TSX","file":"tsx"},"renpy":{"title":"Ren'py","file":"renpy"},"reason":{"title":"Reason","file":"reason"},"regex":{"title":"Regex","file":"regex"},"rest":{"title":"reST (reStructuredText)","file":"rest"},"rip":{"title":"Rip","file":"rip"},"roboconf":{"title":"Roboconf","file":"roboconf"},"robotframework":{"title":"Robot Framework","file":"robotframework"},"ruby":{"title":"Ruby","file":"ruby"},"rust":{"title":"Rust","file":"rust"},"sas":{"title":"SAS","file":"sas"},"sass":{"title":"Sass (Sass)","file":"sass"},"scss":{"title":"Sass (Scss)","file":"scss"},"scala":{"title":"Scala","file":"scala"},"scheme":{"title":"Scheme","file":"scheme"},"shell-session":{"title":"Shell session","file":"shell-session"},"smalltalk":{"title":"Smalltalk","file":"smalltalk"},"smarty":{"title":"Smarty","file":"smarty"},"solidity":{"title":"Solidity (Ethereum)","file":"solidity"},"solution-file":{"title":"Solution file","file":"solution-file"},"soy":{"title":"Soy (Closure Template)","file":"soy"},"sparql":{"title":"SPARQL","file":"sparql"},"splunk-spl":{"title":"Splunk SPL","file":"splunk-spl"},"sqf":{"title":"SQF: Status Quo Function (Arma 3)","file":"sqf"},"sql":{"title":"SQL","file":"sql"},"stylus":{"title":"Stylus","file":"stylus"},"swift":{"title":"Swift","file":"swift"},"tap":{"title":"TAP","file":"tap"},"tcl":{"title":"Tcl","file":"tcl"},"textile":{"title":"Textile","file":"textile"},"toml":{"title":"TOML","file":"toml"},"tt2":{"title":"Template Toolkit 2","file":"tt2"},"turtle":{"title":"Turtle","file":"turtle"},"twig":{"title":"Twig","file":"twig"},"typescript":{"title":"TypeScript","file":"typescript"},"t4-cs":{"title":"T4 Text Templates (C#)","file":"t4-cs"},"t4-vb":{"title":"T4 Text Templates (VB)","file":"t4-vb"},"t4-templating":{"title":"T4 templating","file":"t4-templating"},"vala":{"title":"Vala","file":"vala"},"vbnet":{"title":"VB.Net","file":"vbnet"},"velocity":{"title":"Velocity","file":"velocity"},"verilog":{"title":"Verilog","file":"verilog"},"vhdl":{"title":"VHDL","file":"vhdl"},"vim":{"title":"vim","file":"vim"},"visual-basic":{"title":"Visual Basic","file":"visual-basic"},"wasm":{"title":"WebAssembly","file":"wasm"},"wiki":{"title":"Wiki markup","file":"wiki"},"xeora":{"title":"Xeora","file":"xeora"},"xojo":{"title":"Xojo (REALbasic)","file":"xojo"},"xquery":{"title":"XQuery","file":"xquery"},"yaml":{"title":"YAML","file":"yaml"},"zig":{"title":"Zig","file":"zig"}}/*END*/;});
\ No newline at end of file
+
+/* **********************************************
+ Begin prism-core.js
+********************************************** */
+
var _self = (typeof window !== 'undefined')
? window // if in browser
: (
var lang = /\blang(?:uage)?-([\w-]+)\b/i;
var uniqueId = 0;
+
var _ = {
manual: _self.Prism && _self.Prism.manual,
disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
util: {
- encode: function (tokens) {
+ encode: function encode(tokens) {
if (tokens instanceof Token) {
- return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
+ return new Token(tokens.type, encode(tokens.content), tokens.alias);
} else if (Array.isArray(tokens)) {
- return tokens.map(_.util.encode);
+ return tokens.map(encode);
} else {
return tokens.replace(/&/g, '&').replace(/</g, '<').replace(/\u00a0/g, ' ');
}
default:
return o;
}
+ },
+
+ /**
+ * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
+ *
+ * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
+ *
+ * @param {Element} element
+ * @returns {string}
+ */
+ getLanguage: function (element) {
+ while (element && !lang.test(element.className)) {
+ element = element.parentElement;
+ }
+ if (element) {
+ return (element.className.match(lang) || [, 'none'])[1].toLowerCase();
+ }
+ return 'none';
+ },
+
+ /**
+ * Returns the script element that is currently executing.
+ *
+ * This does __not__ work for line script element.
+ *
+ * @returns {HTMLScriptElement | null}
+ */
+ currentScript: function () {
+ if (typeof document === 'undefined') {
+ return null;
+ }
+ if ('currentScript' in document) {
+ return document.currentScript;
+ }
+
+ // IE11 workaround
+ // we'll get the src of the current script by parsing IE11's error stack trace
+ // this will not work for inline scripts
+
+ try {
+ throw new Error();
+ } catch (err) {
+ // Get file src url from stack. Specifically works with the format of stack traces in IE.
+ // A stack will look like this:
+ //
+ // Error
+ // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
+ // at Global code (http://localhost/components/prism-core.js:606:1)
+
+ var src = (/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(err.stack) || [])[1];
+ if (src) {
+ var scripts = document.getElementsByTagName('script');
+ for (var i in scripts) {
+ if (scripts[i].src == src) {
+ return scripts[i];
+ }
+ }
+ }
+ return null;
+ }
}
},
highlightAllUnder: function(container, async, callback) {
var env = {
callback: callback,
+ container: container,
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
};
- _.hooks.run("before-highlightall", env);
+ _.hooks.run('before-highlightall', env);
- var elements = env.elements || container.querySelectorAll(env.selector);
+ env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
- for (var i=0, element; element = elements[i++];) {
+ _.hooks.run('before-all-elements-highlight', env);
+
+ for (var i = 0, element; element = env.elements[i++];) {
_.highlightElement(element, async === true, env.callback);
}
},
highlightElement: function(element, async, callback) {
// Find language
- var language = 'none', grammar, parent = element;
-
- while (parent && !lang.test(parent.className)) {
- parent = parent.parentNode;
- }
-
- if (parent) {
- language = (parent.className.match(lang) || [,'none'])[1].toLowerCase();
- grammar = _.languages[language];
- }
+ var language = _.util.getLanguage(element);
+ var grammar = _.languages[language];
// Set language on the element, if not present
element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
- if (element.parentNode) {
- // Set language on the parent, for styling
- parent = element.parentNode;
-
- if (/pre/i.test(parent.nodeName)) {
- parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
- }
+ // Set language on the parent, for styling
+ var parent = element.parentNode;
+ if (parent && parent.nodeName.toLowerCase() === 'pre') {
+ parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
}
var code = element.textContent;
code: code
};
- var insertHighlightedCode = function (highlightedCode) {
+ function insertHighlightedCode(highlightedCode) {
env.highlightedCode = highlightedCode;
_.hooks.run('before-insert', env);
if (!env.code) {
_.hooks.run('complete', env);
+ callback && callback.call(env.element);
return;
}
return Token.stringify(_.util.encode(env.tokens), env.language);
},
- matchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) {
- for (var token in grammar) {
- if(!grammar.hasOwnProperty(token) || !grammar[token]) {
- continue;
- }
-
- if (token == target) {
- return;
- }
-
- var patterns = grammar[token];
- patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns];
-
- for (var j = 0; j < patterns.length; ++j) {
- var pattern = patterns[j],
- inside = pattern.inside,
- lookbehind = !!pattern.lookbehind,
- greedy = !!pattern.greedy,
- lookbehindLength = 0,
- alias = pattern.alias;
-
- if (greedy && !pattern.pattern.global) {
- // Without the global flag, lastIndex won't work
- var flags = pattern.pattern.toString().match(/[imuy]*$/)[0];
- pattern.pattern = RegExp(pattern.pattern.source, flags + "g");
- }
-
- pattern = pattern.pattern || pattern;
-
- // Don’t cache length as it changes during the loop
- for (var i = index, pos = startPos; i < strarr.length; pos += strarr[i].length, ++i) {
-
- var str = strarr[i];
-
- if (strarr.length > text.length) {
- // Something went terribly wrong, ABORT, ABORT!
- return;
- }
-
- if (str instanceof Token) {
- continue;
- }
-
- if (greedy && i != strarr.length - 1) {
- pattern.lastIndex = pos;
- var match = pattern.exec(text);
- if (!match) {
- break;
- }
-
- var from = match.index + (lookbehind ? match[1].length : 0),
- to = match.index + match[0].length,
- k = i,
- p = pos;
-
- for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) {
- p += strarr[k].length;
- // Move the index i to the element in strarr that is closest to from
- if (from >= p) {
- ++i;
- pos = p;
- }
- }
-
- // If strarr[i] is a Token, then the match starts inside another Token, which is invalid
- if (strarr[i] instanceof Token) {
- continue;
- }
-
- // Number of tokens to delete and replace with the new match
- delNum = k - i;
- str = text.slice(pos, p);
- match.index -= pos;
- } else {
- pattern.lastIndex = 0;
-
- var match = pattern.exec(str),
- delNum = 1;
- }
-
- if (!match) {
- if (oneshot) {
- break;
- }
-
- continue;
- }
-
- if(lookbehind) {
- lookbehindLength = match[1] ? match[1].length : 0;
- }
-
- 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) {
- ++i;
- pos += before.length;
- 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);
-
- if (delNum != 1)
- _.matchGrammar(text, strarr, grammar, i, pos, true, token);
-
- if (oneshot)
- break;
- }
- }
- }
- },
-
tokenize: function(text, grammar) {
- var strarr = [text];
-
var rest = grammar.rest;
-
if (rest) {
for (var token in rest) {
grammar[token] = rest[token];
delete grammar.rest;
}
- _.matchGrammar(text, strarr, grammar, 0, 0, false);
+ var tokenList = new LinkedList();
+ addAfter(tokenList, tokenList.head, text);
- return strarr;
+ matchGrammar(text, tokenList, grammar, tokenList.head, 0);
+
+ return toArray(tokenList);
},
hooks: {
this.content = content;
this.alias = alias;
// Copy of the full string this token was created from
- this.length = (matchedStr || "").length|0;
+ this.length = (matchedStr || '').length|0;
this.greedy = !!greedy;
}
-Token.stringify = function(o, language) {
+Token.stringify = function stringify(o, language) {
if (typeof o == 'string') {
return o;
}
-
if (Array.isArray(o)) {
- return o.map(function(element) {
- return Token.stringify(element, language);
- }).join('');
+ var s = '';
+ o.forEach(function (e) {
+ s += stringify(e, language);
+ });
+ return s;
}
var env = {
type: o.type,
- content: Token.stringify(o.content, language),
+ content: stringify(o.content, language),
tag: 'span',
classes: ['token', o.type],
attributes: {},
language: language
};
- if (o.alias) {
- var aliases = Array.isArray(o.alias) ? o.alias : [o.alias];
- Array.prototype.push.apply(env.classes, aliases);
+ var aliases = o.alias;
+ if (aliases) {
+ if (Array.isArray(aliases)) {
+ Array.prototype.push.apply(env.classes, aliases);
+ } else {
+ env.classes.push(aliases);
+ }
}
_.hooks.run('wrap', env);
- var attributes = Object.keys(env.attributes).map(function(name) {
- return name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"';
- }).join(' ');
+ var attributes = '';
+ for (var name in env.attributes) {
+ attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"';
+ }
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '</' + env.tag + '>';
+ return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
};
+/**
+ * @param {string} text
+ * @param {LinkedList<string | Token>} tokenList
+ * @param {any} grammar
+ * @param {LinkedListNode<string | Token>} startNode
+ * @param {number} startPos
+ * @param {boolean} [oneshot=false]
+ * @param {string} [target]
+ */
+function matchGrammar(text, tokenList, grammar, startNode, startPos, oneshot, target) {
+ for (var token in grammar) {
+ if (!grammar.hasOwnProperty(token) || !grammar[token]) {
+ continue;
+ }
+
+ var patterns = grammar[token];
+ patterns = Array.isArray(patterns) ? patterns : [patterns];
+
+ for (var j = 0; j < patterns.length; ++j) {
+ if (target && target == token + ',' + j) {
+ return;
+ }
+
+ var pattern = patterns[j],
+ inside = pattern.inside,
+ lookbehind = !!pattern.lookbehind,
+ greedy = !!pattern.greedy,
+ lookbehindLength = 0,
+ alias = pattern.alias;
+
+ if (greedy && !pattern.pattern.global) {
+ // Without the global flag, lastIndex won't work
+ var flags = pattern.pattern.toString().match(/[imsuy]*$/)[0];
+ pattern.pattern = RegExp(pattern.pattern.source, flags + 'g');
+ }
+
+ pattern = pattern.pattern || pattern;
+
+ for ( // iterate the token list and keep track of the current token/string position
+ var currentNode = startNode.next, pos = startPos;
+ currentNode !== tokenList.tail;
+ pos += currentNode.value.length, currentNode = currentNode.next
+ ) {
+
+ var str = currentNode.value;
+
+ if (tokenList.length > text.length) {
+ // Something went terribly wrong, ABORT, ABORT!
+ return;
+ }
+
+ if (str instanceof Token) {
+ continue;
+ }
+
+ var removeCount = 1; // this is the to parameter of removeBetween
+
+ if (greedy && currentNode != tokenList.tail.prev) {
+ pattern.lastIndex = pos;
+ var match = pattern.exec(text);
+ if (!match) {
+ break;
+ }
+
+ var from = match.index + (lookbehind && match[1] ? match[1].length : 0);
+ var to = match.index + match[0].length;
+ var p = pos;
+
+ // find the node that contains the match
+ p += currentNode.value.length;
+ while (from >= p) {
+ currentNode = currentNode.next;
+ p += currentNode.value.length;
+ }
+ // adjust pos (and p)
+ p -= currentNode.value.length;
+ pos = p;
+
+ // the current node is a Token, then the match starts inside another Token, which is invalid
+ if (currentNode.value instanceof Token) {
+ continue;
+ }
+
+ // find the last node which is affected by this match
+ for (
+ var k = currentNode;
+ k !== tokenList.tail && (p < to || (typeof k.value === 'string' && !k.prev.value.greedy));
+ k = k.next
+ ) {
+ removeCount++;
+ p += k.value.length;
+ }
+ removeCount--;
+
+ // replace with the new match
+ str = text.slice(pos, p);
+ match.index -= pos;
+ } else {
+ pattern.lastIndex = 0;
+
+ var match = pattern.exec(str);
+ }
+
+ if (!match) {
+ if (oneshot) {
+ break;
+ }
+
+ continue;
+ }
+
+ if (lookbehind) {
+ lookbehindLength = match[1] ? match[1].length : 0;
+ }
+
+ var from = match.index + lookbehindLength,
+ match = match[0].slice(lookbehindLength),
+ to = from + match.length,
+ before = str.slice(0, from),
+ after = str.slice(to);
+
+ var removeFrom = currentNode.prev;
+
+ if (before) {
+ removeFrom = addAfter(tokenList, removeFrom, before);
+ pos += before.length;
+ }
+
+ removeRange(tokenList, removeFrom, removeCount);
+
+ var wrapped = new Token(token, inside ? _.tokenize(match, inside) : match, alias, match, greedy);
+ currentNode = addAfter(tokenList, removeFrom, wrapped);
+
+ if (after) {
+ addAfter(tokenList, currentNode, after);
+ }
+
+
+ if (removeCount > 1)
+ matchGrammar(text, tokenList, grammar, currentNode.prev, pos, true, token + ',' + j);
+
+ if (oneshot)
+ break;
+ }
+ }
+ }
+}
+
+/**
+ * @typedef LinkedListNode
+ * @property {T} value
+ * @property {LinkedListNode<T> | null} prev The previous node.
+ * @property {LinkedListNode<T> | null} next The next node.
+ * @template T
+ */
+
+/**
+ * @template T
+ */
+function LinkedList() {
+ /** @type {LinkedListNode<T>} */
+ var head = { value: null, prev: null, next: null };
+ /** @type {LinkedListNode<T>} */
+ var tail = { value: null, prev: head, next: null };
+ head.next = tail;
+
+ /** @type {LinkedListNode<T>} */
+ this.head = head;
+ /** @type {LinkedListNode<T>} */
+ this.tail = tail;
+ this.length = 0;
+}
+
+/**
+ * Adds a new node with the given value to the list.
+ * @param {LinkedList<T>} list
+ * @param {LinkedListNode<T>} node
+ * @param {T} value
+ * @returns {LinkedListNode<T>} The added node.
+ * @template T
+ */
+function addAfter(list, node, value) {
+ // assumes that node != list.tail && values.length >= 0
+ var next = node.next;
+
+ var newNode = { value: value, prev: node, next: next };
+ node.next = newNode;
+ next.prev = newNode;
+ list.length++;
+
+ return newNode;
+}
+/**
+ * Removes `count` nodes after the given node. The given node will not be removed.
+ * @param {LinkedList<T>} list
+ * @param {LinkedListNode<T>} node
+ * @param {number} count
+ * @template T
+ */
+function removeRange(list, node, count) {
+ var next = node.next;
+ for (var i = 0; i < count && next !== list.tail; i++) {
+ next = next.next;
+ }
+ node.next = next;
+ next.prev = node;
+ list.length -= i;
+}
+/**
+ * @param {LinkedList<T>} list
+ * @returns {T[]}
+ * @template T
+ */
+function toArray(list) {
+ var array = [];
+ var node = list.head.next;
+ while (node !== list.tail) {
+ array.push(node.value);
+ node = node.next;
+ }
+ return array;
+}
+
+
if (!_self.document) {
if (!_self.addEventListener) {
// in Node.js
}
//Get current script and highlight
-var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();
+var script = _.util.currentScript();
if (script) {
_.filename = script.src;
- if (!_.manual && !script.hasAttribute('data-manual')) {
- // WoltLab Start
- _.highlightAutomaticallyCallback = function () {
- if (!_.manual) {
- _.highlightAll();
- }
- }
+ if (script.hasAttribute('data-manual')) {
+ _.manual = true;
+ }
+}
- if(document.readyState !== "loading") {
- if (window.requestAnimationFrame) {
- window.requestAnimationFrame(_.highlightAutomaticallyCallback);
- } else {
- window.setTimeout(_.highlightAutomaticallyCallback, 16);
- }
- }
- else {
- document.addEventListener('DOMContentLoaded', _.highlightAutomaticallyCallback);
+function highlightAutomaticallyCallback() {
+ if (!_.manual) {
+ _.highlightAll();
+ }
+}
+
+if (!_.manual) {
+ // If the document state is "loading", then we'll use DOMContentLoaded.
+ // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
+ // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
+ // might take longer one animation frame to execute which can create a race condition where only some plugins have
+ // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
+ // See https://github.com/PrismJS/prism/issues/2102
+ var readyState = document.readyState;
+ if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
+ document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
+ } else {
+ if (window.requestAnimationFrame) {
+ window.requestAnimationFrame(highlightAutomaticallyCallback);
+ } else {
+ window.setTimeout(highlightAutomaticallyCallback, 16);
}
- // WoltLab End
}
}