aboutsummaryrefslogtreecommitdiff
path: root/node_modules/prismjs/components/prism-yaml.js
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:38:48 +0800
committerruki <waruqi@gmail.com>2018-11-07 21:53:09 +0800
commit26105034da4fcce7ac883c899d781f016559310d (patch)
treec459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/prismjs/components/prism-yaml.js
parent2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff)
downloadxmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz
xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip
switch to vuepress
Diffstat (limited to 'node_modules/prismjs/components/prism-yaml.js')
-rw-r--r--node_modules/prismjs/components/prism-yaml.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/node_modules/prismjs/components/prism-yaml.js b/node_modules/prismjs/components/prism-yaml.js
new file mode 100644
index 00000000..9a168003
--- /dev/null
+++ b/node_modules/prismjs/components/prism-yaml.js
@@ -0,0 +1,45 @@
+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]*(?:$|,|]|}))/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': /---|[:[\]{}\-,|>?]|\.\.\./
+};