diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
| commit | a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch) | |
| tree | 542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-gn.min.js | |
| parent | ab355897a12b7bda1089a44de326d41455a0f7a3 (diff) | |
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-gn.min.js')
| -rw-r--r-- | public/prism/prism-gn.min.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/public/prism/prism-gn.min.js b/public/prism/prism-gn.min.js new file mode 100644 index 0000000..26aaf54 --- /dev/null +++ b/public/prism/prism-gn.min.js @@ -0,0 +1,42 @@ +(Prism.languages.gn = { + comment: { pattern: /#.*/, greedy: !0 }, + 'string-literal': { + pattern: /(^|[^\\"])"(?:[^\r\n"\\]|\\.)*"/, + lookbehind: !0, + greedy: !0, + inside: { + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$(?:\{[\s\S]*?\}|[a-zA-Z_]\w*|0x[a-fA-F0-9]{2})/, + lookbehind: !0, + inside: { + number: /^\$0x[\s\S]{2}$/, + variable: /^\$\w+$/, + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation', + }, + expression: { pattern: /[\s\S]+/, inside: null }, + }, + }, + string: /[\s\S]+/, + }, + }, + keyword: /\b(?:else|if)\b/, + boolean: /\b(?:false|true)\b/, + 'builtin-function': { + pattern: + /\b(?:assert|defined|foreach|import|pool|print|template|tool|toolchain)(?=\s*\()/i, + alias: 'keyword', + }, + function: /\b[a-z_]\w*(?=\s*\()/i, + constant: + /\b(?:current_cpu|current_os|current_toolchain|default_toolchain|host_cpu|host_os|root_build_dir|root_gen_dir|root_out_dir|target_cpu|target_gen_dir|target_os|target_out_dir)\b/, + number: /-?\b\d+\b/, + operator: /[-+!=<>]=?|&&|\|\|/, + punctuation: /[(){}[\],.]/, +}), + (Prism.languages.gn[ + 'string-literal' + ].inside.interpolation.inside.expression.inside = Prism.languages.gn), + (Prism.languages.gni = Prism.languages.gn); |
