From a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 30 Dec 2021 19:47:21 +0100 Subject: chore: add prismjs for syntax highlighting --- public/prism/prism-abap.js | 52 ++ public/prism/prism-abap.min.js | 34 + public/prism/prism-abnf.js | 57 ++ public/prism/prism-abnf.min.js | 45 + public/prism/prism-actionscript.js | 21 + public/prism/prism-actionscript.min.js | 17 + public/prism/prism-ada.js | 21 + public/prism/prism-ada.min.js | 19 + public/prism/prism-agda.js | 24 + public/prism/prism-agda.min.js | 10 + public/prism/prism-al.js | 28 + public/prism/prism-al.min.js | 24 + public/prism/prism-antlr4.js | 68 ++ public/prism/prism-antlr4.min.js | 45 + public/prism/prism-apacheconf.js | 49 ++ public/prism/prism-apacheconf.min.js | 40 + public/prism/prism-apex.js | 77 ++ public/prism/prism-apex.min.js | 58 ++ public/prism/prism-apl.js | 33 + public/prism/prism-apl.min.js | 15 + public/prism/prism-applescript.js | 19 + public/prism/prism-applescript.min.js | 18 + public/prism/prism-aql.js | 50 ++ public/prism/prism-aql.min.js | 29 + public/prism/prism-arduino.js | 10 + public/prism/prism-arduino.min.js | 9 + public/prism/prism-arff.js | 10 + public/prism/prism-arff.min.js | 7 + public/prism/prism-asciidoc.js | 246 ++++++ public/prism/prism-asciidoc.min.js | 158 ++++ public/prism/prism-asm6502.js | 30 + public/prism/prism-asm6502.min.js | 15 + public/prism/prism-asmatmel.js | 44 + public/prism/prism-asmatmel.min.js | 18 + public/prism/prism-aspnet.js | 60 ++ public/prism/prism-aspnet.min.js | 46 + public/prism/prism-autohotkey.js | 46 + public/prism/prism-autohotkey.min.js | 32 + public/prism/prism-autoit.js | 36 + public/prism/prism-autoit.min.js | 28 + public/prism/prism-avisynth.js | 208 +++++ public/prism/prism-avisynth.min.js | 119 +++ public/prism/prism-avro-idl.js | 52 ++ public/prism/prism-avro-idl.min.js | 38 + public/prism/prism-bash.js | 234 +++++ public/prism/prism-bash.min.js | 163 ++++ public/prism/prism-basic.js | 19 + public/prism/prism-basic.min.js | 11 + public/prism/prism-batch.js | 100 +++ public/prism/prism-batch.min.js | 83 ++ public/prism/prism-bbcode.js | 30 + public/prism/prism-bbcode.min.js | 18 + public/prism/prism-bicep.js | 81 ++ public/prism/prism-bicep.min.js | 54 ++ public/prism/prism-birb.js | 24 + public/prism/prism-birb.min.js | 14 + public/prism/prism-bison.js | 39 + public/prism/prism-bison.min.js | 26 + public/prism/prism-bnf.js | 21 + public/prism/prism-bnf.min.js | 11 + public/prism/prism-brainfuck.js | 20 + public/prism/prism-brainfuck.min.js | 8 + public/prism/prism-brightscript.js | 46 + public/prism/prism-brightscript.min.js | 34 + public/prism/prism-bro.js | 38 + public/prism/prism-bro.min.js | 24 + public/prism/prism-bsl.js | 79 ++ public/prism/prism-bsl.min.js | 48 + public/prism/prism-c.js | 86 ++ public/prism/prism-c.min.js | 60 ++ public/prism/prism-cfscript.js | 48 + public/prism/prism-cfscript.min.js | 37 + public/prism/prism-chaiscript.js | 61 ++ public/prism/prism-chaiscript.min.js | 50 ++ public/prism/prism-cil.js | 28 + public/prism/prism-cil.min.js | 20 + public/prism/prism-clike.js | 33 + public/prism/prism-clike.min.js | 23 + public/prism/prism-clojure.js | 33 + public/prism/prism-clojure.min.js | 23 + public/prism/prism-cmake.js | 34 + public/prism/prism-cmake.min.js | 28 + public/prism/prism-cobol.js | 56 ++ public/prism/prism-cobol.min.js | 41 + public/prism/prism-coffeescript.js | 94 ++ public/prism/prism-coffeescript.min.js | 53 ++ public/prism/prism-concurnas.js | 66 ++ public/prism/prism-concurnas.min.js | 58 ++ public/prism/prism-coq.js | 62 ++ public/prism/prism-coq.min.js | 48 + public/prism/prism-cpp.js | 122 +++ public/prism/prism-cpp.min.js | 90 ++ public/prism/prism-crystal.js | 55 ++ public/prism/prism-crystal.min.js | 42 + public/prism/prism-csharp.js | 478 ++++++++++ public/prism/prism-csharp.min.js | 254 ++++++ public/prism/prism-cshtml.js | 234 +++++ public/prism/prism-cshtml.min.js | 120 +++ public/prism/prism-csp.js | 78 ++ public/prism/prism-csp.min.js | 38 + public/prism/prism-css-extras.js | 123 +++ public/prism/prism-css-extras.min.js | 88 ++ public/prism/prism-css.js | 76 ++ public/prism/prism-css.min.js | 55 ++ public/prism/prism-csv.js | 6 + public/prism/prism-csv.min.js | 4 + public/prism/prism-cypher.js | 38 + public/prism/prism-cypher.min.js | 28 + public/prism/prism-d.js | 96 ++ public/prism/prism-d.min.js | 61 ++ public/prism/prism-dart.js | 83 ++ public/prism/prism-dart.min.js | 65 ++ public/prism/prism-dataweave.js | 41 + public/prism/prism-dataweave.min.js | 22 + public/prism/prism-dax.js | 30 + public/prism/prism-dax.min.js | 21 + public/prism/prism-dhall.js | 75 ++ public/prism/prism-dhall.min.js | 49 ++ public/prism/prism-diff.js | 62 ++ public/prism/prism-diff.min.js | 28 + public/prism/prism-django.js | 58 ++ public/prism/prism-django.min.js | 37 + public/prism/prism-dns-zone-file.js | 34 + public/prism/prism-dns-zone-file.min.js | 22 + public/prism/prism-docker.js | 124 +++ public/prism/prism-docker.min.js | 80 ++ public/prism/prism-dot.js | 86 ++ public/prism/prism-dot.min.js | 64 ++ public/prism/prism-ebnf.js | 22 + public/prism/prism-ebnf.min.js | 13 + public/prism/prism-editorconfig.js | 26 + public/prism/prism-editorconfig.min.js | 19 + public/prism/prism-eiffel.js | 35 + public/prism/prism-eiffel.min.js | 19 + public/prism/prism-ejs.js | 28 + public/prism/prism-ejs.min.js | 21 + public/prism/prism-elixir.js | 102 +++ public/prism/prism-elixir.min.js | 54 ++ public/prism/prism-elm.js | 49 ++ public/prism/prism-elm.min.js | 27 + public/prism/prism-erb.js | 28 + public/prism/prism-erb.min.js | 24 + public/prism/prism-erlang.js | 43 + public/prism/prism-erlang.min.js | 25 + public/prism/prism-etlua.js | 25 + public/prism/prism-etlua.min.js | 16 + public/prism/prism-excel-formula.js | 69 ++ public/prism/prism-excel-formula.min.js | 43 + public/prism/prism-factor.js | 963 +++++++++++++++++++++ public/prism/prism-factor.min.js | 745 ++++++++++++++++ public/prism/prism-false.js | 32 + public/prism/prism-false.min.js | 11 + public/prism/prism-firestore-security-rules.js | 36 + public/prism/prism-firestore-security-rules.min.js | 27 + public/prism/prism-flow.js | 38 + public/prism/prism-flow.min.js | 31 + public/prism/prism-fortran.js | 41 + public/prism/prism-fortran.min.js | 22 + public/prism/prism-fsharp.js | 79 ++ public/prism/prism-fsharp.min.js | 68 ++ public/prism/prism-ftl.js | 123 +++ public/prism/prism-ftl.min.js | 100 +++ public/prism/prism-gap.js | 57 ++ public/prism/prism-gap.min.js | 41 + public/prism/prism-gcode.js | 16 + public/prism/prism-gcode.min.js | 8 + public/prism/prism-gdscript.js | 30 + public/prism/prism-gdscript.min.js | 25 + public/prism/prism-gedcom.js | 30 + public/prism/prism-gedcom.min.js | 24 + public/prism/prism-gherkin.js | 86 ++ public/prism/prism-gherkin.min.js | 52 ++ public/prism/prism-git.js | 68 ++ public/prism/prism-git.min.js | 9 + public/prism/prism-glsl.js | 4 + public/prism/prism-glsl.min.js | 4 + public/prism/prism-gml.js | 13 + public/prism/prism-gml.min.js | 13 + public/prism/prism-gn.js | 56 ++ public/prism/prism-gn.min.js | 42 + public/prism/prism-go-module.js | 24 + public/prism/prism-go-module.min.js | 19 + public/prism/prism-go.js | 31 + public/prism/prism-go.min.js | 23 + public/prism/prism-graphql.js | 226 +++++ public/prism/prism-graphql.min.js | 131 +++ public/prism/prism-groovy.js | 72 ++ public/prism/prism-groovy.min.js | 51 ++ public/prism/prism-haml.js | 159 ++++ public/prism/prism-haml.min.js | 117 +++ public/prism/prism-handlebars.js | 44 + public/prism/prism-handlebars.min.js | 31 + public/prism/prism-haskell.js | 71 ++ public/prism/prism-haskell.min.js | 42 + public/prism/prism-haxe.js | 80 ++ public/prism/prism-haxe.min.js | 56 ++ public/prism/prism-hcl.js | 65 ++ public/prism/prism-hcl.min.js | 62 ++ public/prism/prism-hlsl.js | 20 + public/prism/prism-hlsl.min.js | 13 + public/prism/prism-hoon.js | 15 + public/prism/prism-hoon.min.js | 9 + public/prism/prism-hpkp.js | 15 + public/prism/prism-hpkp.min.js | 9 + public/prism/prism-hsts.js | 14 + public/prism/prism-hsts.min.js | 8 + public/prism/prism-http.js | 156 ++++ public/prism/prism-http.min.js | 103 +++ public/prism/prism-ichigojam.js | 17 + public/prism/prism-ichigojam.min.js | 12 + public/prism/prism-icon.js | 23 + public/prism/prism-icon.min.js | 20 + public/prism/prism-icu-message-format.js | 160 ++++ public/prism/prism-icu-message-format.min.js | 112 +++ public/prism/prism-idris.js | 20 + public/prism/prism-idris.min.js | 14 + public/prism/prism-iecst.js | 36 + public/prism/prism-iecst.min.js | 29 + public/prism/prism-ignore.js | 22 + public/prism/prism-ignore.min.js | 17 + public/prism/prism-inform7.js | 68 ++ public/prism/prism-inform7.min.js | 57 ++ public/prism/prism-ini.js | 42 + public/prism/prism-ini.min.js | 28 + public/prism/prism-io.js | 25 + public/prism/prism-io.min.js | 22 + public/prism/prism-j.js | 31 + public/prism/prism-j.min.js | 20 + public/prism/prism-java.js | 103 +++ public/prism/prism-java.min.js | 80 ++ public/prism/prism-javadoc.js | 93 ++ public/prism/prism-javadoc.min.js | 75 ++ public/prism/prism-javadoclike.js | 85 ++ public/prism/prism-javadoclike.min.js | 47 + public/prism/prism-javascript.js | 171 ++++ public/prism/prism-javascript.min.js | 126 +++ public/prism/prism-javastacktrace.js | 142 +++ public/prism/prism-javastacktrace.min.js | 79 ++ public/prism/prism-jexl.js | 16 + public/prism/prism-jexl.min.js | 16 + public/prism/prism-jolie.js | 46 + public/prism/prism-jolie.min.js | 38 + public/prism/prism-jq.js | 75 ++ public/prism/prism-jq.min.js | 56 ++ public/prism/prism-js-extras.js | 155 ++++ public/prism/prism-js-extras.min.js | 98 +++ public/prism/prism-js-templates.js | 379 ++++++++ public/prism/prism-js-templates.min.js | 146 ++++ public/prism/prism-jsdoc.js | 90 ++ public/prism/prism-jsdoc.min.js | 74 ++ public/prism/prism-json.js | 27 + public/prism/prism-json.min.js | 19 + public/prism/prism-json5.js | 23 + public/prism/prism-json5.min.js | 16 + public/prism/prism-jsonp.js | 7 + public/prism/prism-jsonp.min.js | 6 + public/prism/prism-jsstacktrace.js | 50 ++ public/prism/prism-jsstacktrace.min.js | 36 + public/prism/prism-jsx.js | 185 ++++ public/prism/prism-jsx.min.js | 103 +++ public/prism/prism-julia.js | 40 + public/prism/prism-julia.min.js | 27 + public/prism/prism-keepalived.js | 60 ++ public/prism/prism-keepalived.min.js | 38 + public/prism/prism-keyman.js | 47 + public/prism/prism-keyman.min.js | 32 + public/prism/prism-kotlin.js | 91 ++ public/prism/prism-kotlin.min.js | 66 ++ public/prism/prism-kumir.js | 119 +++ public/prism/prism-kumir.min.js | 66 ++ public/prism/prism-kusto.js | 50 ++ public/prism/prism-kusto.min.js | 32 + public/prism/prism-latex.js | 69 ++ public/prism/prism-latex.min.js | 43 + public/prism/prism-latte.js | 72 ++ public/prism/prism-latte.min.js | 53 ++ public/prism/prism-less.js | 56 ++ public/prism/prism-less.min.js | 26 + public/prism/prism-lilypond.js | 81 ++ public/prism/prism-lilypond.min.js | 66 ++ public/prism/prism-liquid.js | 74 ++ public/prism/prism-liquid.min.js | 45 + public/prism/prism-lisp.js | 217 +++++ public/prism/prism-lisp.min.js | 124 +++ public/prism/prism-livescript.js | 123 +++ public/prism/prism-livescript.min.js | 74 ++ public/prism/prism-llvm.js | 21 + public/prism/prism-llvm.min.js | 16 + public/prism/prism-log.js | 130 +++ public/prism/prism-log.min.js | 98 +++ public/prism/prism-lolcode.js | 50 ++ public/prism/prism-lolcode.min.js | 42 + public/prism/prism-lua.js | 23 + public/prism/prism-lua.min.js | 18 + public/prism/prism-magma.js | 38 + public/prism/prism-magma.min.js | 26 + public/prism/prism-makefile.js | 36 + public/prism/prism-makefile.min.js | 29 + public/prism/prism-markdown.js | 455 ++++++++++ public/prism/prism-markdown.min.js | 278 ++++++ public/prism/prism-markup-templating.js | 134 +++ public/prism/prism-markup-templating.min.js | 64 ++ public/prism/prism-markup.js | 196 +++++ public/prism/prism-markup.min.js | 123 +++ public/prism/prism-matlab.js | 14 + public/prism/prism-matlab.min.js | 10 + public/prism/prism-maxscript.js | 96 ++ public/prism/prism-maxscript.min.js | 55 ++ public/prism/prism-mel.js | 45 + public/prism/prism-mel.min.js | 24 + public/prism/prism-mermaid.js | 121 +++ public/prism/prism-mermaid.min.js | 86 ++ public/prism/prism-mizar.js | 13 + public/prism/prism-mizar.min.js | 10 + public/prism/prism-mongodb.js | 295 +++++++ public/prism/prism-mongodb.min.js | 280 ++++++ public/prism/prism-monkey.js | 32 + public/prism/prism-monkey.min.js | 22 + public/prism/prism-moonscript.js | 62 ++ public/prism/prism-moonscript.min.js | 48 + public/prism/prism-n1ql.js | 26 + public/prism/prism-n1ql.min.js | 14 + public/prism/prism-n4js.js | 15 + public/prism/prism-n4js.min.js | 8 + public/prism/prism-nand2tetris-hdl.js | 9 + public/prism/prism-nand2tetris-hdl.min.js | 9 + public/prism/prism-naniscript.js | 168 ++++ public/prism/prism-naniscript.min.js | 103 +++ public/prism/prism-nasm.js | 26 + public/prism/prism-nasm.min.js | 23 + public/prism/prism-neon.js | 44 + public/prism/prism-neon.min.js | 41 + public/prism/prism-nevod.js | 129 +++ public/prism/prism-nevod.min.js | 82 ++ public/prism/prism-nginx.js | 55 ++ public/prism/prism-nginx.min.js | 30 + public/prism/prism-nim.js | 49 ++ public/prism/prism-nim.min.js | 30 + public/prism/prism-nix.js | 39 + public/prism/prism-nix.min.js | 32 + public/prism/prism-nsis.js | 33 + public/prism/prism-nsis.min.js | 25 + public/prism/prism-objectivec.js | 13 + public/prism/prism-objectivec.min.js | 8 + public/prism/prism-ocaml.js | 60 ++ public/prism/prism-ocaml.min.js | 27 + public/prism/prism-opencl.js | 69 ++ public/prism/prism-opencl.min.js | 50 ++ public/prism/prism-openqasm.js | 26 + public/prism/prism-openqasm.min.js | 18 + public/prism/prism-oz.js | 31 + public/prism/prism-oz.min.js | 18 + public/prism/prism-parigp.js | 53 ++ public/prism/prism-parigp.min.js | 48 + public/prism/prism-parser.js | 78 ++ public/prism/prism-parser.min.js | 60 ++ public/prism/prism-pascal.js | 75 ++ public/prism/prism-pascal.min.js | 52 ++ public/prism/prism-pascaligo.js | 87 ++ public/prism/prism-pascaligo.min.js | 69 ++ public/prism/prism-pcaxis.js | 55 ++ public/prism/prism-pcaxis.min.js | 42 + public/prism/prism-peoplecode.js | 46 + public/prism/prism-peoplecode.min.js | 35 + public/prism/prism-perl.js | 162 ++++ public/prism/prism-perl.min.js | 76 ++ public/prism/prism-php-extras.js | 15 + public/prism/prism-php-extras.min.js | 9 + public/prism/prism-php.js | 356 ++++++++ public/prism/prism-php.min.js | 276 ++++++ public/prism/prism-phpdoc.js | 33 + public/prism/prism-phpdoc.min.js | 30 + public/prism/prism-plsql.js | 18 + public/prism/prism-plsql.min.js | 9 + public/prism/prism-powerquery.js | 58 ++ public/prism/prism-powerquery.min.js | 46 + public/prism/prism-powershell.js | 58 ++ public/prism/prism-powershell.min.js | 36 + public/prism/prism-processing.js | 16 + public/prism/prism-processing.min.js | 13 + public/prism/prism-prolog.js | 19 + public/prism/prism-prolog.min.js | 12 + public/prism/prism-promql.js | 102 +++ public/prism/prism-promql.min.js | 71 ++ public/prism/prism-properties.js | 10 + public/prism/prism-properties.min.js | 10 + public/prism/prism-protobuf.js | 44 + public/prism/prism-protobuf.min.js | 34 + public/prism/prism-psl.js | 39 + public/prism/prism-psl.min.js | 34 + public/prism/prism-pug.js | 201 +++++ public/prism/prism-pug.min.js | 158 ++++ public/prism/prism-puppet.js | 146 ++++ public/prism/prism-puppet.min.js | 98 +++ public/prism/prism-pure.js | 91 ++ public/prism/prism-pure.min.js | 59 ++ public/prism/prism-purebasic.js | 73 ++ public/prism/prism-purebasic.min.js | 57 ++ public/prism/prism-purescript.js | 34 + public/prism/prism-purescript.min.js | 18 + public/prism/prism-python.js | 72 ++ public/prism/prism-python.min.js | 57 ++ public/prism/prism-q.js | 54 ++ public/prism/prism-q.min.js | 30 + public/prism/prism-qml.js | 83 ++ public/prism/prism-qml.min.js | 71 ++ public/prism/prism-qore.js | 23 + public/prism/prism-qore.min.js | 19 + public/prism/prism-qsharp.js | 144 +++ public/prism/prism-qsharp.min.js | 80 ++ public/prism/prism-r.js | 23 + public/prism/prism-r.min.js | 15 + public/prism/prism-racket.js | 18 + public/prism/prism-racket.min.js | 10 + public/prism/prism-reason.js | 27 + public/prism/prism-reason.min.js | 17 + public/prism/prism-regex.js | 104 +++ public/prism/prism-regex.min.js | 55 ++ public/prism/prism-rego.js | 32 + public/prism/prism-rego.min.js | 24 + public/prism/prism-renpy.js | 34 + public/prism/prism-renpy.min.js | 21 + public/prism/prism-rest.js | 217 +++++ public/prism/prism-rest.min.js | 171 ++++ public/prism/prism-rip.js | 40 + public/prism/prism-rip.min.js | 22 + public/prism/prism-roboconf.js | 28 + public/prism/prism-roboconf.min.js | 18 + public/prism/prism-robotframework.js | 111 +++ public/prism/prism-robotframework.min.js | 81 ++ public/prism/prism-ruby.js | 204 +++++ public/prism/prism-ruby.min.js | 144 +++ public/prism/prism-rust.js | 133 +++ public/prism/prism-rust.min.js | 89 ++ public/prism/prism-sas.js | 379 ++++++++ public/prism/prism-sas.min.js | 303 +++++++ public/prism/prism-sass.js | 76 ++ public/prism/prism-sass.min.js | 53 ++ public/prism/prism-scala.js | 20 + public/prism/prism-scala.min.js | 17 + public/prism/prism-scheme.js | 132 +++ public/prism/prism-scheme.min.js | 77 ++ public/prism/prism-scss.js | 82 ++ public/prism/prism-scss.min.js | 45 + public/prism/prism-shell-session.js | 73 ++ public/prism/prism-shell-session.min.js | 44 + public/prism/prism-smali.js | 90 ++ public/prism/prism-smali.min.js | 53 ++ public/prism/prism-smalltalk.js | 38 + public/prism/prism-smalltalk.min.js | 23 + public/prism/prism-smarty.js | 140 +++ public/prism/prism-smarty.min.js | 94 ++ public/prism/prism-sml.js | 76 ++ public/prism/prism-sml.min.js | 47 + public/prism/prism-solidity.js | 25 + public/prism/prism-solidity.min.js | 22 + public/prism/prism-solution-file.js | 50 ++ public/prism/prism-solution-file.min.js | 33 + public/prism/prism-soy.js | 102 +++ public/prism/prism-soy.min.js | 63 ++ public/prism/prism-sparql.js | 17 + public/prism/prism-sparql.min.js | 12 + public/prism/prism-splunk-spl.js | 25 + public/prism/prism-splunk-spl.min.js | 20 + public/prism/prism-sqf.js | 37 + public/prism/prism-sqf.min.js | 29 + public/prism/prism-sql.js | 35 + public/prism/prism-sql.min.js | 30 + public/prism/prism-squirrel.js | 48 + public/prism/prism-squirrel.min.js | 32 + public/prism/prism-stan.js | 67 ++ public/prism/prism-stan.min.js | 48 + public/prism/prism-stylus.js | 145 ++++ public/prism/prism-stylus.min.js | 104 +++ public/prism/prism-swift.js | 154 ++++ public/prism/prism-swift.min.js | 96 ++ public/prism/prism-systemd.js | 77 ++ public/prism/prism-systemd.min.js | 35 + public/prism/prism-t4-cs.js | 2 + public/prism/prism-t4-cs.min.js | 2 + public/prism/prism-t4-templating.js | 49 ++ public/prism/prism-t4-templating.min.js | 36 + public/prism/prism-t4-vb.js | 1 + public/prism/prism-t4-vb.min.js | 1 + public/prism/prism-tap.js | 22 + public/prism/prism-tap.min.js | 17 + public/prism/prism-tcl.js | 49 ++ public/prism/prism-tcl.min.js | 34 + public/prism/prism-textile.js | 307 +++++++ public/prism/prism-textile.min.js | 192 ++++ public/prism/prism-toml.js | 59 ++ public/prism/prism-toml.min.js | 45 + public/prism/prism-tremor.js | 82 ++ public/prism/prism-tremor.min.js | 54 ++ public/prism/prism-tsx.js | 18 + public/prism/prism-tsx.min.js | 12 + public/prism/prism-tt2.js | 56 ++ public/prism/prism-tt2.min.js | 41 + public/prism/prism-turtle.js | 54 ++ public/prism/prism-turtle.min.js | 34 + public/prism/prism-twig.js | 45 + public/prism/prism-twig.min.js | 33 + public/prism/prism-typescript.js | 61 ++ public/prism/prism-typescript.min.js | 42 + public/prism/prism-typoscript.js | 80 ++ public/prism/prism-typoscript.min.js | 48 + public/prism/prism-unrealscript.js | 45 + public/prism/prism-unrealscript.min.js | 34 + public/prism/prism-uri.js | 96 ++ public/prism/prism-uri.min.js | 65 ++ public/prism/prism-v.js | 87 ++ public/prism/prism-v.min.js | 66 ++ public/prism/prism-vala.js | 89 ++ public/prism/prism-vala.min.js | 67 ++ public/prism/prism-vbnet.js | 23 + public/prism/prism-vbnet.min.js | 14 + public/prism/prism-velocity.js | 74 ++ public/prism/prism-velocity.min.js | 60 ++ public/prism/prism-verilog.js | 28 + public/prism/prism-verilog.min.js | 14 + public/prism/prism-vhdl.js | 25 + public/prism/prism-vhdl.min.js | 18 + public/prism/prism-vim.js | 13 + public/prism/prism-vim.min.js | 13 + public/prism/prism-visual-basic.js | 33 + public/prism/prism-visual-basic.min.js | 27 + public/prism/prism-warpscript.js | 25 + public/prism/prism-warpscript.min.js | 18 + public/prism/prism-wasm.js | 33 + public/prism/prism-wasm.min.js | 17 + public/prism/prism-web-idl.js | 120 +++ public/prism/prism-web-idl.min.js | 68 ++ public/prism/prism-wiki.js | 79 ++ public/prism/prism-wiki.min.js | 51 ++ public/prism/prism-wolfram.js | 32 + public/prism/prism-wolfram.min.js | 18 + public/prism/prism-wren.js | 104 +++ public/prism/prism-wren.min.js | 56 ++ public/prism/prism-xeora.js | 121 +++ public/prism/prism-xeora.min.js | 79 ++ public/prism/prism-xml-doc.js | 38 + public/prism/prism-xml-doc.min.js | 15 + public/prism/prism-xojo.js | 20 + public/prism/prism-xojo.min.js | 14 + public/prism/prism-xquery.js | 199 +++++ public/prism/prism-xquery.min.js | 123 +++ public/prism/prism-yaml.js | 121 +++ public/prism/prism-yaml.min.js | 90 ++ public/prism/prism-yang.js | 20 + public/prism/prism-yang.min.js | 9 + public/prism/prism-zig.js | 124 +++ public/prism/prism-zig.min.js | 87 ++ 552 files changed, 34883 insertions(+) create mode 100644 public/prism/prism-abap.js create mode 100644 public/prism/prism-abap.min.js create mode 100644 public/prism/prism-abnf.js create mode 100644 public/prism/prism-abnf.min.js create mode 100644 public/prism/prism-actionscript.js create mode 100644 public/prism/prism-actionscript.min.js create mode 100644 public/prism/prism-ada.js create mode 100644 public/prism/prism-ada.min.js create mode 100644 public/prism/prism-agda.js create mode 100644 public/prism/prism-agda.min.js create mode 100644 public/prism/prism-al.js create mode 100644 public/prism/prism-al.min.js create mode 100644 public/prism/prism-antlr4.js create mode 100644 public/prism/prism-antlr4.min.js create mode 100644 public/prism/prism-apacheconf.js create mode 100644 public/prism/prism-apacheconf.min.js create mode 100644 public/prism/prism-apex.js create mode 100644 public/prism/prism-apex.min.js create mode 100644 public/prism/prism-apl.js create mode 100644 public/prism/prism-apl.min.js create mode 100644 public/prism/prism-applescript.js create mode 100644 public/prism/prism-applescript.min.js create mode 100644 public/prism/prism-aql.js create mode 100644 public/prism/prism-aql.min.js create mode 100644 public/prism/prism-arduino.js create mode 100644 public/prism/prism-arduino.min.js create mode 100644 public/prism/prism-arff.js create mode 100644 public/prism/prism-arff.min.js create mode 100644 public/prism/prism-asciidoc.js create mode 100644 public/prism/prism-asciidoc.min.js create mode 100644 public/prism/prism-asm6502.js create mode 100644 public/prism/prism-asm6502.min.js create mode 100644 public/prism/prism-asmatmel.js create mode 100644 public/prism/prism-asmatmel.min.js create mode 100644 public/prism/prism-aspnet.js create mode 100644 public/prism/prism-aspnet.min.js create mode 100644 public/prism/prism-autohotkey.js create mode 100644 public/prism/prism-autohotkey.min.js create mode 100644 public/prism/prism-autoit.js create mode 100644 public/prism/prism-autoit.min.js create mode 100644 public/prism/prism-avisynth.js create mode 100644 public/prism/prism-avisynth.min.js create mode 100644 public/prism/prism-avro-idl.js create mode 100644 public/prism/prism-avro-idl.min.js create mode 100644 public/prism/prism-bash.js create mode 100644 public/prism/prism-bash.min.js create mode 100644 public/prism/prism-basic.js create mode 100644 public/prism/prism-basic.min.js create mode 100644 public/prism/prism-batch.js create mode 100644 public/prism/prism-batch.min.js create mode 100644 public/prism/prism-bbcode.js create mode 100644 public/prism/prism-bbcode.min.js create mode 100644 public/prism/prism-bicep.js create mode 100644 public/prism/prism-bicep.min.js create mode 100644 public/prism/prism-birb.js create mode 100644 public/prism/prism-birb.min.js create mode 100644 public/prism/prism-bison.js create mode 100644 public/prism/prism-bison.min.js create mode 100644 public/prism/prism-bnf.js create mode 100644 public/prism/prism-bnf.min.js create mode 100644 public/prism/prism-brainfuck.js create mode 100644 public/prism/prism-brainfuck.min.js create mode 100644 public/prism/prism-brightscript.js create mode 100644 public/prism/prism-brightscript.min.js create mode 100644 public/prism/prism-bro.js create mode 100644 public/prism/prism-bro.min.js create mode 100644 public/prism/prism-bsl.js create mode 100644 public/prism/prism-bsl.min.js create mode 100644 public/prism/prism-c.js create mode 100644 public/prism/prism-c.min.js create mode 100644 public/prism/prism-cfscript.js create mode 100644 public/prism/prism-cfscript.min.js create mode 100644 public/prism/prism-chaiscript.js create mode 100644 public/prism/prism-chaiscript.min.js create mode 100644 public/prism/prism-cil.js create mode 100644 public/prism/prism-cil.min.js create mode 100644 public/prism/prism-clike.js create mode 100644 public/prism/prism-clike.min.js create mode 100644 public/prism/prism-clojure.js create mode 100644 public/prism/prism-clojure.min.js create mode 100644 public/prism/prism-cmake.js create mode 100644 public/prism/prism-cmake.min.js create mode 100644 public/prism/prism-cobol.js create mode 100644 public/prism/prism-cobol.min.js create mode 100644 public/prism/prism-coffeescript.js create mode 100644 public/prism/prism-coffeescript.min.js create mode 100644 public/prism/prism-concurnas.js create mode 100644 public/prism/prism-concurnas.min.js create mode 100644 public/prism/prism-coq.js create mode 100644 public/prism/prism-coq.min.js create mode 100644 public/prism/prism-cpp.js create mode 100644 public/prism/prism-cpp.min.js create mode 100644 public/prism/prism-crystal.js create mode 100644 public/prism/prism-crystal.min.js create mode 100644 public/prism/prism-csharp.js create mode 100644 public/prism/prism-csharp.min.js create mode 100644 public/prism/prism-cshtml.js create mode 100644 public/prism/prism-cshtml.min.js create mode 100644 public/prism/prism-csp.js create mode 100644 public/prism/prism-csp.min.js create mode 100644 public/prism/prism-css-extras.js create mode 100644 public/prism/prism-css-extras.min.js create mode 100644 public/prism/prism-css.js create mode 100644 public/prism/prism-css.min.js create mode 100644 public/prism/prism-csv.js create mode 100644 public/prism/prism-csv.min.js create mode 100644 public/prism/prism-cypher.js create mode 100644 public/prism/prism-cypher.min.js create mode 100644 public/prism/prism-d.js create mode 100644 public/prism/prism-d.min.js create mode 100644 public/prism/prism-dart.js create mode 100644 public/prism/prism-dart.min.js create mode 100644 public/prism/prism-dataweave.js create mode 100644 public/prism/prism-dataweave.min.js create mode 100644 public/prism/prism-dax.js create mode 100644 public/prism/prism-dax.min.js create mode 100644 public/prism/prism-dhall.js create mode 100644 public/prism/prism-dhall.min.js create mode 100644 public/prism/prism-diff.js create mode 100644 public/prism/prism-diff.min.js create mode 100644 public/prism/prism-django.js create mode 100644 public/prism/prism-django.min.js create mode 100644 public/prism/prism-dns-zone-file.js create mode 100644 public/prism/prism-dns-zone-file.min.js create mode 100644 public/prism/prism-docker.js create mode 100644 public/prism/prism-docker.min.js create mode 100644 public/prism/prism-dot.js create mode 100644 public/prism/prism-dot.min.js create mode 100644 public/prism/prism-ebnf.js create mode 100644 public/prism/prism-ebnf.min.js create mode 100644 public/prism/prism-editorconfig.js create mode 100644 public/prism/prism-editorconfig.min.js create mode 100644 public/prism/prism-eiffel.js create mode 100644 public/prism/prism-eiffel.min.js create mode 100644 public/prism/prism-ejs.js create mode 100644 public/prism/prism-ejs.min.js create mode 100644 public/prism/prism-elixir.js create mode 100644 public/prism/prism-elixir.min.js create mode 100644 public/prism/prism-elm.js create mode 100644 public/prism/prism-elm.min.js create mode 100644 public/prism/prism-erb.js create mode 100644 public/prism/prism-erb.min.js create mode 100644 public/prism/prism-erlang.js create mode 100644 public/prism/prism-erlang.min.js create mode 100644 public/prism/prism-etlua.js create mode 100644 public/prism/prism-etlua.min.js create mode 100644 public/prism/prism-excel-formula.js create mode 100644 public/prism/prism-excel-formula.min.js create mode 100644 public/prism/prism-factor.js create mode 100644 public/prism/prism-factor.min.js create mode 100644 public/prism/prism-false.js create mode 100644 public/prism/prism-false.min.js create mode 100644 public/prism/prism-firestore-security-rules.js create mode 100644 public/prism/prism-firestore-security-rules.min.js create mode 100644 public/prism/prism-flow.js create mode 100644 public/prism/prism-flow.min.js create mode 100644 public/prism/prism-fortran.js create mode 100644 public/prism/prism-fortran.min.js create mode 100644 public/prism/prism-fsharp.js create mode 100644 public/prism/prism-fsharp.min.js create mode 100644 public/prism/prism-ftl.js create mode 100644 public/prism/prism-ftl.min.js create mode 100644 public/prism/prism-gap.js create mode 100644 public/prism/prism-gap.min.js create mode 100644 public/prism/prism-gcode.js create mode 100644 public/prism/prism-gcode.min.js create mode 100644 public/prism/prism-gdscript.js create mode 100644 public/prism/prism-gdscript.min.js create mode 100644 public/prism/prism-gedcom.js create mode 100644 public/prism/prism-gedcom.min.js create mode 100644 public/prism/prism-gherkin.js create mode 100644 public/prism/prism-gherkin.min.js create mode 100644 public/prism/prism-git.js create mode 100644 public/prism/prism-git.min.js create mode 100644 public/prism/prism-glsl.js create mode 100644 public/prism/prism-glsl.min.js create mode 100644 public/prism/prism-gml.js create mode 100644 public/prism/prism-gml.min.js create mode 100644 public/prism/prism-gn.js create mode 100644 public/prism/prism-gn.min.js create mode 100644 public/prism/prism-go-module.js create mode 100644 public/prism/prism-go-module.min.js create mode 100644 public/prism/prism-go.js create mode 100644 public/prism/prism-go.min.js create mode 100644 public/prism/prism-graphql.js create mode 100644 public/prism/prism-graphql.min.js create mode 100644 public/prism/prism-groovy.js create mode 100644 public/prism/prism-groovy.min.js create mode 100644 public/prism/prism-haml.js create mode 100644 public/prism/prism-haml.min.js create mode 100644 public/prism/prism-handlebars.js create mode 100644 public/prism/prism-handlebars.min.js create mode 100644 public/prism/prism-haskell.js create mode 100644 public/prism/prism-haskell.min.js create mode 100644 public/prism/prism-haxe.js create mode 100644 public/prism/prism-haxe.min.js create mode 100644 public/prism/prism-hcl.js create mode 100644 public/prism/prism-hcl.min.js create mode 100644 public/prism/prism-hlsl.js create mode 100644 public/prism/prism-hlsl.min.js create mode 100644 public/prism/prism-hoon.js create mode 100644 public/prism/prism-hoon.min.js create mode 100644 public/prism/prism-hpkp.js create mode 100644 public/prism/prism-hpkp.min.js create mode 100644 public/prism/prism-hsts.js create mode 100644 public/prism/prism-hsts.min.js create mode 100644 public/prism/prism-http.js create mode 100644 public/prism/prism-http.min.js create mode 100644 public/prism/prism-ichigojam.js create mode 100644 public/prism/prism-ichigojam.min.js create mode 100644 public/prism/prism-icon.js create mode 100644 public/prism/prism-icon.min.js create mode 100644 public/prism/prism-icu-message-format.js create mode 100644 public/prism/prism-icu-message-format.min.js create mode 100644 public/prism/prism-idris.js create mode 100644 public/prism/prism-idris.min.js create mode 100644 public/prism/prism-iecst.js create mode 100644 public/prism/prism-iecst.min.js create mode 100644 public/prism/prism-ignore.js create mode 100644 public/prism/prism-ignore.min.js create mode 100644 public/prism/prism-inform7.js create mode 100644 public/prism/prism-inform7.min.js create mode 100644 public/prism/prism-ini.js create mode 100644 public/prism/prism-ini.min.js create mode 100644 public/prism/prism-io.js create mode 100644 public/prism/prism-io.min.js create mode 100644 public/prism/prism-j.js create mode 100644 public/prism/prism-j.min.js create mode 100644 public/prism/prism-java.js create mode 100644 public/prism/prism-java.min.js create mode 100644 public/prism/prism-javadoc.js create mode 100644 public/prism/prism-javadoc.min.js create mode 100644 public/prism/prism-javadoclike.js create mode 100644 public/prism/prism-javadoclike.min.js create mode 100644 public/prism/prism-javascript.js create mode 100644 public/prism/prism-javascript.min.js create mode 100644 public/prism/prism-javastacktrace.js create mode 100644 public/prism/prism-javastacktrace.min.js create mode 100644 public/prism/prism-jexl.js create mode 100644 public/prism/prism-jexl.min.js create mode 100644 public/prism/prism-jolie.js create mode 100644 public/prism/prism-jolie.min.js create mode 100644 public/prism/prism-jq.js create mode 100644 public/prism/prism-jq.min.js create mode 100644 public/prism/prism-js-extras.js create mode 100644 public/prism/prism-js-extras.min.js create mode 100644 public/prism/prism-js-templates.js create mode 100644 public/prism/prism-js-templates.min.js create mode 100644 public/prism/prism-jsdoc.js create mode 100644 public/prism/prism-jsdoc.min.js create mode 100644 public/prism/prism-json.js create mode 100644 public/prism/prism-json.min.js create mode 100644 public/prism/prism-json5.js create mode 100644 public/prism/prism-json5.min.js create mode 100644 public/prism/prism-jsonp.js create mode 100644 public/prism/prism-jsonp.min.js create mode 100644 public/prism/prism-jsstacktrace.js create mode 100644 public/prism/prism-jsstacktrace.min.js create mode 100644 public/prism/prism-jsx.js create mode 100644 public/prism/prism-jsx.min.js create mode 100644 public/prism/prism-julia.js create mode 100644 public/prism/prism-julia.min.js create mode 100644 public/prism/prism-keepalived.js create mode 100644 public/prism/prism-keepalived.min.js create mode 100644 public/prism/prism-keyman.js create mode 100644 public/prism/prism-keyman.min.js create mode 100644 public/prism/prism-kotlin.js create mode 100644 public/prism/prism-kotlin.min.js create mode 100644 public/prism/prism-kumir.js create mode 100644 public/prism/prism-kumir.min.js create mode 100644 public/prism/prism-kusto.js create mode 100644 public/prism/prism-kusto.min.js create mode 100644 public/prism/prism-latex.js create mode 100644 public/prism/prism-latex.min.js create mode 100644 public/prism/prism-latte.js create mode 100644 public/prism/prism-latte.min.js create mode 100644 public/prism/prism-less.js create mode 100644 public/prism/prism-less.min.js create mode 100644 public/prism/prism-lilypond.js create mode 100644 public/prism/prism-lilypond.min.js create mode 100644 public/prism/prism-liquid.js create mode 100644 public/prism/prism-liquid.min.js create mode 100644 public/prism/prism-lisp.js create mode 100644 public/prism/prism-lisp.min.js create mode 100644 public/prism/prism-livescript.js create mode 100644 public/prism/prism-livescript.min.js create mode 100644 public/prism/prism-llvm.js create mode 100644 public/prism/prism-llvm.min.js create mode 100644 public/prism/prism-log.js create mode 100644 public/prism/prism-log.min.js create mode 100644 public/prism/prism-lolcode.js create mode 100644 public/prism/prism-lolcode.min.js create mode 100644 public/prism/prism-lua.js create mode 100644 public/prism/prism-lua.min.js create mode 100644 public/prism/prism-magma.js create mode 100644 public/prism/prism-magma.min.js create mode 100644 public/prism/prism-makefile.js create mode 100644 public/prism/prism-makefile.min.js create mode 100644 public/prism/prism-markdown.js create mode 100644 public/prism/prism-markdown.min.js create mode 100644 public/prism/prism-markup-templating.js create mode 100644 public/prism/prism-markup-templating.min.js create mode 100644 public/prism/prism-markup.js create mode 100644 public/prism/prism-markup.min.js create mode 100644 public/prism/prism-matlab.js create mode 100644 public/prism/prism-matlab.min.js create mode 100644 public/prism/prism-maxscript.js create mode 100644 public/prism/prism-maxscript.min.js create mode 100644 public/prism/prism-mel.js create mode 100644 public/prism/prism-mel.min.js create mode 100644 public/prism/prism-mermaid.js create mode 100644 public/prism/prism-mermaid.min.js create mode 100644 public/prism/prism-mizar.js create mode 100644 public/prism/prism-mizar.min.js create mode 100644 public/prism/prism-mongodb.js create mode 100644 public/prism/prism-mongodb.min.js create mode 100644 public/prism/prism-monkey.js create mode 100644 public/prism/prism-monkey.min.js create mode 100644 public/prism/prism-moonscript.js create mode 100644 public/prism/prism-moonscript.min.js create mode 100644 public/prism/prism-n1ql.js create mode 100644 public/prism/prism-n1ql.min.js create mode 100644 public/prism/prism-n4js.js create mode 100644 public/prism/prism-n4js.min.js create mode 100644 public/prism/prism-nand2tetris-hdl.js create mode 100644 public/prism/prism-nand2tetris-hdl.min.js create mode 100644 public/prism/prism-naniscript.js create mode 100644 public/prism/prism-naniscript.min.js create mode 100644 public/prism/prism-nasm.js create mode 100644 public/prism/prism-nasm.min.js create mode 100644 public/prism/prism-neon.js create mode 100644 public/prism/prism-neon.min.js create mode 100644 public/prism/prism-nevod.js create mode 100644 public/prism/prism-nevod.min.js create mode 100644 public/prism/prism-nginx.js create mode 100644 public/prism/prism-nginx.min.js create mode 100644 public/prism/prism-nim.js create mode 100644 public/prism/prism-nim.min.js create mode 100644 public/prism/prism-nix.js create mode 100644 public/prism/prism-nix.min.js create mode 100644 public/prism/prism-nsis.js create mode 100644 public/prism/prism-nsis.min.js create mode 100644 public/prism/prism-objectivec.js create mode 100644 public/prism/prism-objectivec.min.js create mode 100644 public/prism/prism-ocaml.js create mode 100644 public/prism/prism-ocaml.min.js create mode 100644 public/prism/prism-opencl.js create mode 100644 public/prism/prism-opencl.min.js create mode 100644 public/prism/prism-openqasm.js create mode 100644 public/prism/prism-openqasm.min.js create mode 100644 public/prism/prism-oz.js create mode 100644 public/prism/prism-oz.min.js create mode 100644 public/prism/prism-parigp.js create mode 100644 public/prism/prism-parigp.min.js create mode 100644 public/prism/prism-parser.js create mode 100644 public/prism/prism-parser.min.js create mode 100644 public/prism/prism-pascal.js create mode 100644 public/prism/prism-pascal.min.js create mode 100644 public/prism/prism-pascaligo.js create mode 100644 public/prism/prism-pascaligo.min.js create mode 100644 public/prism/prism-pcaxis.js create mode 100644 public/prism/prism-pcaxis.min.js create mode 100644 public/prism/prism-peoplecode.js create mode 100644 public/prism/prism-peoplecode.min.js create mode 100644 public/prism/prism-perl.js create mode 100644 public/prism/prism-perl.min.js create mode 100644 public/prism/prism-php-extras.js create mode 100644 public/prism/prism-php-extras.min.js create mode 100644 public/prism/prism-php.js create mode 100644 public/prism/prism-php.min.js create mode 100644 public/prism/prism-phpdoc.js create mode 100644 public/prism/prism-phpdoc.min.js create mode 100644 public/prism/prism-plsql.js create mode 100644 public/prism/prism-plsql.min.js create mode 100644 public/prism/prism-powerquery.js create mode 100644 public/prism/prism-powerquery.min.js create mode 100644 public/prism/prism-powershell.js create mode 100644 public/prism/prism-powershell.min.js create mode 100644 public/prism/prism-processing.js create mode 100644 public/prism/prism-processing.min.js create mode 100644 public/prism/prism-prolog.js create mode 100644 public/prism/prism-prolog.min.js create mode 100644 public/prism/prism-promql.js create mode 100644 public/prism/prism-promql.min.js create mode 100644 public/prism/prism-properties.js create mode 100644 public/prism/prism-properties.min.js create mode 100644 public/prism/prism-protobuf.js create mode 100644 public/prism/prism-protobuf.min.js create mode 100644 public/prism/prism-psl.js create mode 100644 public/prism/prism-psl.min.js create mode 100644 public/prism/prism-pug.js create mode 100644 public/prism/prism-pug.min.js create mode 100644 public/prism/prism-puppet.js create mode 100644 public/prism/prism-puppet.min.js create mode 100644 public/prism/prism-pure.js create mode 100644 public/prism/prism-pure.min.js create mode 100644 public/prism/prism-purebasic.js create mode 100644 public/prism/prism-purebasic.min.js create mode 100644 public/prism/prism-purescript.js create mode 100644 public/prism/prism-purescript.min.js create mode 100644 public/prism/prism-python.js create mode 100644 public/prism/prism-python.min.js create mode 100644 public/prism/prism-q.js create mode 100644 public/prism/prism-q.min.js create mode 100644 public/prism/prism-qml.js create mode 100644 public/prism/prism-qml.min.js create mode 100644 public/prism/prism-qore.js create mode 100644 public/prism/prism-qore.min.js create mode 100644 public/prism/prism-qsharp.js create mode 100644 public/prism/prism-qsharp.min.js create mode 100644 public/prism/prism-r.js create mode 100644 public/prism/prism-r.min.js create mode 100644 public/prism/prism-racket.js create mode 100644 public/prism/prism-racket.min.js create mode 100644 public/prism/prism-reason.js create mode 100644 public/prism/prism-reason.min.js create mode 100644 public/prism/prism-regex.js create mode 100644 public/prism/prism-regex.min.js create mode 100644 public/prism/prism-rego.js create mode 100644 public/prism/prism-rego.min.js create mode 100644 public/prism/prism-renpy.js create mode 100644 public/prism/prism-renpy.min.js create mode 100644 public/prism/prism-rest.js create mode 100644 public/prism/prism-rest.min.js create mode 100644 public/prism/prism-rip.js create mode 100644 public/prism/prism-rip.min.js create mode 100644 public/prism/prism-roboconf.js create mode 100644 public/prism/prism-roboconf.min.js create mode 100644 public/prism/prism-robotframework.js create mode 100644 public/prism/prism-robotframework.min.js create mode 100644 public/prism/prism-ruby.js create mode 100644 public/prism/prism-ruby.min.js create mode 100644 public/prism/prism-rust.js create mode 100644 public/prism/prism-rust.min.js create mode 100644 public/prism/prism-sas.js create mode 100644 public/prism/prism-sas.min.js create mode 100644 public/prism/prism-sass.js create mode 100644 public/prism/prism-sass.min.js create mode 100644 public/prism/prism-scala.js create mode 100644 public/prism/prism-scala.min.js create mode 100644 public/prism/prism-scheme.js create mode 100644 public/prism/prism-scheme.min.js create mode 100644 public/prism/prism-scss.js create mode 100644 public/prism/prism-scss.min.js create mode 100644 public/prism/prism-shell-session.js create mode 100644 public/prism/prism-shell-session.min.js create mode 100644 public/prism/prism-smali.js create mode 100644 public/prism/prism-smali.min.js create mode 100644 public/prism/prism-smalltalk.js create mode 100644 public/prism/prism-smalltalk.min.js create mode 100644 public/prism/prism-smarty.js create mode 100644 public/prism/prism-smarty.min.js create mode 100644 public/prism/prism-sml.js create mode 100644 public/prism/prism-sml.min.js create mode 100644 public/prism/prism-solidity.js create mode 100644 public/prism/prism-solidity.min.js create mode 100644 public/prism/prism-solution-file.js create mode 100644 public/prism/prism-solution-file.min.js create mode 100644 public/prism/prism-soy.js create mode 100644 public/prism/prism-soy.min.js create mode 100644 public/prism/prism-sparql.js create mode 100644 public/prism/prism-sparql.min.js create mode 100644 public/prism/prism-splunk-spl.js create mode 100644 public/prism/prism-splunk-spl.min.js create mode 100644 public/prism/prism-sqf.js create mode 100644 public/prism/prism-sqf.min.js create mode 100644 public/prism/prism-sql.js create mode 100644 public/prism/prism-sql.min.js create mode 100644 public/prism/prism-squirrel.js create mode 100644 public/prism/prism-squirrel.min.js create mode 100644 public/prism/prism-stan.js create mode 100644 public/prism/prism-stan.min.js create mode 100644 public/prism/prism-stylus.js create mode 100644 public/prism/prism-stylus.min.js create mode 100644 public/prism/prism-swift.js create mode 100644 public/prism/prism-swift.min.js create mode 100644 public/prism/prism-systemd.js create mode 100644 public/prism/prism-systemd.min.js create mode 100644 public/prism/prism-t4-cs.js create mode 100644 public/prism/prism-t4-cs.min.js create mode 100644 public/prism/prism-t4-templating.js create mode 100644 public/prism/prism-t4-templating.min.js create mode 100644 public/prism/prism-t4-vb.js create mode 100644 public/prism/prism-t4-vb.min.js create mode 100644 public/prism/prism-tap.js create mode 100644 public/prism/prism-tap.min.js create mode 100644 public/prism/prism-tcl.js create mode 100644 public/prism/prism-tcl.min.js create mode 100644 public/prism/prism-textile.js create mode 100644 public/prism/prism-textile.min.js create mode 100644 public/prism/prism-toml.js create mode 100644 public/prism/prism-toml.min.js create mode 100644 public/prism/prism-tremor.js create mode 100644 public/prism/prism-tremor.min.js create mode 100644 public/prism/prism-tsx.js create mode 100644 public/prism/prism-tsx.min.js create mode 100644 public/prism/prism-tt2.js create mode 100644 public/prism/prism-tt2.min.js create mode 100644 public/prism/prism-turtle.js create mode 100644 public/prism/prism-turtle.min.js create mode 100644 public/prism/prism-twig.js create mode 100644 public/prism/prism-twig.min.js create mode 100644 public/prism/prism-typescript.js create mode 100644 public/prism/prism-typescript.min.js create mode 100644 public/prism/prism-typoscript.js create mode 100644 public/prism/prism-typoscript.min.js create mode 100644 public/prism/prism-unrealscript.js create mode 100644 public/prism/prism-unrealscript.min.js create mode 100644 public/prism/prism-uri.js create mode 100644 public/prism/prism-uri.min.js create mode 100644 public/prism/prism-v.js create mode 100644 public/prism/prism-v.min.js create mode 100644 public/prism/prism-vala.js create mode 100644 public/prism/prism-vala.min.js create mode 100644 public/prism/prism-vbnet.js create mode 100644 public/prism/prism-vbnet.min.js create mode 100644 public/prism/prism-velocity.js create mode 100644 public/prism/prism-velocity.min.js create mode 100644 public/prism/prism-verilog.js create mode 100644 public/prism/prism-verilog.min.js create mode 100644 public/prism/prism-vhdl.js create mode 100644 public/prism/prism-vhdl.min.js create mode 100644 public/prism/prism-vim.js create mode 100644 public/prism/prism-vim.min.js create mode 100644 public/prism/prism-visual-basic.js create mode 100644 public/prism/prism-visual-basic.min.js create mode 100644 public/prism/prism-warpscript.js create mode 100644 public/prism/prism-warpscript.min.js create mode 100644 public/prism/prism-wasm.js create mode 100644 public/prism/prism-wasm.min.js create mode 100644 public/prism/prism-web-idl.js create mode 100644 public/prism/prism-web-idl.min.js create mode 100644 public/prism/prism-wiki.js create mode 100644 public/prism/prism-wiki.min.js create mode 100644 public/prism/prism-wolfram.js create mode 100644 public/prism/prism-wolfram.min.js create mode 100644 public/prism/prism-wren.js create mode 100644 public/prism/prism-wren.min.js create mode 100644 public/prism/prism-xeora.js create mode 100644 public/prism/prism-xeora.min.js create mode 100644 public/prism/prism-xml-doc.js create mode 100644 public/prism/prism-xml-doc.min.js create mode 100644 public/prism/prism-xojo.js create mode 100644 public/prism/prism-xojo.min.js create mode 100644 public/prism/prism-xquery.js create mode 100644 public/prism/prism-xquery.min.js create mode 100644 public/prism/prism-yaml.js create mode 100644 public/prism/prism-yaml.min.js create mode 100644 public/prism/prism-yang.js create mode 100644 public/prism/prism-yang.min.js create mode 100644 public/prism/prism-zig.js create mode 100644 public/prism/prism-zig.min.js (limited to 'public') diff --git a/public/prism/prism-abap.js b/public/prism/prism-abap.js new file mode 100644 index 0000000..60e9318 --- /dev/null +++ b/public/prism/prism-abap.js @@ -0,0 +1,52 @@ +Prism.languages.abap = { + comment: /^\*.*/m, + string: /(`|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + 'string-template': { + pattern: /([|}])(?:\\.|[^\\|{\r\n])*(?=[|{])/, + lookbehind: true, + alias: 'string', + }, + /* End Of Line comments should not interfere with strings when the + quote character occurs within them. We assume a string being highlighted + inside an EOL comment is more acceptable than the opposite. + */ + 'eol-comment': { + pattern: /(^|\s)".*/m, + lookbehind: true, + alias: 'comment', + }, + keyword: { + pattern: + /(\s|\.|^)(?:SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X)\b/i, + lookbehind: true, + }, + /* Numbers can be only integers. Decimal or Hex appear only as strings */ + number: /\b\d+\b/, + /* Operators must always be surrounded by whitespace, they cannot be put + adjacent to operands. + */ + operator: { + pattern: /(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/, + lookbehind: true, + }, + 'string-operator': { + pattern: /(\s)&&?(?=\s)/, + lookbehind: true, + /* The official editor highlights */ + alias: 'keyword', + }, + 'token-operator': [ + { + /* Special operators used to access structure components, class methods/attributes, etc. */ + pattern: /(\w)(?:->?|=>|[~|{}])(?=\w)/, + lookbehind: true, + alias: 'punctuation', + }, + { + /* Special tokens used do delimit string templates */ + pattern: /[|{}]/, + alias: 'punctuation', + }, + ], + punctuation: /[,.:()]/, +}; diff --git a/public/prism/prism-abap.min.js b/public/prism/prism-abap.min.js new file mode 100644 index 0000000..debfa41 --- /dev/null +++ b/public/prism/prism-abap.min.js @@ -0,0 +1,34 @@ +Prism.languages.abap = { + comment: /^\*.*/m, + string: /(`|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + 'string-template': { + pattern: /([|}])(?:\\.|[^\\|{\r\n])*(?=[|{])/, + lookbehind: !0, + alias: 'string', + }, + 'eol-comment': { pattern: /(^|\s)".*/m, lookbehind: !0, alias: 'comment' }, + keyword: { + pattern: + /(\s|\.|^)(?:SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X)\b/i, + lookbehind: !0, + }, + number: /\b\d+\b/, + operator: { + pattern: /(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/, + lookbehind: !0, + }, + 'string-operator': { + pattern: /(\s)&&?(?=\s)/, + lookbehind: !0, + alias: 'keyword', + }, + 'token-operator': [ + { + pattern: /(\w)(?:->?|=>|[~|{}])(?=\w)/, + lookbehind: !0, + alias: 'punctuation', + }, + { pattern: /[|{}]/, alias: 'punctuation' }, + ], + punctuation: /[,.:()]/, +}; diff --git a/public/prism/prism-abnf.js b/public/prism/prism-abnf.js new file mode 100644 index 0000000..39385f4 --- /dev/null +++ b/public/prism/prism-abnf.js @@ -0,0 +1,57 @@ +(function (Prism) { + var coreRules = + '(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)'; + + Prism.languages.abnf = { + comment: /;.*/, + string: { + pattern: /(?:%[is])?"[^"\n\r]*"/, + greedy: true, + inside: { + punctuation: /^%[is]/, + }, + }, + range: { + pattern: /%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i, + alias: 'number', + }, + terminal: { + pattern: + /%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i, + alias: 'number', + }, + repetition: { + pattern: /(^|[^\w-])(?:\d*\*\d*|\d+)/, + lookbehind: true, + alias: 'operator', + }, + definition: { + pattern: /(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m, + lookbehind: true, + alias: 'keyword', + inside: { + punctuation: /<|>/, + }, + }, + 'core-rule': { + pattern: RegExp( + '(?:(^|[^<\\w-])' + coreRules + '|<' + coreRules + '>)(?![\\w-])', + 'i' + ), + lookbehind: true, + alias: ['rule', 'constant'], + inside: { + punctuation: /<|>/, + }, + }, + rule: { + pattern: /(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i, + lookbehind: true, + inside: { + punctuation: /<|>/, + }, + }, + operator: /=\/?|\//, + punctuation: /[()\[\]]/, + }; +})(Prism); diff --git a/public/prism/prism-abnf.min.js b/public/prism/prism-abnf.min.js new file mode 100644 index 0000000..49316c0 --- /dev/null +++ b/public/prism/prism-abnf.min.js @@ -0,0 +1,45 @@ +!(function (n) { + var i = + '(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)'; + Prism.languages.abnf = { + comment: /;.*/, + string: { + pattern: /(?:%[is])?"[^"\n\r]*"/, + greedy: !0, + inside: { punctuation: /^%[is]/ }, + }, + range: { + pattern: /%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i, + alias: 'number', + }, + terminal: { + pattern: + /%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i, + alias: 'number', + }, + repetition: { + pattern: /(^|[^\w-])(?:\d*\*\d*|\d+)/, + lookbehind: !0, + alias: 'operator', + }, + definition: { + pattern: /(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m, + lookbehind: !0, + alias: 'keyword', + inside: { punctuation: /<|>/ }, + }, + 'core-rule': { + pattern: RegExp('(?:(^|[^<\\w-])' + i + '|<' + i + '>)(?![\\w-])', 'i'), + lookbehind: !0, + alias: ['rule', 'constant'], + inside: { punctuation: /<|>/ }, + }, + rule: { + pattern: /(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i, + lookbehind: !0, + inside: { punctuation: /<|>/ }, + }, + operator: /=\/?|\//, + punctuation: /[()\[\]]/, + }; +})(); diff --git a/public/prism/prism-actionscript.js b/public/prism/prism-actionscript.js new file mode 100644 index 0000000..fb4b6eb --- /dev/null +++ b/public/prism/prism-actionscript.js @@ -0,0 +1,21 @@ +Prism.languages.actionscript = Prism.languages.extend('javascript', { + keyword: + /\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/, + operator: /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/, +}); +Prism.languages.actionscript['class-name'].alias = 'function'; + +// doesn't work with AS because AS is too complex +delete Prism.languages.actionscript['parameter']; +delete Prism.languages.actionscript['literal-property']; + +if (Prism.languages.markup) { + Prism.languages.insertBefore('actionscript', 'string', { + xml: { + pattern: + /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/, + lookbehind: true, + inside: Prism.languages.markup, + }, + }); +} diff --git a/public/prism/prism-actionscript.min.js b/public/prism/prism-actionscript.min.js new file mode 100644 index 0000000..f57feb6 --- /dev/null +++ b/public/prism/prism-actionscript.min.js @@ -0,0 +1,17 @@ +(Prism.languages.actionscript = Prism.languages.extend('javascript', { + keyword: + /\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/, + operator: /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/, +})), + (Prism.languages.actionscript['class-name'].alias = 'function'), + delete Prism.languages.actionscript.parameter, + delete Prism.languages.actionscript['literal-property'], + Prism.languages.markup && + Prism.languages.insertBefore('actionscript', 'string', { + xml: { + pattern: + /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/, + lookbehind: !0, + inside: Prism.languages.markup, + }, + }); diff --git a/public/prism/prism-ada.js b/public/prism/prism-ada.js new file mode 100644 index 0000000..78ccd40 --- /dev/null +++ b/public/prism/prism-ada.js @@ -0,0 +1,21 @@ +Prism.languages.ada = { + comment: /--.*/, + string: /"(?:""|[^"\r\f\n])*"/, + number: [ + { + pattern: + /\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i, + }, + { + pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i, + }, + ], + 'attr-name': /\b'\w+/, + keyword: + /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, + boolean: /\b(?:false|true)\b/i, + operator: /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/, + punctuation: /\.\.?|[,;():]/, + char: /'.'/, + variable: /\b[a-z](?:\w)*\b/i, +}; diff --git a/public/prism/prism-ada.min.js b/public/prism/prism-ada.min.js new file mode 100644 index 0000000..89bd41f --- /dev/null +++ b/public/prism/prism-ada.min.js @@ -0,0 +1,19 @@ +Prism.languages.ada = { + comment: /--.*/, + string: /"(?:""|[^"\r\f\n])*"/, + number: [ + { + pattern: + /\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i, + }, + { pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i }, + ], + 'attr-name': /\b'\w+/, + keyword: + /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, + boolean: /\b(?:false|true)\b/i, + operator: /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/, + punctuation: /\.\.?|[,;():]/, + char: /'.'/, + variable: /\b[a-z](?:\w)*\b/i, +}; diff --git a/public/prism/prism-agda.js b/public/prism/prism-agda.js new file mode 100644 index 0000000..2d8d4a1 --- /dev/null +++ b/public/prism/prism-agda.js @@ -0,0 +1,24 @@ +(function (Prism) { + Prism.languages.agda = { + comment: /\{-[\s\S]*?(?:-\}|$)|--.*/, + string: { + pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, + greedy: true, + }, + punctuation: /[(){}⦃⦄.;@]/, + 'class-name': { + pattern: /((?:data|record) +)\S+/, + lookbehind: true, + }, + function: { + pattern: /(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m, + lookbehind: true, + }, + operator: { + pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/, + lookbehind: true, + }, + keyword: + /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/, + }; +})(Prism); diff --git a/public/prism/prism-agda.min.js b/public/prism/prism-agda.min.js new file mode 100644 index 0000000..6b5f87a --- /dev/null +++ b/public/prism/prism-agda.min.js @@ -0,0 +1,10 @@ +Prism.languages.agda = { + comment: /\{-[\s\S]*?(?:-\}|$)|--.*/, + string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, greedy: !0 }, + punctuation: /[(){}⦃⦄.;@]/, + 'class-name': { pattern: /((?:data|record) +)\S+/, lookbehind: !0 }, + function: { pattern: /(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m, lookbehind: !0 }, + operator: { pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/, lookbehind: !0 }, + keyword: + /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/, +}; diff --git a/public/prism/prism-al.js b/public/prism/prism-al.js new file mode 100644 index 0000000..cc9704e --- /dev/null +++ b/public/prism/prism-al.js @@ -0,0 +1,28 @@ +// based on https://github.com/microsoft/AL/blob/master/grammar/alsyntax.tmlanguage + +Prism.languages.al = { + comment: /\/\/.*|\/\*[\s\S]*?\*\//, + string: { + pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/, + greedy: true, + }, + function: { + pattern: + /(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i, + lookbehind: true, + }, + keyword: [ + // keywords + /\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i, + // objects and metadata that are used like keywords + /\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i, + ], + number: + /\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|LL?|U(?:LL?)?)?\b/i, + boolean: /\b(?:false|true)\b/i, + variable: /\b(?:Curr(?:FieldNo|Page|Report)|x?Rec|RequestOptionsPage)\b/, + 'class-name': + /\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i, + operator: /\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i, + punctuation: /[()\[\]{}:.;,]/, +}; diff --git a/public/prism/prism-al.min.js b/public/prism/prism-al.min.js new file mode 100644 index 0000000..e474efd --- /dev/null +++ b/public/prism/prism-al.min.js @@ -0,0 +1,24 @@ +Prism.languages.al = { + comment: /\/\/.*|\/\*[\s\S]*?\*\//, + string: { + pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/, + greedy: !0, + }, + function: { + pattern: + /(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i, + lookbehind: !0, + }, + keyword: [ + /\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i, + /\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i, + ], + number: + /\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|LL?|U(?:LL?)?)?\b/i, + boolean: /\b(?:false|true)\b/i, + variable: /\b(?:Curr(?:FieldNo|Page|Report)|x?Rec|RequestOptionsPage)\b/, + 'class-name': + /\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i, + operator: /\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i, + punctuation: /[()\[\]{}:.;,]/, +}; diff --git a/public/prism/prism-antlr4.js b/public/prism/prism-antlr4.js new file mode 100644 index 0000000..f7fcc78 --- /dev/null +++ b/public/prism/prism-antlr4.js @@ -0,0 +1,68 @@ +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*(?:,\s*)?\b[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; diff --git a/public/prism/prism-antlr4.min.js b/public/prism/prism-antlr4.min.js new file mode 100644 index 0000000..5f8ec47 --- /dev/null +++ b/public/prism/prism-antlr4.min.js @@ -0,0 +1,45 @@ +(Prism.languages.antlr4 = { + comment: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, + string: { pattern: /'(?:\\.|[^\\'\r\n])*'/, greedy: !0 }, + 'character-class': { + pattern: /\[(?:\\.|[^\\\]\r\n])*\]/, + greedy: !0, + alias: 'regex', + inside: { + range: { + pattern: /([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/, + lookbehind: !0, + alias: 'punctuation', + }, + escape: + /\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/, + punctuation: /[\[\]]/, + }, + }, + action: { + pattern: /\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/, + greedy: !0, + inside: { + content: { pattern: /(\{)[\s\S]+(?=\})/, lookbehind: !0 }, + punctuation: /[{}]/, + }, + }, + command: { + pattern: + /(->\s*(?!\s))(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i, + lookbehind: !0, + 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); diff --git a/public/prism/prism-apacheconf.js b/public/prism/prism-apacheconf.js new file mode 100644 index 0000000..174ae31 --- /dev/null +++ b/public/prism/prism-apacheconf.js @@ -0,0 +1,49 @@ +Prism.languages.apacheconf = { + comment: /#.*/, + 'directive-inline': { + pattern: + /(^[\t ]*)\b(?:AcceptFilter|AcceptPathInfo|AccessFileName|Action|Add(?:Alt|AltByEncoding|AltByType|Charset|DefaultCharset|Description|Encoding|Handler|Icon|IconByEncoding|IconByType|InputFilter|Language|ModuleInfo|OutputFilter|OutputFilterByType|Type)|Alias|AliasMatch|Allow(?:CONNECT|EncodedSlashes|Methods|Override|OverrideList)?|Anonymous(?:_LogEmail|_MustGiveEmail|_NoUserID|_VerifyEmail)?|AsyncRequestWorkerFactor|Auth(?:BasicAuthoritative|BasicFake|BasicProvider|BasicUseDigestAlgorithm|DBDUserPWQuery|DBDUserRealmQuery|DBMGroupFile|DBMType|DBMUserFile|Digest(?:Algorithm|Domain|NonceLifetime|Provider|Qop|ShmemSize)|Form(?:Authoritative|Body|DisableNoStore|FakeBasicAuth|Location|LoginRequiredLocation|LoginSuccessLocation|LogoutLocation|Method|Mimetype|Password|Provider|SitePassphrase|Size|Username)|GroupFile|LDAP(?:AuthorizePrefix|BindAuthoritative|BindDN|BindPassword|CharsetConfig|CompareAsUser|CompareDNOnServer|DereferenceAliases|GroupAttribute|GroupAttributeIsDN|InitialBindAsUser|InitialBindPattern|MaxSubGroupDepth|RemoteUserAttribute|RemoteUserIsDN|SearchAsUser|SubGroupAttribute|SubGroupClass|Url)|Merging|Name|nCache(?:Context|Enable|ProvideFor|SOCache|Timeout)|nzFcgiCheckAuthnProvider|nzFcgiDefineProvider|Type|UserFile|zDBDLoginToReferer|zDBDQuery|zDBDRedirectQuery|zDBMType|zSendForbiddenOnFailure)|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|Cache(?:DefaultExpire|DetailHeader|DirLength|DirLevels|Disable|Enable|File|Header|IgnoreCacheControl|IgnoreHeaders|IgnoreNoLastMod|IgnoreQueryString|IgnoreURLSessionIdentifiers|KeyBaseURL|LastModifiedFactor|Lock|LockMaxAge|LockPath|MaxExpire|MaxFileSize|MinExpire|MinFileSize|NegotiatedDocs|QuickHandler|ReadSize|ReadTime|Root|Socache(?:MaxSize|MaxTime|MinTime|ReadSize|ReadTime)?|StaleOnError|StoreExpired|StoreNoStore|StorePrivate)|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|Deflate(?:BufferSize|CompressionLevel|FilterNote|InflateLimitRequestBody|InflateRatio(?:Burst|Limit)|MemLevel|WindowSize)|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|Heartbeat(?:Address|Listen|MaxServers|Storage)|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|Index(?:HeadInsert|Ignore|IgnoreReset|Options|OrderDefault|StyleSheet)|InputSed|ISAPI(?:AppendLogToErrors|AppendLogToQuery|CacheFile|FakeAsync|LogNotSupported|ReadAheadBuffer)|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAP(?:CacheEntries|CacheTTL|ConnectionPoolTTL|ConnectionTimeout|LibraryDebug|OpCacheEntries|OpCacheTTL|ReferralHopLimit|Referrals|Retries|RetryDelay|SharedCacheFile|SharedCacheSize|Timeout|TrustedClientCert|TrustedGlobalCert|TrustedMode|VerifyServerCert)|Limit(?:InternalRecursion|Request(?:Body|Fields|FieldSize|Line)|XMLRequestBody)|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|Lua(?:Hook(?:AccessChecker|AuthChecker|CheckUserID|Fixups|InsertFilter|Log|MapToStorage|TranslateName|TypeChecker)|Inherit|InputFilter|MapHandler|OutputFilter|PackageCPath|PackagePath|QuickHandler|Root|Scope)|Max(?:ConnectionsPerChild|KeepAliveRequests|MemFree|RangeOverlaps|RangeReversals|Ranges|RequestWorkers|SpareServers|SpareThreads|Threads)|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|Proxy(?:AddHeaders|BadHeader|Block|Domain|ErrorOverride|ExpressDBMFile|ExpressDBMType|ExpressEnable|FtpDirCharset|FtpEscapeWildcards|FtpListOnWildcard|HTML(?:BufSize|CharsetOut|DocType|Enable|Events|Extended|Fixups|Interp|Links|Meta|StripComments|URLMap)|IOBufferSize|MaxForwards|Pass(?:Inherit|InterpolateEnv|Match|Reverse|ReverseCookieDomain|ReverseCookiePath)?|PreserveHost|ReceiveBufferSize|Remote|RemoteMatch|Requests|SCGIInternalRedirect|SCGISendfile|Set|SourceAddress|Status|Timeout|Via)|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIP(?:Header|InternalProxy|InternalProxyList|ProxiesHeader|TrustedProxy|TrustedProxyList)|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|Rewrite(?:Base|Cond|Engine|Map|Options|Rule)|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script(?:Alias|AliasMatch|InterpreterSource|Log|LogBuffer|LogLength|Sock)?|SecureListen|SeeRequestTail|SendBufferSize|Server(?:Admin|Alias|Limit|Name|Path|Root|Signature|Tokens)|Session(?:Cookie(?:Name|Name2|Remove)|Crypto(?:Cipher|Driver|Passphrase|PassphraseFile)|DBD(?:CookieName|CookieName2|CookieRemove|DeleteLabel|InsertLabel|PerUser|SelectLabel|UpdateLabel)|Env|Exclude|Header|Include|MaxAge)?|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSL(?:CACertificateFile|CACertificatePath|CADNRequestFile|CADNRequestPath|CARevocationCheck|CARevocationFile|CARevocationPath|CertificateChainFile|CertificateFile|CertificateKeyFile|CipherSuite|Compression|CryptoDevice|Engine|FIPS|HonorCipherOrder|InsecureRenegotiation|OCSP(?:DefaultResponder|Enable|OverrideResponder|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|UseRequestNonce)|OpenSSLConfCmd|Options|PassPhraseDialog|Protocol|Proxy(?:CACertificateFile|CACertificatePath|CARevocation(?:Check|File|Path)|CheckPeer(?:CN|Expire|Name)|CipherSuite|Engine|MachineCertificate(?:ChainFile|File|Path)|Protocol|Verify|VerifyDepth)|RandomSeed|RenegBufferSize|Require|RequireSSL|Session(?:Cache|CacheTimeout|TicketKeyFile|Tickets)|SRPUnknownUserSeed|SRPVerifierFile|Stapling(?:Cache|ErrorCacheTimeout|FakeTryLater|ForceURL|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|ReturnResponderErrors|StandardCacheTimeout)|StrictSNIVHostCheck|UserName|UseStapling|VerifyClient|VerifyDepth)|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|Virtual(?:DocumentRoot|ScriptAlias)(?:IP)?|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im, + lookbehind: true, + alias: 'property', + }, + 'directive-block': { + pattern: + /<\/?\b(?:Auth[nz]ProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|Require(?:All|Any|None)|VirtualHost)\b.*>/i, + inside: { + 'directive-block': { + pattern: /^<\/?\w+/, + inside: { + punctuation: /^<\/?/, + }, + alias: 'tag', + }, + 'directive-block-parameter': { + pattern: /.*[^>]/, + inside: { + punctuation: /:/, + string: { + pattern: /("|').*\1/, + inside: { + variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/, + }, + }, + }, + alias: 'attr-value', + }, + punctuation: />/, + }, + alias: 'tag', + }, + 'directive-flags': { + pattern: /\[(?:[\w=],?)+\]/, + alias: 'keyword', + }, + string: { + pattern: /("|').*\1/, + inside: { + variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/, + }, + }, + variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/, + regex: /\^?.*\$|\^.*\$?/, +}; diff --git a/public/prism/prism-apacheconf.min.js b/public/prism/prism-apacheconf.min.js new file mode 100644 index 0000000..bff9d9a --- /dev/null +++ b/public/prism/prism-apacheconf.min.js @@ -0,0 +1,40 @@ +Prism.languages.apacheconf = { + comment: /#.*/, + 'directive-inline': { + pattern: + /(^[\t ]*)\b(?:AcceptFilter|AcceptPathInfo|AccessFileName|Action|Add(?:Alt|AltByEncoding|AltByType|Charset|DefaultCharset|Description|Encoding|Handler|Icon|IconByEncoding|IconByType|InputFilter|Language|ModuleInfo|OutputFilter|OutputFilterByType|Type)|Alias|AliasMatch|Allow(?:CONNECT|EncodedSlashes|Methods|Override|OverrideList)?|Anonymous(?:_LogEmail|_MustGiveEmail|_NoUserID|_VerifyEmail)?|AsyncRequestWorkerFactor|Auth(?:BasicAuthoritative|BasicFake|BasicProvider|BasicUseDigestAlgorithm|DBDUserPWQuery|DBDUserRealmQuery|DBMGroupFile|DBMType|DBMUserFile|Digest(?:Algorithm|Domain|NonceLifetime|Provider|Qop|ShmemSize)|Form(?:Authoritative|Body|DisableNoStore|FakeBasicAuth|Location|LoginRequiredLocation|LoginSuccessLocation|LogoutLocation|Method|Mimetype|Password|Provider|SitePassphrase|Size|Username)|GroupFile|LDAP(?:AuthorizePrefix|BindAuthoritative|BindDN|BindPassword|CharsetConfig|CompareAsUser|CompareDNOnServer|DereferenceAliases|GroupAttribute|GroupAttributeIsDN|InitialBindAsUser|InitialBindPattern|MaxSubGroupDepth|RemoteUserAttribute|RemoteUserIsDN|SearchAsUser|SubGroupAttribute|SubGroupClass|Url)|Merging|Name|nCache(?:Context|Enable|ProvideFor|SOCache|Timeout)|nzFcgiCheckAuthnProvider|nzFcgiDefineProvider|Type|UserFile|zDBDLoginToReferer|zDBDQuery|zDBDRedirectQuery|zDBMType|zSendForbiddenOnFailure)|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|Cache(?:DefaultExpire|DetailHeader|DirLength|DirLevels|Disable|Enable|File|Header|IgnoreCacheControl|IgnoreHeaders|IgnoreNoLastMod|IgnoreQueryString|IgnoreURLSessionIdentifiers|KeyBaseURL|LastModifiedFactor|Lock|LockMaxAge|LockPath|MaxExpire|MaxFileSize|MinExpire|MinFileSize|NegotiatedDocs|QuickHandler|ReadSize|ReadTime|Root|Socache(?:MaxSize|MaxTime|MinTime|ReadSize|ReadTime)?|StaleOnError|StoreExpired|StoreNoStore|StorePrivate)|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|Deflate(?:BufferSize|CompressionLevel|FilterNote|InflateLimitRequestBody|InflateRatio(?:Burst|Limit)|MemLevel|WindowSize)|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|Heartbeat(?:Address|Listen|MaxServers|Storage)|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|Index(?:HeadInsert|Ignore|IgnoreReset|Options|OrderDefault|StyleSheet)|InputSed|ISAPI(?:AppendLogToErrors|AppendLogToQuery|CacheFile|FakeAsync|LogNotSupported|ReadAheadBuffer)|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAP(?:CacheEntries|CacheTTL|ConnectionPoolTTL|ConnectionTimeout|LibraryDebug|OpCacheEntries|OpCacheTTL|ReferralHopLimit|Referrals|Retries|RetryDelay|SharedCacheFile|SharedCacheSize|Timeout|TrustedClientCert|TrustedGlobalCert|TrustedMode|VerifyServerCert)|Limit(?:InternalRecursion|Request(?:Body|Fields|FieldSize|Line)|XMLRequestBody)|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|Lua(?:Hook(?:AccessChecker|AuthChecker|CheckUserID|Fixups|InsertFilter|Log|MapToStorage|TranslateName|TypeChecker)|Inherit|InputFilter|MapHandler|OutputFilter|PackageCPath|PackagePath|QuickHandler|Root|Scope)|Max(?:ConnectionsPerChild|KeepAliveRequests|MemFree|RangeOverlaps|RangeReversals|Ranges|RequestWorkers|SpareServers|SpareThreads|Threads)|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|Proxy(?:AddHeaders|BadHeader|Block|Domain|ErrorOverride|ExpressDBMFile|ExpressDBMType|ExpressEnable|FtpDirCharset|FtpEscapeWildcards|FtpListOnWildcard|HTML(?:BufSize|CharsetOut|DocType|Enable|Events|Extended|Fixups|Interp|Links|Meta|StripComments|URLMap)|IOBufferSize|MaxForwards|Pass(?:Inherit|InterpolateEnv|Match|Reverse|ReverseCookieDomain|ReverseCookiePath)?|PreserveHost|ReceiveBufferSize|Remote|RemoteMatch|Requests|SCGIInternalRedirect|SCGISendfile|Set|SourceAddress|Status|Timeout|Via)|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIP(?:Header|InternalProxy|InternalProxyList|ProxiesHeader|TrustedProxy|TrustedProxyList)|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|Rewrite(?:Base|Cond|Engine|Map|Options|Rule)|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script(?:Alias|AliasMatch|InterpreterSource|Log|LogBuffer|LogLength|Sock)?|SecureListen|SeeRequestTail|SendBufferSize|Server(?:Admin|Alias|Limit|Name|Path|Root|Signature|Tokens)|Session(?:Cookie(?:Name|Name2|Remove)|Crypto(?:Cipher|Driver|Passphrase|PassphraseFile)|DBD(?:CookieName|CookieName2|CookieRemove|DeleteLabel|InsertLabel|PerUser|SelectLabel|UpdateLabel)|Env|Exclude|Header|Include|MaxAge)?|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSL(?:CACertificateFile|CACertificatePath|CADNRequestFile|CADNRequestPath|CARevocationCheck|CARevocationFile|CARevocationPath|CertificateChainFile|CertificateFile|CertificateKeyFile|CipherSuite|Compression|CryptoDevice|Engine|FIPS|HonorCipherOrder|InsecureRenegotiation|OCSP(?:DefaultResponder|Enable|OverrideResponder|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|UseRequestNonce)|OpenSSLConfCmd|Options|PassPhraseDialog|Protocol|Proxy(?:CACertificateFile|CACertificatePath|CARevocation(?:Check|File|Path)|CheckPeer(?:CN|Expire|Name)|CipherSuite|Engine|MachineCertificate(?:ChainFile|File|Path)|Protocol|Verify|VerifyDepth)|RandomSeed|RenegBufferSize|Require|RequireSSL|Session(?:Cache|CacheTimeout|TicketKeyFile|Tickets)|SRPUnknownUserSeed|SRPVerifierFile|Stapling(?:Cache|ErrorCacheTimeout|FakeTryLater|ForceURL|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|ReturnResponderErrors|StandardCacheTimeout)|StrictSNIVHostCheck|UserName|UseStapling|VerifyClient|VerifyDepth)|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|Virtual(?:DocumentRoot|ScriptAlias)(?:IP)?|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im, + lookbehind: !0, + alias: 'property', + }, + 'directive-block': { + pattern: + /<\/?\b(?:Auth[nz]ProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|Require(?:All|Any|None)|VirtualHost)\b.*>/i, + inside: { + 'directive-block': { + pattern: /^<\/?\w+/, + inside: { punctuation: /^<\/?/ }, + alias: 'tag', + }, + 'directive-block-parameter': { + pattern: /.*[^>]/, + inside: { + punctuation: /:/, + string: { + pattern: /("|').*\1/, + inside: { variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/ }, + }, + }, + alias: 'attr-value', + }, + punctuation: />/, + }, + alias: 'tag', + }, + 'directive-flags': { pattern: /\[(?:[\w=],?)+\]/, alias: 'keyword' }, + string: { + pattern: /("|').*\1/, + inside: { variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/ }, + }, + variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/, + regex: /\^?.*\$|\^.*\$?/, +}; diff --git a/public/prism/prism-apex.js b/public/prism/prism-apex.js new file mode 100644 index 0000000..670331f --- /dev/null +++ b/public/prism/prism-apex.js @@ -0,0 +1,77 @@ +(function (Prism) { + var keywords = + /\b(?:(?:after|before)(?=\s+[a-z])|abstract|activate|and|any|array|as|asc|autonomous|begin|bigdecimal|blob|boolean|break|bulk|by|byte|case|cast|catch|char|class|collect|commit|const|continue|currency|date|datetime|decimal|default|delete|desc|do|double|else|end|enum|exception|exit|export|extends|final|finally|float|for|from|get(?=\s*[{};])|global|goto|group|having|hint|if|implements|import|in|inner|insert|instanceof|int|integer|interface|into|join|like|limit|list|long|loop|map|merge|new|not|null|nulls|number|object|of|on|or|outer|override|package|parallel|pragma|private|protected|public|retrieve|return|rollback|select|set|short|sObject|sort|static|string|super|switch|synchronized|system|testmethod|then|this|throw|time|transaction|transient|trigger|try|undelete|update|upsert|using|virtual|void|webservice|when|where|while|(?:inherited|with|without)\s+sharing)\b/i; + + var className = + /\b(?:(?=[a-z_]\w*\s*[<\[])|(?!))[A-Z_]\w*(?:\s*\.\s*[A-Z_]\w*)*\b(?:\s*(?:\[\s*\]|<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>))*/.source.replace( + //g, + function () { + return keywords.source; + } + ); + /** @param {string} pattern */ + function insertClassName(pattern) { + return RegExp( + pattern.replace(//g, function () { + return className; + }), + 'i' + ); + } + + var classNameInside = { + keyword: keywords, + punctuation: /[()\[\]{};,:.<>]/, + }; + + Prism.languages.apex = { + comment: Prism.languages.clike.comment, + string: Prism.languages.clike.string, + sql: { + pattern: /((?:[=,({:]|\breturn)\s*)\[[^\[\]]*\]/i, + lookbehind: true, + greedy: true, + alias: 'language-sql', + inside: Prism.languages.sql, + }, + + annotation: { + pattern: /@\w+\b/, + alias: 'punctuation', + }, + 'class-name': [ + { + pattern: insertClassName( + /(\b(?:class|enum|extends|implements|instanceof|interface|new|trigger\s+\w+\s+on)\s+)/ + .source + ), + lookbehind: true, + inside: classNameInside, + }, + { + // cast + pattern: insertClassName(/(\(\s*)(?=\s*\)\s*[\w(])/.source), + lookbehind: true, + inside: classNameInside, + }, + { + // variable/parameter declaration and return types + pattern: insertClassName(/(?=\s*\w+\s*[;=,(){:])/.source), + inside: classNameInside, + }, + ], + trigger: { + pattern: /(\btrigger\s+)\w+\b/i, + lookbehind: true, + alias: 'class-name', + }, + keyword: keywords, + function: /\b[a-z_]\w*(?=\s*\()/i, + + boolean: /\b(?:false|true)\b/i, + + number: /(?:\B\.\d+|\b\d+(?:\.\d+|L)?)\b/i, + operator: /[!=](?:==?)?|\?\.?|&&|\|\||--|\+\+|[-+*/^&|]=?|:|<{1,3}=?/, + punctuation: /[()\[\]{};,.]/, + }; +})(Prism); diff --git a/public/prism/prism-apex.min.js b/public/prism/prism-apex.min.js new file mode 100644 index 0000000..3d9d7be --- /dev/null +++ b/public/prism/prism-apex.min.js @@ -0,0 +1,58 @@ +!(function (e) { + var t = + /\b(?:(?:after|before)(?=\s+[a-z])|abstract|activate|and|any|array|as|asc|autonomous|begin|bigdecimal|blob|boolean|break|bulk|by|byte|case|cast|catch|char|class|collect|commit|const|continue|currency|date|datetime|decimal|default|delete|desc|do|double|else|end|enum|exception|exit|export|extends|final|finally|float|for|from|get(?=\s*[{};])|global|goto|group|having|hint|if|implements|import|in|inner|insert|instanceof|int|integer|interface|into|join|like|limit|list|long|loop|map|merge|new|not|null|nulls|number|object|of|on|or|outer|override|package|parallel|pragma|private|protected|public|retrieve|return|rollback|select|set|short|sObject|sort|static|string|super|switch|synchronized|system|testmethod|then|this|throw|time|transaction|transient|trigger|try|undelete|update|upsert|using|virtual|void|webservice|when|where|while|(?:inherited|with|without)\s+sharing)\b/i, + n = + '\\b(?:(?=[a-z_]\\w*\\s*[<\\[])|(?!))[A-Z_]\\w*(?:\\s*\\.\\s*[A-Z_]\\w*)*\\b(?:\\s*(?:\\[\\s*\\]|<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>))*'.replace( + //g, + function () { + return t.source; + } + ); + function i(e) { + return RegExp( + e.replace(//g, function () { + return n; + }), + 'i' + ); + } + var a = { keyword: t, punctuation: /[()\[\]{};,:.<>]/ }; + e.languages.apex = { + comment: e.languages.clike.comment, + string: e.languages.clike.string, + sql: { + pattern: /((?:[=,({:]|\breturn)\s*)\[[^\[\]]*\]/i, + lookbehind: !0, + greedy: !0, + alias: 'language-sql', + inside: e.languages.sql, + }, + annotation: { pattern: /@\w+\b/, alias: 'punctuation' }, + 'class-name': [ + { + pattern: i( + '(\\b(?:class|enum|extends|implements|instanceof|interface|new|trigger\\s+\\w+\\s+on)\\s+)' + ), + lookbehind: !0, + inside: a, + }, + { + pattern: i('(\\(\\s*)(?=\\s*\\)\\s*[\\w(])'), + lookbehind: !0, + inside: a, + }, + { pattern: i('(?=\\s*\\w+\\s*[;=,(){:])'), inside: a }, + ], + trigger: { + pattern: /(\btrigger\s+)\w+\b/i, + lookbehind: !0, + alias: 'class-name', + }, + keyword: t, + function: /\b[a-z_]\w*(?=\s*\()/i, + boolean: /\b(?:false|true)\b/i, + number: /(?:\B\.\d+|\b\d+(?:\.\d+|L)?)\b/i, + operator: /[!=](?:==?)?|\?\.?|&&|\|\||--|\+\+|[-+*/^&|]=?|:|<{1,3}=?/, + punctuation: /[()\[\]{};,.]/, + }; +})(Prism); diff --git a/public/prism/prism-apl.js b/public/prism/prism-apl.js new file mode 100644 index 0000000..8e63023 --- /dev/null +++ b/public/prism/prism-apl.js @@ -0,0 +1,33 @@ +Prism.languages.apl = { + comment: /(?:⍝|#[! ]).*$/m, + string: { + pattern: /'(?:[^'\r\n]|'')*'/, + greedy: true, + }, + number: + /¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i, + statement: /:[A-Z][a-z][A-Za-z]*\b/, + 'system-function': { + pattern: /⎕[A-Z]+/i, + alias: 'function', + }, + constant: /[⍬⌾#⎕⍞]/, + function: /[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/, + 'monadic-operator': { + pattern: /[\\\/⌿⍀¨⍨⌶&∥]/, + alias: 'operator', + }, + 'dyadic-operator': { + pattern: /[.⍣⍠⍤∘⌸@⌺⍥]/, + alias: 'operator', + }, + assignment: { + pattern: /←/, + alias: 'keyword', + }, + punctuation: /[\[;\]()◇⋄]/, + dfn: { + pattern: /[{}⍺⍵⍶⍹∇⍫:]/, + alias: 'builtin', + }, +}; diff --git a/public/prism/prism-apl.min.js b/public/prism/prism-apl.min.js new file mode 100644 index 0000000..bc060f8 --- /dev/null +++ b/public/prism/prism-apl.min.js @@ -0,0 +1,15 @@ +Prism.languages.apl = { + comment: /(?:⍝|#[! ]).*$/m, + string: { pattern: /'(?:[^'\r\n]|'')*'/, greedy: !0 }, + number: + /¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i, + statement: /:[A-Z][a-z][A-Za-z]*\b/, + 'system-function': { pattern: /⎕[A-Z]+/i, alias: 'function' }, + constant: /[⍬⌾#⎕⍞]/, + function: /[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/, + 'monadic-operator': { pattern: /[\\\/⌿⍀¨⍨⌶&∥]/, alias: 'operator' }, + 'dyadic-operator': { pattern: /[.⍣⍠⍤∘⌸@⌺⍥]/, alias: 'operator' }, + assignment: { pattern: /←/, alias: 'keyword' }, + punctuation: /[\[;\]()◇⋄]/, + dfn: { pattern: /[{}⍺⍵⍶⍹∇⍫:]/, alias: 'builtin' }, +}; diff --git a/public/prism/prism-applescript.js b/public/prism/prism-applescript.js new file mode 100644 index 0000000..8ecf3a0 --- /dev/null +++ b/public/prism/prism-applescript.js @@ -0,0 +1,19 @@ +Prism.languages.applescript = { + comment: [ + // Allow one level of nesting + /\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/, + /--.+/, + /#.+/, + ], + string: /"(?:\\.|[^"\\\r\n])*"/, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?\b/i, + operator: [ + /[&=≠≤≥*+\-\/÷^]|[<>]=?/, + /\b(?:(?:begin|end|start)s? with|(?:contains?|(?:does not|doesn't) contain)|(?:is|isn't|is not) (?:contained by|in)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:comes|(?:does not|doesn't) come) (?:after|before)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equal to|equals|is not|isn't)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|as|div|mod|not|or))\b/, + ], + keyword: + /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/, + 'class-name': + /\b(?:POSIX file|RGB color|alias|application|boolean|centimeters|centimetres|class|constant|cubic centimeters|cubic centimetres|cubic feet|cubic inches|cubic meters|cubic metres|cubic yards|date|degrees Celsius|degrees Fahrenheit|degrees Kelvin|feet|file|gallons|grams|inches|integer|kilograms|kilometers|kilometres|list|liters|litres|meters|metres|miles|number|ounces|pounds|quarts|real|record|reference|script|square feet|square kilometers|square kilometres|square meters|square metres|square miles|square yards|text|yards)\b/, + punctuation: /[{}():,¬«»《》]/, +}; diff --git a/public/prism/prism-applescript.min.js b/public/prism/prism-applescript.min.js new file mode 100644 index 0000000..2e90f4f --- /dev/null +++ b/public/prism/prism-applescript.min.js @@ -0,0 +1,18 @@ +Prism.languages.applescript = { + comment: [ + /\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/, + /--.+/, + /#.+/, + ], + string: /"(?:\\.|[^"\\\r\n])*"/, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?\b/i, + operator: [ + /[&=≠≤≥*+\-\/÷^]|[<>]=?/, + /\b(?:(?:begin|end|start)s? with|(?:contains?|(?:does not|doesn't) contain)|(?:is|isn't|is not) (?:contained by|in)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:comes|(?:does not|doesn't) come) (?:after|before)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equal to|equals|is not|isn't)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|as|div|mod|not|or))\b/, + ], + keyword: + /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/, + 'class-name': + /\b(?:POSIX file|RGB color|alias|application|boolean|centimeters|centimetres|class|constant|cubic centimeters|cubic centimetres|cubic feet|cubic inches|cubic meters|cubic metres|cubic yards|date|degrees Celsius|degrees Fahrenheit|degrees Kelvin|feet|file|gallons|grams|inches|integer|kilograms|kilometers|kilometres|list|liters|litres|meters|metres|miles|number|ounces|pounds|quarts|real|record|reference|script|square feet|square kilometers|square kilometres|square meters|square metres|square miles|square yards|text|yards)\b/, + punctuation: /[{}():,¬«»《》]/, +}; diff --git a/public/prism/prism-aql.js b/public/prism/prism-aql.js new file mode 100644 index 0000000..7634007 --- /dev/null +++ b/public/prism/prism-aql.js @@ -0,0 +1,50 @@ +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, + }, + identifier: { + 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_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|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: /\b(?!\d)\w+(?=\s*\()/, + boolean: /\b(?:false|true)\b/i, + range: { + pattern: /\.\./, + alias: 'operator', + }, + number: [ + /\b0b[01]+/i, + /\b0x[0-9a-f]+/i, + /(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i, + ], + operator: /\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/, + punctuation: /::|[?.:,;()[\]{}]/, +}; diff --git a/public/prism/prism-aql.min.js b/public/prism/prism-aql.min.js new file mode 100644 index 0000000..397b76e --- /dev/null +++ b/public/prism/prism-aql.min.js @@ -0,0 +1,29 @@ +Prism.languages.aql = { + comment: /\/\/.*|\/\*[\s\S]*?\*\//, + property: { + pattern: + /([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/, + lookbehind: !0, + greedy: !0, + }, + string: { pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\.)*\1/, greedy: !0 }, + identifier: { pattern: /([´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/, greedy: !0 }, + variable: /@@?\w+/, + keyword: [ + { pattern: /(\bWITH\s+)COUNT(?=\s+INTO\b)/i, lookbehind: !0 }, + /\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|WITH)\b/i, + { pattern: /(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i, lookbehind: !0 }, + { pattern: /(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/, lookbehind: !0 }, + { pattern: /\bOPTIONS(?=\s*\{)/i }, + ], + function: /\b(?!\d)\w+(?=\s*\()/, + boolean: /\b(?:false|true)\b/i, + range: { pattern: /\.\./, alias: 'operator' }, + number: [ + /\b0b[01]+/i, + /\b0x[0-9a-f]+/i, + /(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i, + ], + operator: /\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/, + punctuation: /::|[?.:,;()[\]{}]/, +}; diff --git a/public/prism/prism-arduino.js b/public/prism/prism-arduino.js new file mode 100644 index 0000000..a33a7cf --- /dev/null +++ b/public/prism/prism-arduino.js @@ -0,0 +1,10 @@ +Prism.languages.arduino = Prism.languages.extend('cpp', { + keyword: + /\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/, + constant: + /\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/, + builtin: + /\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/, +}); + +Prism.languages.ino = Prism.languages.arduino; diff --git a/public/prism/prism-arduino.min.js b/public/prism/prism-arduino.min.js new file mode 100644 index 0000000..2792e58 --- /dev/null +++ b/public/prism/prism-arduino.min.js @@ -0,0 +1,9 @@ +(Prism.languages.arduino = Prism.languages.extend('cpp', { + keyword: + /\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/, + constant: + /\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/, + builtin: + /\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/, +})), + (Prism.languages.ino = Prism.languages.arduino); diff --git a/public/prism/prism-arff.js b/public/prism/prism-arff.js new file mode 100644 index 0000000..7267af2 --- /dev/null +++ b/public/prism/prism-arff.js @@ -0,0 +1,10 @@ +Prism.languages.arff = { + comment: /%.*/, + string: { + pattern: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + keyword: /@(?:attribute|data|end|relation)\b/i, + number: /\b\d+(?:\.\d+)?\b/, + punctuation: /[{},]/, +}; diff --git a/public/prism/prism-arff.min.js b/public/prism/prism-arff.min.js new file mode 100644 index 0000000..e275d3b --- /dev/null +++ b/public/prism/prism-arff.min.js @@ -0,0 +1,7 @@ +Prism.languages.arff = { + comment: /%.*/, + string: { pattern: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, + keyword: /@(?:attribute|data|end|relation)\b/i, + number: /\b\d+(?:\.\d+)?\b/, + punctuation: /[{},]/, +}; diff --git a/public/prism/prism-asciidoc.js b/public/prism/prism-asciidoc.js new file mode 100644 index 0000000..a2092d9 --- /dev/null +++ b/public/prism/prism-asciidoc.js @@ -0,0 +1,246 @@ +(function (Prism) { + var attributes = { + pattern: + /(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m, + lookbehind: true, + inside: { + quoted: { + pattern: /([$`])(?:(?!\1)[^\\]|\\.)*\1/, + inside: { + punctuation: /^[$`]|[$`]$/, + }, + }, + interpreted: { + pattern: /'(?:[^'\\]|\\.)*'/, + inside: { + punctuation: /^'|'$/, + // See rest below + }, + }, + string: /"(?:[^"\\]|\\.)*"/, + variable: /\w+(?==)/, + punctuation: /^\[|\]$|,/, + operator: /=/, + // The negative look-ahead prevents blank matches + 'attr-value': /(?!^\s+$).+/, + }, + }; + + var asciidoc = (Prism.languages.asciidoc = { + 'comment-block': { + pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m, + alias: 'comment', + }, + table: { + pattern: /^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m, + inside: { + specifiers: { + pattern: + /(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*](?:[<^>](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/, + alias: 'attr-value', + }, + punctuation: { + pattern: /(^|[^\\])[|!]=*/, + lookbehind: true, + }, + // See rest below + }, + }, + + 'passthrough-block': { + pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + inside: { + punctuation: /^\++|\++$/, + // See rest below + }, + }, + // Literal blocks and listing blocks + 'literal-block': { + pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + inside: { + punctuation: /^(?:-+|\.+)|(?:-+|\.+)$/, + // See rest below + }, + }, + // Sidebar blocks, quote blocks, example blocks and open blocks + 'other-block': { + pattern: + /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + inside: { + punctuation: /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/, + // See rest below + }, + }, + + // list-punctuation and list-label must appear before indented-block + 'list-punctuation': { + pattern: /(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im, + lookbehind: true, + alias: 'punctuation', + }, + 'list-label': { + pattern: /(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im, + lookbehind: true, + alias: 'symbol', + }, + 'indented-block': { + pattern: /((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/, + lookbehind: true, + }, + + comment: /^\/\/.*/m, + title: { + pattern: + /^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m, + alias: 'important', + inside: { + punctuation: /^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/, + // See rest below + }, + }, + 'attribute-entry': { + pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m, + alias: 'tag', + }, + attributes: attributes, + hr: { + pattern: /^'{3,}$/m, + alias: 'punctuation', + }, + 'page-break': { + pattern: /^<{3,}$/m, + alias: 'punctuation', + }, + admonition: { + pattern: /^(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING):/m, + alias: 'keyword', + }, + callout: [ + { + pattern: /(^[ \t]*)/m, + lookbehind: true, + alias: 'symbol', + }, + { + pattern: /<\d+>/, + alias: 'symbol', + }, + ], + macro: { + pattern: + /\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, + inside: { + function: /^[a-z\d-]+(?=:)/, + punctuation: /^::?/, + attributes: { + pattern: /(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, + inside: attributes.inside, + }, + }, + }, + inline: { + /* + The initial look-behind prevents the highlighting of escaped quoted text. + + Quoted text can be multi-line but cannot span an empty line. + All quoted text can have attributes before [foobar, 'foobar', baz="bar"]. + + First, we handle the constrained quotes. + Those must be bounded by non-word chars and cannot have spaces between the delimiter and the first char. + They are, in order: _emphasis_, ``double quotes'', `single quotes', `monospace`, 'emphasis', *strong*, +monospace+ and #unquoted# + + Then we handle the unconstrained quotes. + Those do not have the restrictions of the constrained quotes. + They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++, ##unquoted##, $$passthrough$$, ~subscript~, ^superscript^, {attribute-reference}, [[anchor]], [[[bibliography anchor]]], <>, (((indexes))) and ((indexes)) + */ + pattern: + /(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m, + lookbehind: true, + inside: { + attributes: attributes, + url: { + pattern: /^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/, + inside: { + punctuation: /^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/, + }, + }, + 'attribute-ref': { + pattern: /^\{.+\}$/, + inside: { + variable: { + pattern: /(^\{)[a-z\d,+_-]+/, + lookbehind: true, + }, + operator: /^[=?!#%@$]|!(?=[:}])/, + punctuation: /^\{|\}$|::?/, + }, + }, + italic: { + pattern: /^(['_])[\s\S]+\1$/, + inside: { + punctuation: /^(?:''?|__?)|(?:''?|__?)$/, + }, + }, + bold: { + pattern: /^\*[\s\S]+\*$/, + inside: { + punctuation: /^\*\*?|\*\*?$/, + }, + }, + punctuation: + /^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/, + }, + }, + replacement: { + pattern: /\((?:C|R|TM)\)/, + alias: 'builtin', + }, + entity: /&#?[\da-z]{1,8};/i, + 'line-continuation': { + pattern: /(^| )\+$/m, + lookbehind: true, + alias: 'punctuation', + }, + }); + + // Allow some nesting. There is no recursion though, so cloning should not be needed. + + function copyFromAsciiDoc(keys) { + keys = keys.split(' '); + + var o = {}; + for (var i = 0, l = keys.length; i < l; i++) { + o[keys[i]] = asciidoc[keys[i]]; + } + return o; + } + + attributes.inside['interpreted'].inside.rest = copyFromAsciiDoc( + 'macro inline replacement entity' + ); + + asciidoc['passthrough-block'].inside.rest = copyFromAsciiDoc('macro'); + + asciidoc['literal-block'].inside.rest = copyFromAsciiDoc('callout'); + + asciidoc['table'].inside.rest = copyFromAsciiDoc( + 'comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation' + ); + + asciidoc['other-block'].inside.rest = copyFromAsciiDoc( + 'table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation' + ); + + asciidoc['title'].inside.rest = copyFromAsciiDoc( + 'macro inline replacement entity' + ); + + // Plugin to make entity title show the real entity, idea by Roman Komarov + Prism.hooks.add('wrap', function (env) { + if (env.type === 'entity') { + env.attributes['title'] = env.content.replace(/&/, '&'); + } + }); + + Prism.languages.adoc = Prism.languages.asciidoc; +})(Prism); diff --git a/public/prism/prism-asciidoc.min.js b/public/prism/prism-asciidoc.min.js new file mode 100644 index 0000000..19af164 --- /dev/null +++ b/public/prism/prism-asciidoc.min.js @@ -0,0 +1,158 @@ +!(function (t) { + var n = { + pattern: + /(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m, + lookbehind: !0, + inside: { + quoted: { + pattern: /([$`])(?:(?!\1)[^\\]|\\.)*\1/, + inside: { punctuation: /^[$`]|[$`]$/ }, + }, + interpreted: { + pattern: /'(?:[^'\\]|\\.)*'/, + inside: { punctuation: /^'|'$/ }, + }, + string: /"(?:[^"\\]|\\.)*"/, + variable: /\w+(?==)/, + punctuation: /^\[|\]$|,/, + operator: /=/, + 'attr-value': /(?!^\s+$).+/, + }, + }, + a = (t.languages.asciidoc = { + 'comment-block': { + pattern: /^(\/{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1/m, + alias: 'comment', + }, + table: { + pattern: /^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m, + inside: { + specifiers: { + pattern: + /(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*](?:[<^>](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/, + alias: 'attr-value', + }, + punctuation: { pattern: /(^|[^\\])[|!]=*/, lookbehind: !0 }, + }, + }, + 'passthrough-block': { + pattern: /^(\+{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + inside: { punctuation: /^\++|\++$/ }, + }, + 'literal-block': { + pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + inside: { punctuation: /^(?:-+|\.+)|(?:-+|\.+)$/ }, + }, + 'other-block': { + pattern: + /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:[\s\S]*(?:\r?\n|\r))??\1$/m, + inside: { punctuation: /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/ }, + }, + 'list-punctuation': { + pattern: + /(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im, + lookbehind: !0, + alias: 'punctuation', + }, + 'list-label': { + pattern: /(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im, + lookbehind: !0, + alias: 'symbol', + }, + 'indented-block': { + pattern: /((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/, + lookbehind: !0, + }, + comment: /^\/\/.*/m, + title: { + pattern: + /^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m, + alias: 'important', + inside: { punctuation: /^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/ }, + }, + 'attribute-entry': { + pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m, + alias: 'tag', + }, + attributes: n, + hr: { pattern: /^'{3,}$/m, alias: 'punctuation' }, + 'page-break': { pattern: /^<{3,}$/m, alias: 'punctuation' }, + admonition: { + pattern: /^(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING):/m, + alias: 'keyword', + }, + callout: [ + { pattern: /(^[ \t]*)/m, lookbehind: !0, alias: 'symbol' }, + { pattern: /<\d+>/, alias: 'symbol' }, + ], + macro: { + pattern: + /\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, + inside: { + function: /^[a-z\d-]+(?=:)/, + punctuation: /^::?/, + attributes: { + pattern: /(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, + inside: n.inside, + }, + }, + }, + inline: { + pattern: + /(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m, + lookbehind: !0, + inside: { + attributes: n, + url: { + pattern: /^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/, + inside: { punctuation: /^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/ }, + }, + 'attribute-ref': { + pattern: /^\{.+\}$/, + inside: { + variable: { pattern: /(^\{)[a-z\d,+_-]+/, lookbehind: !0 }, + operator: /^[=?!#%@$]|!(?=[:}])/, + punctuation: /^\{|\}$|::?/, + }, + }, + italic: { + pattern: /^(['_])[\s\S]+\1$/, + inside: { punctuation: /^(?:''?|__?)|(?:''?|__?)$/ }, + }, + bold: { + pattern: /^\*[\s\S]+\*$/, + inside: { punctuation: /^\*\*?|\*\*?$/ }, + }, + punctuation: + /^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/, + }, + }, + replacement: { pattern: /\((?:C|R|TM)\)/, alias: 'builtin' }, + entity: /&#?[\da-z]{1,8};/i, + 'line-continuation': { + pattern: /(^| )\+$/m, + lookbehind: !0, + alias: 'punctuation', + }, + }); + function i(t) { + for (var n = {}, i = 0, e = (t = t.split(' ')).length; i < e; i++) + n[t[i]] = a[t[i]]; + return n; + } + (n.inside.interpreted.inside.rest = i('macro inline replacement entity')), + (a['passthrough-block'].inside.rest = i('macro')), + (a['literal-block'].inside.rest = i('callout')), + (a.table.inside.rest = i( + 'comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation' + )), + (a['other-block'].inside.rest = i( + 'table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation' + )), + (a.title.inside.rest = i('macro inline replacement entity')), + t.hooks.add('wrap', function (t) { + 'entity' === t.type && + (t.attributes.title = t.content.replace(/&/, '&')); + }), + (t.languages.adoc = t.languages.asciidoc); +})(Prism); diff --git a/public/prism/prism-asm6502.js b/public/prism/prism-asm6502.js new file mode 100644 index 0000000..377f52f --- /dev/null +++ b/public/prism/prism-asm6502.js @@ -0,0 +1,30 @@ +Prism.languages.asm6502 = { + comment: /;.*/, + directive: { + pattern: /\.\w+(?= )/, + alias: 'property', + }, + string: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, + 'op-code': { + pattern: + /\b(?:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA|adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\b/, + alias: 'keyword', + }, + 'hex-number': { + pattern: /#?\$[\da-f]{1,4}\b/i, + alias: 'number', + }, + 'binary-number': { + pattern: /#?%[01]+\b/, + alias: 'number', + }, + 'decimal-number': { + pattern: /#?\b\d+\b/, + alias: 'number', + }, + register: { + pattern: /\b[xya]\b/i, + alias: 'variable', + }, + punctuation: /[(),:]/, +}; diff --git a/public/prism/prism-asm6502.min.js b/public/prism/prism-asm6502.min.js new file mode 100644 index 0000000..57691cd --- /dev/null +++ b/public/prism/prism-asm6502.min.js @@ -0,0 +1,15 @@ +Prism.languages.asm6502 = { + comment: /;.*/, + directive: { pattern: /\.\w+(?= )/, alias: 'property' }, + string: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, + 'op-code': { + pattern: + /\b(?:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA|adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\b/, + alias: 'keyword', + }, + 'hex-number': { pattern: /#?\$[\da-f]{1,4}\b/i, alias: 'number' }, + 'binary-number': { pattern: /#?%[01]+\b/, alias: 'number' }, + 'decimal-number': { pattern: /#?\b\d+\b/, alias: 'number' }, + register: { pattern: /\b[xya]\b/i, alias: 'variable' }, + punctuation: /[(),:]/, +}; diff --git a/public/prism/prism-asmatmel.js b/public/prism/prism-asmatmel.js new file mode 100644 index 0000000..19d9cf0 --- /dev/null +++ b/public/prism/prism-asmatmel.js @@ -0,0 +1,44 @@ +Prism.languages.asmatmel = { + comment: { + pattern: /;.*/, + greedy: true, + }, + string: { + pattern: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + + constant: /\b(?:PORT[A-Z]|DDR[A-Z]|(?:DD|P)[A-Z](?:\d|[0-2]\d|3[01]))\b/, + + directive: { + pattern: /\.\w+(?= )/, + alias: 'property', + }, + 'r-register': { + pattern: /\br(?:\d|[12]\d|3[01])\b/, + alias: 'variable', + }, + 'op-code': { + pattern: + /\b(?:ADC|ADD|ADIW|AND|ANDI|ASR|BCLR|BLD|BRBC|BRBS|BRCC|BRCS|BREAK|BREQ|BRGE|BRHC|BRHS|BRID|BRIE|BRLO|BRLT|BRMI|BRNE|BRPL|BRSH|BRTC|BRTS|BRVC|BRVS|BSET|BST|CALL|CBI|CBR|CLC|CLH|CLI|CLN|CLR|CLS|CLT|CLV|CLZ|COM|CP|CPC|CPI|CPSE|DEC|DES|EICALL|EIJMP|ELPM|EOR|FMUL|FMULS|FMULSU|ICALL|IJMP|IN|INC|JMP|LAC|LAS|LAT|LD|LD[A-Za-z0-9]|LPM|LSL|LSR|MOV|MOVW|MUL|MULS|MULSU|NEG|NOP|OR|ORI|OUT|POP|PUSH|RCALL|RET|RETI|RJMP|ROL|ROR|SBC|SBCI|SBI|SBIC|SBIS|SBIW|SBR|SBRC|SBRS|SEC|SEH|SEI|SEN|SER|SES|SET|SEV|SEZ|SLEEP|SPM|ST|ST[A-Z0-9]|SUB|SUBI|SWAP|TST|WDR|XCH|adc|add|adiw|and|andi|asr|bclr|bld|brbc|brbs|brcc|brcs|break|breq|brge|brhc|brhs|brid|brie|brlo|brlt|brmi|brne|brpl|brsh|brtc|brts|brvc|brvs|bset|bst|call|cbi|cbr|clc|clh|cli|cln|clr|cls|clt|clv|clz|com|cp|cpc|cpi|cpse|dec|des|eicall|eijmp|elpm|eor|fmul|fmuls|fmulsu|icall|ijmp|in|inc|jmp|lac|las|lat|ld|ld[a-z0-9]|lpm|lsl|lsr|mov|movw|mul|muls|mulsu|neg|nop|or|ori|out|pop|push|rcall|ret|reti|rjmp|rol|ror|sbc|sbci|sbi|sbic|sbis|sbiw|sbr|sbrc|sbrs|sec|seh|sei|sen|ser|ses|set|sev|sez|sleep|spm|st|st[a-zA-Z0-9]|sub|subi|swap|tst|wdr|xch)\b/, + alias: 'keyword', + }, + 'hex-number': { + pattern: /#?\$[\da-f]{2,4}\b/i, + alias: 'number', + }, + 'binary-number': { + pattern: /#?%[01]+\b/, + alias: 'number', + }, + 'decimal-number': { + pattern: /#?\b\d+\b/, + alias: 'number', + }, + register: { + pattern: /\b[acznvshtixy]\b/i, + alias: 'variable', + }, + operator: />>=?|<<=?|&&?|\|\|?|[-+*/%&|^!=<>?]=?/, + punctuation: /[(),:]/, +}; diff --git a/public/prism/prism-asmatmel.min.js b/public/prism/prism-asmatmel.min.js new file mode 100644 index 0000000..efb9e45 --- /dev/null +++ b/public/prism/prism-asmatmel.min.js @@ -0,0 +1,18 @@ +Prism.languages.asmatmel = { + comment: { pattern: /;.*/, greedy: !0 }, + string: { pattern: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, + constant: /\b(?:PORT[A-Z]|DDR[A-Z]|(?:DD|P)[A-Z](?:\d|[0-2]\d|3[01]))\b/, + directive: { pattern: /\.\w+(?= )/, alias: 'property' }, + 'r-register': { pattern: /\br(?:\d|[12]\d|3[01])\b/, alias: 'variable' }, + 'op-code': { + pattern: + /\b(?:ADC|ADD|ADIW|AND|ANDI|ASR|BCLR|BLD|BRBC|BRBS|BRCC|BRCS|BREAK|BREQ|BRGE|BRHC|BRHS|BRID|BRIE|BRLO|BRLT|BRMI|BRNE|BRPL|BRSH|BRTC|BRTS|BRVC|BRVS|BSET|BST|CALL|CBI|CBR|CLC|CLH|CLI|CLN|CLR|CLS|CLT|CLV|CLZ|COM|CP|CPC|CPI|CPSE|DEC|DES|EICALL|EIJMP|ELPM|EOR|FMUL|FMULS|FMULSU|ICALL|IJMP|IN|INC|JMP|LAC|LAS|LAT|LD|LD[A-Za-z0-9]|LPM|LSL|LSR|MOV|MOVW|MUL|MULS|MULSU|NEG|NOP|OR|ORI|OUT|POP|PUSH|RCALL|RET|RETI|RJMP|ROL|ROR|SBC|SBCI|SBI|SBIC|SBIS|SBIW|SBR|SBRC|SBRS|SEC|SEH|SEI|SEN|SER|SES|SET|SEV|SEZ|SLEEP|SPM|ST|ST[A-Z0-9]|SUB|SUBI|SWAP|TST|WDR|XCH|adc|add|adiw|and|andi|asr|bclr|bld|brbc|brbs|brcc|brcs|break|breq|brge|brhc|brhs|brid|brie|brlo|brlt|brmi|brne|brpl|brsh|brtc|brts|brvc|brvs|bset|bst|call|cbi|cbr|clc|clh|cli|cln|clr|cls|clt|clv|clz|com|cp|cpc|cpi|cpse|dec|des|eicall|eijmp|elpm|eor|fmul|fmuls|fmulsu|icall|ijmp|in|inc|jmp|lac|las|lat|ld|ld[a-z0-9]|lpm|lsl|lsr|mov|movw|mul|muls|mulsu|neg|nop|or|ori|out|pop|push|rcall|ret|reti|rjmp|rol|ror|sbc|sbci|sbi|sbic|sbis|sbiw|sbr|sbrc|sbrs|sec|seh|sei|sen|ser|ses|set|sev|sez|sleep|spm|st|st[a-zA-Z0-9]|sub|subi|swap|tst|wdr|xch)\b/, + alias: 'keyword', + }, + 'hex-number': { pattern: /#?\$[\da-f]{2,4}\b/i, alias: 'number' }, + 'binary-number': { pattern: /#?%[01]+\b/, alias: 'number' }, + 'decimal-number': { pattern: /#?\b\d+\b/, alias: 'number' }, + register: { pattern: /\b[acznvshtixy]\b/i, alias: 'variable' }, + operator: />>=?|<<=?|&&?|\|\|?|[-+*/%&|^!=<>?]=?/, + punctuation: /[(),:]/, +}; diff --git a/public/prism/prism-aspnet.js b/public/prism/prism-aspnet.js new file mode 100644 index 0000000..e051afb --- /dev/null +++ b/public/prism/prism-aspnet.js @@ -0,0 +1,60 @@ +Prism.languages.aspnet = Prism.languages.extend('markup', { + 'page-directive': { + pattern: /<%\s*@.*%>/, + alias: 'tag', + inside: { + '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: { + pattern: /<%.*%>/, + alias: 'tag', + inside: { + directive: { + pattern: /<%\s*?[$=%#:]{0,2}|%>/, + alias: 'tag', + }, + rest: Prism.languages.csharp, + }, + }, +}); +// Regexp copied from prism-markup, with a negative look-ahead added +Prism.languages.aspnet.tag.pattern = + /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/; + +// match directives of attribute value foo="<% Bar %>" +Prism.languages.insertBefore( + 'inside', + 'punctuation', + { + directive: Prism.languages.aspnet['directive'], + }, + Prism.languages.aspnet.tag.inside['attr-value'] +); + +Prism.languages.insertBefore('aspnet', 'comment', { + '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': { + pattern: + /(]*>)[\s\S]*?(?=<\/script>)/i, + lookbehind: true, + alias: ['asp', 'script'], + inside: Prism.languages.csharp || {}, + }, + } +); diff --git a/public/prism/prism-aspnet.min.js b/public/prism/prism-aspnet.min.js new file mode 100644 index 0000000..5bfc9d8 --- /dev/null +++ b/public/prism/prism-aspnet.min.js @@ -0,0 +1,46 @@ +(Prism.languages.aspnet = Prism.languages.extend('markup', { + 'page-directive': { + pattern: /<%\s*@.*%>/, + alias: 'tag', + inside: { + '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: { + pattern: /<%.*%>/, + alias: 'tag', + inside: { + directive: { pattern: /<%\s*?[$=%#:]{0,2}|%>/, alias: 'tag' }, + rest: Prism.languages.csharp, + }, + }, +})), + (Prism.languages.aspnet.tag.pattern = + /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/), + Prism.languages.insertBefore( + 'inside', + 'punctuation', + { directive: Prism.languages.aspnet.directive }, + Prism.languages.aspnet.tag.inside['attr-value'] + ), + Prism.languages.insertBefore('aspnet', 'comment', { + 'asp-comment': { pattern: /<%--[\s\S]*?--%>/, alias: ['asp', 'comment'] }, + }), + Prism.languages.insertBefore( + 'aspnet', + Prism.languages.javascript ? 'script' : 'tag', + { + 'asp-script': { + pattern: + /(]*>)[\s\S]*?(?=<\/script>)/i, + lookbehind: !0, + alias: ['asp', 'script'], + inside: Prism.languages.csharp || {}, + }, + } + ); diff --git a/public/prism/prism-autohotkey.js b/public/prism/prism-autohotkey.js new file mode 100644 index 0000000..e258e83 --- /dev/null +++ b/public/prism/prism-autohotkey.js @@ -0,0 +1,46 @@ +// NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl +Prism.languages.autohotkey = { + comment: [ + { + pattern: /(^|\s);.*/, + lookbehind: true, + }, + { + pattern: + /(^[\t ]*)\/\*(?:[\r\n](?![ \t]*\*\/)|[^\r\n])*(?:[\r\n][ \t]*\*\/)?/m, + lookbehind: true, + greedy: true, + }, + ], + tag: { + // labels + pattern: /^([ \t]*)[^\s,`":]+(?=:[ \t]*$)/m, + lookbehind: true, + }, + string: /"(?:[^"\n\r]|"")*"/, + variable: /%\w+%/, + number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, + operator: + /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/, + boolean: /\b(?:false|true)\b/, + + selector: + /\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i, + + constant: + /\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guicontrol|a_guicontrolevent|a_guievent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel|programfiles)\b/i, + + builtin: + /\b(?:abs|acos|asc|asin|atan|ceil|chr|class|comobjactive|comobjarray|comobjconnect|comobjcreate|comobjerror|comobjflags|comobjget|comobjquery|comobjtype|comobjvalue|cos|dllcall|exp|fileexist|Fileopen|floor|format|il_add|il_create|il_destroy|instr|isfunc|islabel|IsObject|ln|log|ltrim|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|numget|numput|onmessage|regexmatch|regexreplace|registercallback|round|rtrim|sb_seticon|sb_setparts|sb_settext|sin|sqrt|strlen|strreplace|strsplit|substr|tan|tv_add|tv_delete|tv_get|tv_getchild|tv_getcount|tv_getnext|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__Call|__Get|__New|__Set)\b/i, + + symbol: + /\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i, + + important: + /#\b(?:AllowSameLineComments|ClipboardTimeout|CommentFlag|DerefChar|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|If|IfTimeout|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InputLevel|InstallKeybdHook|InstallMouseHook|KeyHistory|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|MenuMaskKey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|Warn|WinActivateForce)\b/i, + + keyword: + /\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|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|Catch|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|Finally|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|Region|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|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|Throw|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|Try|TryAgain|Type|UnCheck|underline|Unicode|Unlock|Until|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, + function: /[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+(?=\()/, + punctuation: /[{}[\]():,]/, +}; diff --git a/public/prism/prism-autohotkey.min.js b/public/prism/prism-autohotkey.min.js new file mode 100644 index 0000000..33e8435 --- /dev/null +++ b/public/prism/prism-autohotkey.min.js @@ -0,0 +1,32 @@ +Prism.languages.autohotkey = { + comment: [ + { pattern: /(^|\s);.*/, lookbehind: !0 }, + { + pattern: + /(^[\t ]*)\/\*(?:[\r\n](?![ \t]*\*\/)|[^\r\n])*(?:[\r\n][ \t]*\*\/)?/m, + lookbehind: !0, + greedy: !0, + }, + ], + tag: { pattern: /^([ \t]*)[^\s,`":]+(?=:[ \t]*$)/m, lookbehind: !0 }, + string: /"(?:[^"\n\r]|"")*"/, + variable: /%\w+%/, + number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, + operator: + /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/, + boolean: /\b(?:false|true)\b/, + selector: + /\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i, + constant: + /\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guicontrol|a_guicontrolevent|a_guievent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel|programfiles)\b/i, + builtin: + /\b(?:abs|acos|asc|asin|atan|ceil|chr|class|comobjactive|comobjarray|comobjconnect|comobjcreate|comobjerror|comobjflags|comobjget|comobjquery|comobjtype|comobjvalue|cos|dllcall|exp|fileexist|Fileopen|floor|format|il_add|il_create|il_destroy|instr|isfunc|islabel|IsObject|ln|log|ltrim|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|numget|numput|onmessage|regexmatch|regexreplace|registercallback|round|rtrim|sb_seticon|sb_setparts|sb_settext|sin|sqrt|strlen|strreplace|strsplit|substr|tan|tv_add|tv_delete|tv_get|tv_getchild|tv_getcount|tv_getnext|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__Call|__Get|__New|__Set)\b/i, + symbol: + /\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i, + important: + /#\b(?:AllowSameLineComments|ClipboardTimeout|CommentFlag|DerefChar|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|If|IfTimeout|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InputLevel|InstallKeybdHook|InstallMouseHook|KeyHistory|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|MenuMaskKey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|Warn|WinActivateForce)\b/i, + keyword: + /\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|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|Catch|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|Finally|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|Region|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|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|Throw|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|Try|TryAgain|Type|UnCheck|underline|Unicode|Unlock|Until|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, + function: /[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+(?=\()/, + punctuation: /[{}[\]():,]/, +}; diff --git a/public/prism/prism-autoit.js b/public/prism/prism-autoit.js new file mode 100644 index 0000000..c538197 --- /dev/null +++ b/public/prism/prism-autoit.js @@ -0,0 +1,36 @@ +Prism.languages.autoit = { + comment: [ + /;.*/, + { + // The multi-line comments delimiters can actually be commented out with ";" + pattern: + /(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:ce|comments-end)/m, + lookbehind: true, + }, + ], + url: { + pattern: /(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m, + lookbehind: true, + }, + string: { + pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/, + greedy: true, + inside: { + variable: /([%$@])\w+\1/, + }, + }, + directive: { + pattern: /(^[\t ]*)#\w+/m, + lookbehind: true, + alias: 'keyword', + }, + function: /\b\w+(?=\()/, + // Variables and macros + variable: /[$@]\w+/, + keyword: + /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i, + number: /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i, + boolean: /\b(?:False|True)\b/i, + operator: /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Not|Or)\b/i, + punctuation: /[\[\]().,:]/, +}; diff --git a/public/prism/prism-autoit.min.js b/public/prism/prism-autoit.min.js new file mode 100644 index 0000000..2456b4d --- /dev/null +++ b/public/prism/prism-autoit.min.js @@ -0,0 +1,28 @@ +Prism.languages.autoit = { + comment: [ + /;.*/, + { + pattern: + /(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:ce|comments-end)/m, + lookbehind: !0, + }, + ], + url: { + pattern: /(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m, + lookbehind: !0, + }, + string: { + pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/, + greedy: !0, + inside: { variable: /([%$@])\w+\1/ }, + }, + directive: { pattern: /(^[\t ]*)#\w+/m, lookbehind: !0, alias: 'keyword' }, + function: /\b\w+(?=\()/, + variable: /[$@]\w+/, + keyword: + /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i, + number: /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i, + boolean: /\b(?:False|True)\b/i, + operator: /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Not|Or)\b/i, + punctuation: /[\[\]().,:]/, +}; diff --git a/public/prism/prism-avisynth.js b/public/prism/prism-avisynth.js new file mode 100644 index 0000000..4afb171 --- /dev/null +++ b/public/prism/prism-avisynth.js @@ -0,0 +1,208 @@ +// http://avisynth.nl/index.php/The_full_AviSynth_grammar +(function (Prism) { + function replace(pattern, replacements) { + return pattern.replace(/<<(\d+)>>/g, function (m, index) { + return replacements[+index]; + }); + } + + function re(pattern, replacements, flags) { + return RegExp(replace(pattern, replacements), flags || ''); + } + + var types = /bool|clip|float|int|string|val/.source; + var internals = [ + // bools + /is(?:bool|clip|float|int|string)|defined|(?:(?:internal)?function|var)?exists?/ + .source, + // control + /apply|assert|default|eval|import|nop|select|undefined/.source, + // global + /opt_(?:allowfloataudio|avipadscanlines|dwchannelmask|enable_(?:b64a|planartopackedrgb|v210|y3_10_10|y3_10_16)|usewaveextensible|vdubplanarhack)|set(?:cachemode|maxcpu|memorymax|planarlegacyalignment|workingdir)/ + .source, + // conv + /hex(?:value)?|value/.source, + // numeric + /abs|ceil|continued(?:denominator|numerator)?|exp|floor|fmod|frac|log(?:10)?|max|min|muldiv|pi|pow|rand|round|sign|spline|sqrt/ + .source, + // trig + /a?sinh?|a?cosh?|a?tan[2h]?/.source, + // bit + /(?:bit(?:and|not|x?or|[lr]?shift[aslu]?|sh[lr]|sa[lr]|[lr]rotatel?|ro[rl]|te?st|set(?:count)?|cl(?:ea)?r|ch(?:an)?ge?))/ + .source, + // runtime + /average(?:[bgr]|chroma[uv]|luma)|(?:[rgb]|chroma[uv]|luma|rgb|[yuv](?=difference(?:fromprevious|tonext)))difference(?:fromprevious|tonext)?|[yuvrgb]plane(?:median|min|max|minmaxdifference)/ + .source, + // script + /getprocessinfo|logmsg|script(?:dir(?:utf8)?|file(?:utf8)?|name(?:utf8)?)|setlogparams/ + .source, + // string + /chr|(?:fill|find|left|mid|replace|rev|right)str|format|[lu]case|ord|str(?:cmpi?|fromutf8|len|toutf8)|time|trim(?:all|left|right)/ + .source, + // version + /isversionorgreater|version(?:number|string)/.source, + // helper + /buildpixeltype|colorspacenametopixeltype/.source, + // avsplus + /addautoloaddir|on(?:cpu|cuda)|prefetch|setfiltermtmode/.source, + ].join('|'); + var properties = [ + // content + /has(?:audio|video)/.source, + // resolution + /height|width/.source, + // framerate + /frame(?:count|rate)|framerate(?:denominator|numerator)/.source, + // interlacing + /getparity|is(?:field|frame)based/.source, + // color format + /bitspercomponent|componentsize|hasalpha|is(?:planar(?:rgba?)?|interleaved|rgb(?:24|32|48|64)?|y(?:8|u(?:va?|y2))?|yv(?:12|16|24|411)|420|422|444|packedrgb)|numcomponents|pixeltype/ + .source, + // audio + /audio(?:bits|channels|duration|length(?:[fs]|hi|lo)?|rate)|isaudio(?:float|int)/ + .source, + ].join('|'); + var filters = [ + // source + /avi(?:file)?source|directshowsource|image(?:reader|source|sourceanim)|opendmlsource|segmented(?:avisource|directshowsource)|wavsource/ + .source, + // color + /coloryuv|convertbacktoyuy2|convertto(?:RGB(?:24|32|48|64)|(?:planar)?RGBA?|Y8?|YV(?:12|16|24|411)|YUVA?(?:411|420|422|444)|YUY2)|fixluminance|gr[ae]yscale|invert|levels|limiter|mergea?rgb|merge(?:chroma|luma)|rgbadjust|show(?:alpha|blue|green|red)|swapuv|tweak|[uv]toy8?|ytouv/ + .source, + // overlay + /(?:colorkey|reset)mask|layer|mask(?:hs)?|merge|overlay|subtract/.source, + // geometry + /addborders|(?:bicubic|bilinear|blackman|gauss|lanczos4|lanczos|point|sinc|spline(?:16|36|64))resize|crop(?:bottom)?|flip(?:horizontal|vertical)|(?:horizontal|vertical)?reduceby2|letterbox|skewrows|turn(?:180|left|right)/ + .source, + // pixel + /blur|fixbrokenchromaupsampling|generalconvolution|(?:spatial|temporal)soften|sharpen/ + .source, + // timeline + /trim|(?:un)?alignedsplice|(?:assume|assumescaled|change|convert)FPS|(?:delete|duplicate)frame|dissolve|fade(?:in|io|out)[02]?|freezeframe|interleave|loop|reverse|select(?:even|odd|(?:range)?every)/ + .source, + // interlace + /assume[bt]ff|assume(?:field|frame)based|bob|complementparity|doubleweave|peculiarblend|pulldown|separate(?:columns|fields|rows)|swapfields|weave(?:columns|rows)?/ + .source, + // audio + /amplify(?:db)?|assumesamplerate|audiodub(?:ex)?|audiotrim|convertaudioto(?:(?:8|16|24|32)bit|float)|converttomono|delayaudio|ensurevbrmp3sync|get(?:left|right)?channel|kill(?:audio|video)|mergechannels|mixaudio|monotostereo|normalize|resampleaudio|ssrc|supereq|timestretch/ + .source, + // conditional + /animate|applyrange|conditional(?:filter|reader|select)|frameevaluate|scriptclip|tcp(?:server|source)|writefile(?:end|if|start)?/ + .source, + // export + /imagewriter/.source, + // debug + /blackness|blankclip|colorbars(?:hd)?|compare|dumpfiltergraph|echo|histogram|info|messageclip|preroll|setgraphanalysis|show(?:framenumber|smpte|time)|showfiveversions|stack(?:horizontal|vertical)|subtitle|tone|version/ + .source, + ].join('|'); + var allinternals = [internals, properties, filters].join('|'); + + Prism.languages.avisynth = { + comment: [ + { + // Matches [* *] nestable block comments, but only supports 1 level of nested comments + // /\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|)*\*\]/ + pattern: + /(^|[^\\])\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|\[\*(?:[^\[*]|\[(?!\*)|\*(?!\]))*\*\])*\*\]/, + lookbehind: true, + greedy: true, + }, + { + // Matches /* */ block comments + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true, + greedy: true, + }, + { + // Matches # comments + pattern: /(^|[^\\$])#.*/, + lookbehind: true, + greedy: true, + }, + ], + + // Handle before strings because optional arguments are surrounded by double quotes + argument: { + pattern: re(/\b(?:<<0>>)\s+("?)\w+\1/.source, [types], 'i'), + inside: { + keyword: /^\w+/, + }, + }, + + // Optional argument assignment + 'argument-label': { + pattern: /([,(][\s\\]*)\w+\s*=(?!=)/, + lookbehind: true, + inside: { + 'argument-name': { + pattern: /^\w+/, + alias: 'punctuation', + }, + punctuation: /=$/, + }, + }, + + string: [ + { + // triple double-quoted + pattern: /"""[\s\S]*?"""/, + greedy: true, + }, + { + // single double-quoted + pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, + greedy: true, + inside: { + constant: { + // These *are* case-sensitive! + pattern: + /\b(?:DEFAULT_MT_MODE|(?:MAINSCRIPT|PROGRAM|SCRIPT)DIR|(?:MACHINE|USER)_(?:CLASSIC|PLUS)_PLUGINS)\b/, + }, + }, + }, + ], + + // The special "last" variable that takes the value of the last implicitly returned clip + variable: /\b(?:last)\b/i, + + boolean: /\b(?:false|no|true|yes)\b/i, + + keyword: + /\b(?:catch|else|for|function|global|if|return|try|while|__END__)\b/i, + + constant: /\bMT_(?:MULTI_INSTANCE|NICE_FILTER|SERIALIZED|SPECIAL_MT)\b/, + + // AviSynth's internal functions, filters, and properties + 'builtin-function': { + pattern: re(/\b(?:<<0>>)\b/.source, [allinternals], 'i'), + alias: 'function', + }, + + 'type-cast': { + pattern: re(/\b(?:<<0>>)(?=\s*\()/.source, [types], 'i'), + alias: 'keyword', + }, + + // External/user-defined filters + function: { + pattern: /\b[a-z_]\w*(?=\s*\()|(\.)[a-z_]\w*\b/i, + lookbehind: true, + }, + + // Matches a \ as the first or last character on a line + 'line-continuation': { + pattern: /(^[ \t]*)\\|\\(?=[ \t]*$)/m, + lookbehind: true, + alias: 'punctuation', + }, + + number: + /\B\$(?:[\da-f]{6}|[\da-f]{8})\b|(?:(?:\b|\B-)\d+(?:\.\d*)?\b|\B\.\d+\b)/i, + + operator: /\+\+?|[!=<>]=?|&&|\|\||[?:*/%-]/, + + punctuation: /[{}\[\]();,.]/, + }; + + Prism.languages.avs = Prism.languages.avisynth; +})(Prism); diff --git a/public/prism/prism-avisynth.min.js b/public/prism/prism-avisynth.min.js new file mode 100644 index 0000000..eba7cf9 --- /dev/null +++ b/public/prism/prism-avisynth.min.js @@ -0,0 +1,119 @@ +!(function (e) { + function a(e, a, r) { + return RegExp( + (function (e, r) { + return e.replace(/<<(\d+)>>/g, function (e, a) { + return r[+a]; + }); + })(e, a), + r || '' + ); + } + var r = 'bool|clip|float|int|string|val', + t = [ + [ + 'is(?:bool|clip|float|int|string)|defined|(?:(?:internal)?function|var)?exists?', + 'apply|assert|default|eval|import|nop|select|undefined', + 'opt_(?:allowfloataudio|avipadscanlines|dwchannelmask|enable_(?:b64a|planartopackedrgb|v210|y3_10_10|y3_10_16)|usewaveextensible|vdubplanarhack)|set(?:cachemode|maxcpu|memorymax|planarlegacyalignment|workingdir)', + 'hex(?:value)?|value', + 'abs|ceil|continued(?:denominator|numerator)?|exp|floor|fmod|frac|log(?:10)?|max|min|muldiv|pi|pow|rand|round|sign|spline|sqrt', + 'a?sinh?|a?cosh?|a?tan[2h]?', + '(?:bit(?:and|not|x?or|[lr]?shift[aslu]?|sh[lr]|sa[lr]|[lr]rotatel?|ro[rl]|te?st|set(?:count)?|cl(?:ea)?r|ch(?:an)?ge?))', + 'average(?:[bgr]|chroma[uv]|luma)|(?:[rgb]|chroma[uv]|luma|rgb|[yuv](?=difference(?:fromprevious|tonext)))difference(?:fromprevious|tonext)?|[yuvrgb]plane(?:median|min|max|minmaxdifference)', + 'getprocessinfo|logmsg|script(?:dir(?:utf8)?|file(?:utf8)?|name(?:utf8)?)|setlogparams', + 'chr|(?:fill|find|left|mid|replace|rev|right)str|format|[lu]case|ord|str(?:cmpi?|fromutf8|len|toutf8)|time|trim(?:all|left|right)', + 'isversionorgreater|version(?:number|string)', + 'buildpixeltype|colorspacenametopixeltype', + 'addautoloaddir|on(?:cpu|cuda)|prefetch|setfiltermtmode', + ].join('|'), + [ + 'has(?:audio|video)', + 'height|width', + 'frame(?:count|rate)|framerate(?:denominator|numerator)', + 'getparity|is(?:field|frame)based', + 'bitspercomponent|componentsize|hasalpha|is(?:planar(?:rgba?)?|interleaved|rgb(?:24|32|48|64)?|y(?:8|u(?:va?|y2))?|yv(?:12|16|24|411)|420|422|444|packedrgb)|numcomponents|pixeltype', + 'audio(?:bits|channels|duration|length(?:[fs]|hi|lo)?|rate)|isaudio(?:float|int)', + ].join('|'), + [ + 'avi(?:file)?source|directshowsource|image(?:reader|source|sourceanim)|opendmlsource|segmented(?:avisource|directshowsource)|wavsource', + 'coloryuv|convertbacktoyuy2|convertto(?:RGB(?:24|32|48|64)|(?:planar)?RGBA?|Y8?|YV(?:12|16|24|411)|YUVA?(?:411|420|422|444)|YUY2)|fixluminance|gr[ae]yscale|invert|levels|limiter|mergea?rgb|merge(?:chroma|luma)|rgbadjust|show(?:alpha|blue|green|red)|swapuv|tweak|[uv]toy8?|ytouv', + '(?:colorkey|reset)mask|layer|mask(?:hs)?|merge|overlay|subtract', + 'addborders|(?:bicubic|bilinear|blackman|gauss|lanczos4|lanczos|point|sinc|spline(?:16|36|64))resize|crop(?:bottom)?|flip(?:horizontal|vertical)|(?:horizontal|vertical)?reduceby2|letterbox|skewrows|turn(?:180|left|right)', + 'blur|fixbrokenchromaupsampling|generalconvolution|(?:spatial|temporal)soften|sharpen', + 'trim|(?:un)?alignedsplice|(?:assume|assumescaled|change|convert)FPS|(?:delete|duplicate)frame|dissolve|fade(?:in|io|out)[02]?|freezeframe|interleave|loop|reverse|select(?:even|odd|(?:range)?every)', + 'assume[bt]ff|assume(?:field|frame)based|bob|complementparity|doubleweave|peculiarblend|pulldown|separate(?:columns|fields|rows)|swapfields|weave(?:columns|rows)?', + 'amplify(?:db)?|assumesamplerate|audiodub(?:ex)?|audiotrim|convertaudioto(?:(?:8|16|24|32)bit|float)|converttomono|delayaudio|ensurevbrmp3sync|get(?:left|right)?channel|kill(?:audio|video)|mergechannels|mixaudio|monotostereo|normalize|resampleaudio|ssrc|supereq|timestretch', + 'animate|applyrange|conditional(?:filter|reader|select)|frameevaluate|scriptclip|tcp(?:server|source)|writefile(?:end|if|start)?', + 'imagewriter', + 'blackness|blankclip|colorbars(?:hd)?|compare|dumpfiltergraph|echo|histogram|info|messageclip|preroll|setgraphanalysis|show(?:framenumber|smpte|time)|showfiveversions|stack(?:horizontal|vertical)|subtitle|tone|version', + ].join('|'), + ].join('|'); + (e.languages.avisynth = { + comment: [ + { + pattern: + /(^|[^\\])\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|\[\*(?:[^\[*]|\[(?!\*)|\*(?!\]))*\*\])*\*\]/, + lookbehind: !0, + greedy: !0, + }, + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: !0, + greedy: !0, + }, + { pattern: /(^|[^\\$])#.*/, lookbehind: !0, greedy: !0 }, + ], + argument: { + pattern: a('\\b(?:<<0>>)\\s+("?)\\w+\\1', [r], 'i'), + inside: { keyword: /^\w+/ }, + }, + 'argument-label': { + pattern: /([,(][\s\\]*)\w+\s*=(?!=)/, + lookbehind: !0, + inside: { + 'argument-name': { pattern: /^\w+/, alias: 'punctuation' }, + punctuation: /=$/, + }, + }, + string: [ + { pattern: /"""[\s\S]*?"""/, greedy: !0 }, + { + pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, + greedy: !0, + inside: { + constant: { + pattern: + /\b(?:DEFAULT_MT_MODE|(?:MAINSCRIPT|PROGRAM|SCRIPT)DIR|(?:MACHINE|USER)_(?:CLASSIC|PLUS)_PLUGINS)\b/, + }, + }, + }, + ], + variable: /\b(?:last)\b/i, + boolean: /\b(?:false|no|true|yes)\b/i, + keyword: + /\b(?:catch|else|for|function|global|if|return|try|while|__END__)\b/i, + constant: /\bMT_(?:MULTI_INSTANCE|NICE_FILTER|SERIALIZED|SPECIAL_MT)\b/, + 'builtin-function': { + pattern: a('\\b(?:<<0>>)\\b', [t], 'i'), + alias: 'function', + }, + 'type-cast': { + pattern: a('\\b(?:<<0>>)(?=\\s*\\()', [r], 'i'), + alias: 'keyword', + }, + function: { + pattern: /\b[a-z_]\w*(?=\s*\()|(\.)[a-z_]\w*\b/i, + lookbehind: !0, + }, + 'line-continuation': { + pattern: /(^[ \t]*)\\|\\(?=[ \t]*$)/m, + lookbehind: !0, + alias: 'punctuation', + }, + number: + /\B\$(?:[\da-f]{6}|[\da-f]{8})\b|(?:(?:\b|\B-)\d+(?:\.\d*)?\b|\B\.\d+\b)/i, + operator: /\+\+?|[!=<>]=?|&&|\|\||[?:*/%-]/, + punctuation: /[{}\[\]();,.]/, + }), + (e.languages.avs = e.languages.avisynth); +})(Prism); diff --git a/public/prism/prism-avro-idl.js b/public/prism/prism-avro-idl.js new file mode 100644 index 0000000..6bb8615 --- /dev/null +++ b/public/prism/prism-avro-idl.js @@ -0,0 +1,52 @@ +// GitHub: https://github.com/apache/avro +// Docs: https://avro.apache.org/docs/current/idl.html + +Prism.languages['avro-idl'] = { + comment: { + pattern: /\/\/.*|\/\*[\s\S]*?\*\//, + greedy: true, + }, + string: { + pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/, + lookbehind: true, + greedy: true, + }, + + annotation: { + pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/, + greedy: true, + alias: 'function', + }, + 'function-identifier': { + pattern: /`[^\r\n`]+`(?=\s*\()/, + greedy: true, + alias: 'function', + }, + identifier: { + pattern: /`[^\r\n`]+`/, + greedy: true, + }, + + 'class-name': { + pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/, + lookbehind: true, + greedy: true, + }, + keyword: + /\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/, + function: /\b[a-z_]\w*(?=\s*\()/i, + + number: [ + { + pattern: + /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i, + lookbehind: true, + }, + /-?\b(?:Infinity|NaN)\b/, + ], + + operator: /=/, + punctuation: /[()\[\]{}<>.:,;-]/, +}; + +Prism.languages.avdl = Prism.languages['avro-idl']; diff --git a/public/prism/prism-avro-idl.min.js b/public/prism/prism-avro-idl.min.js new file mode 100644 index 0000000..540edd7 --- /dev/null +++ b/public/prism/prism-avro-idl.min.js @@ -0,0 +1,38 @@ +(Prism.languages['avro-idl'] = { + comment: { pattern: /\/\/.*|\/\*[\s\S]*?\*\//, greedy: !0 }, + string: { + pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/, + lookbehind: !0, + greedy: !0, + }, + annotation: { + pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/, + greedy: !0, + alias: 'function', + }, + 'function-identifier': { + pattern: /`[^\r\n`]+`(?=\s*\()/, + greedy: !0, + alias: 'function', + }, + identifier: { pattern: /`[^\r\n`]+`/, greedy: !0 }, + 'class-name': { + pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/, + lookbehind: !0, + greedy: !0, + }, + keyword: + /\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/, + function: /\b[a-z_]\w*(?=\s*\()/i, + number: [ + { + pattern: + /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i, + lookbehind: !0, + }, + /-?\b(?:Infinity|NaN)\b/, + ], + operator: /=/, + punctuation: /[()\[\]{}<>.:,;-]/, +}), + (Prism.languages.avdl = Prism.languages['avro-idl']); diff --git a/public/prism/prism-bash.js b/public/prism/prism-bash.js new file mode 100644 index 0000000..167d193 --- /dev/null +++ b/public/prism/prism-bash.js @@ -0,0 +1,234 @@ +(function (Prism) { + // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|' + // + LC_ALL, RANDOM, REPLY, SECONDS. + // + make sure PS1..4 are here as they are not always set, + // - some useless things. + var envVars = + '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b'; + + var commandAfterHeredoc = { + pattern: /(^(["']?)\w+\2)[ \t]+\S.*/, + lookbehind: true, + alias: 'punctuation', // this looks reasonably well in all themes + inside: null, // see below + }; + + var insideString = { + bash: commandAfterHeredoc, + environment: { + pattern: RegExp('\\$' + envVars), + alias: 'constant', + }, + variable: [ + // [0]: Arithmetic Environment + { + pattern: /\$?\(\([\s\S]+?\)\)/, + greedy: true, + inside: { + // If there is a $ sign at the beginning highlight $(( and )) as variable + variable: [ + { + pattern: /(^\$\(\([\s\S]+)\)\)/, + lookbehind: true, + }, + /^\$\(\(/, + ], + number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, + // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic + operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/, + // If there is no $ sign at the beginning highlight (( and )) as punctuation + punctuation: /\(\(?|\)\)?|,|;/, + }, + }, + // [1]: Command Substitution + { + pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/, + greedy: true, + inside: { + variable: /^\$\(|^`|\)$|`$/, + }, + }, + // [2]: Brace expansion + { + pattern: /\$\{[^}]+\}/, + greedy: true, + inside: { + operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/, + punctuation: /[\[\]]/, + environment: { + pattern: RegExp('(\\{)' + envVars), + lookbehind: true, + alias: 'constant', + }, + }, + }, + /\$(?:\w+|[#?*!@$])/, + ], + // Escape sequences from echo and printf's manuals, and escaped quotes. + entity: + /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/, + }; + + Prism.languages.bash = { + shebang: { + pattern: /^#!\s*\/.*/, + alias: 'important', + }, + comment: { + pattern: /(^|[^"{\\$])#.*/, + lookbehind: true, + }, + 'function-name': [ + // a) function foo { + // b) foo() { + // c) function foo() { + // but not “foo {” + { + // a) and c) + pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/, + lookbehind: true, + alias: 'function', + }, + { + // b) + pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/, + alias: 'function', + }, + ], + // Highlight variable names as variables in for and select beginnings. + 'for-or-select': { + pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/, + alias: 'variable', + lookbehind: true, + }, + // Highlight variable names as variables in the left-hand part + // of assignments (“=” and “+=”). + 'assign-left': { + pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/, + inside: { + environment: { + pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars), + lookbehind: true, + alias: 'constant', + }, + }, + alias: 'variable', + lookbehind: true, + }, + string: [ + // Support for Here-documents https://en.wikipedia.org/wiki/Here_document + { + pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\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[\s\S]*?(?:\r?\n|\r)\3/, + lookbehind: true, + greedy: true, + inside: { + bash: commandAfterHeredoc, + }, + }, + // “Normal” string + { + // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html + pattern: + /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/, + lookbehind: true, + greedy: true, + inside: insideString, + }, + { + // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html + pattern: /(^|[^$\\])'[^']*'/, + lookbehind: true, + greedy: true, + }, + { + // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html + pattern: /\$'(?:[^'\\]|\\[\s\S])*'/, + greedy: true, + inside: { + entity: insideString.entity, + }, + }, + ], + environment: { + pattern: RegExp('\\$?' + envVars), + alias: 'constant', + }, + variable: insideString.variable, + function: { + pattern: + /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, + lookbehind: true, + }, + keyword: { + pattern: + /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/, + lookbehind: true, + }, + // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html + builtin: { + pattern: + /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/, + lookbehind: true, + // Alias added to make those easier to distinguish from strings. + alias: 'class-name', + }, + boolean: { + pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/, + lookbehind: true, + }, + 'file-descriptor': { + pattern: /\B&\d\b/, + alias: 'important', + }, + operator: { + // Lots of redirections here, but not just that. + pattern: + /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/, + inside: { + 'file-descriptor': { + pattern: /^\d/, + alias: 'important', + }, + }, + }, + punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, + number: { + pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, + lookbehind: true, + }, + }; + + commandAfterHeredoc.inside = Prism.languages.bash; + + /* Patterns in command substitution. */ + var toBeCopied = [ + 'comment', + 'function-name', + 'for-or-select', + 'assign-left', + 'string', + 'environment', + 'function', + 'keyword', + 'builtin', + 'boolean', + 'file-descriptor', + 'operator', + 'punctuation', + 'number', + ]; + var inside = insideString.variable[1].inside; + for (var i = 0; i < toBeCopied.length; i++) { + inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]]; + } + + Prism.languages.shell = Prism.languages.bash; +})(Prism); diff --git a/public/prism/prism-bash.min.js b/public/prism/prism-bash.min.js new file mode 100644 index 0000000..970494f --- /dev/null +++ b/public/prism/prism-bash.min.js @@ -0,0 +1,163 @@ +!(function (e) { + var t = + '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b', + n = { + pattern: /(^(["']?)\w+\2)[ \t]+\S.*/, + lookbehind: !0, + alias: 'punctuation', + inside: null, + }, + a = { + bash: n, + environment: { pattern: RegExp('\\$' + t), alias: 'constant' }, + variable: [ + { + pattern: /\$?\(\([\s\S]+?\)\)/, + greedy: !0, + inside: { + variable: [ + { pattern: /(^\$\(\([\s\S]+)\)\)/, lookbehind: !0 }, + /^\$\(\(/, + ], + number: + /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, + operator: + /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/, + punctuation: /\(\(?|\)\)?|,|;/, + }, + }, + { + pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/, + greedy: !0, + inside: { variable: /^\$\(|^`|\)$|`$/ }, + }, + { + pattern: /\$\{[^}]+\}/, + greedy: !0, + inside: { + operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/, + punctuation: /[\[\]]/, + environment: { + pattern: RegExp('(\\{)' + t), + lookbehind: !0, + alias: 'constant', + }, + }, + }, + /\$(?:\w+|[#?*!@$])/, + ], + entity: + /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/, + }; + (e.languages.bash = { + shebang: { pattern: /^#!\s*\/.*/, alias: 'important' }, + comment: { pattern: /(^|[^"{\\$])#.*/, lookbehind: !0 }, + 'function-name': [ + { + pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/, + lookbehind: !0, + alias: 'function', + }, + { pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/, alias: 'function' }, + ], + 'for-or-select': { + pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/, + alias: 'variable', + lookbehind: !0, + }, + 'assign-left': { + pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/, + inside: { + environment: { + pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + t), + lookbehind: !0, + alias: 'constant', + }, + }, + alias: 'variable', + lookbehind: !0, + }, + string: [ + { + pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/, + lookbehind: !0, + greedy: !0, + inside: a, + }, + { + pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/, + lookbehind: !0, + greedy: !0, + inside: { bash: n }, + }, + { + pattern: + /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/, + lookbehind: !0, + greedy: !0, + inside: a, + }, + { pattern: /(^|[^$\\])'[^']*'/, lookbehind: !0, greedy: !0 }, + { + pattern: /\$'(?:[^'\\]|\\[\s\S])*'/, + greedy: !0, + inside: { entity: a.entity }, + }, + ], + environment: { pattern: RegExp('\\$?' + t), alias: 'constant' }, + variable: a.variable, + function: { + pattern: + /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, + lookbehind: !0, + }, + keyword: { + pattern: + /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/, + lookbehind: !0, + }, + builtin: { + pattern: + /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/, + lookbehind: !0, + alias: 'class-name', + }, + boolean: { + pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/, + lookbehind: !0, + }, + 'file-descriptor': { pattern: /\B&\d\b/, alias: 'important' }, + operator: { + pattern: + /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/, + inside: { 'file-descriptor': { pattern: /^\d/, alias: 'important' } }, + }, + punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, + number: { pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, lookbehind: !0 }, + }), + (n.inside = e.languages.bash); + for ( + var s = [ + 'comment', + 'function-name', + 'for-or-select', + 'assign-left', + 'string', + 'environment', + 'function', + 'keyword', + 'builtin', + 'boolean', + 'file-descriptor', + 'operator', + 'punctuation', + 'number', + ], + o = a.variable[1].inside, + i = 0; + i < s.length; + i++ + ) + o[s[i]] = e.languages.bash[s[i]]; + e.languages.shell = e.languages.bash; +})(Prism); diff --git a/public/prism/prism-basic.js b/public/prism/prism-basic.js new file mode 100644 index 0000000..01b8a4c --- /dev/null +++ b/public/prism/prism-basic.js @@ -0,0 +1,19 @@ +Prism.languages.basic = { + comment: { + pattern: /(?:!|REM\b).+/i, + inside: { + keyword: /^REM/i, + }, + }, + string: { + pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/, + greedy: true, + }, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + keyword: + /\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i, + function: + /\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i, + operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i, + punctuation: /[,;:()]/, +}; diff --git a/public/prism/prism-basic.min.js b/public/prism/prism-basic.min.js new file mode 100644 index 0000000..86c9354 --- /dev/null +++ b/public/prism/prism-basic.min.js @@ -0,0 +1,11 @@ +Prism.languages.basic = { + comment: { pattern: /(?:!|REM\b).+/i, inside: { keyword: /^REM/i } }, + string: { pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/, greedy: !0 }, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + keyword: + /\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i, + function: + /\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i, + operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i, + punctuation: /[,;:()]/, +}; diff --git a/public/prism/prism-batch.js b/public/prism/prism-batch.js new file mode 100644 index 0000000..02b9634 --- /dev/null +++ b/public/prism/prism-batch.js @@ -0,0 +1,100 @@ +(function (Prism) { + var variable = /%%?[~:\w]+%?|!\S+!/; + var parameter = { + pattern: /\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im, + alias: 'attr-name', + inside: { + punctuation: /:/, + }, + }; + var string = /"(?:[\\"]"|[^"])*"(?!")/; + var number = /(?:\b|-)\d+\b/; + + Prism.languages.batch = { + comment: [ + /^::.*/m, + { + pattern: /((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, + lookbehind: true, + }, + ], + label: { + pattern: /^:.*/m, + alias: 'property', + }, + command: [ + { + // FOR command + pattern: + /((?:^|[&(])[ \t]*)for(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* \S+ in \([^)]+\) do/im, + lookbehind: true, + inside: { + keyword: /\b(?:do|in)\b|^for\b/i, + string: string, + parameter: parameter, + variable: variable, + number: number, + punctuation: /[()',]/, + }, + }, + { + // IF command + pattern: + /((?:^|[&(])[ \t]*)if(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|(?!")(?:(?!==)\S)+)?(?:==| (?:equ|geq|gtr|leq|lss|neq) )(?:"[^"]*"|[^\s"]\S*))/im, + lookbehind: true, + inside: { + keyword: /\b(?:cmdextversion|defined|errorlevel|exist|not)\b|^if\b/i, + string: string, + parameter: parameter, + variable: variable, + number: number, + operator: /\^|==|\b(?:equ|geq|gtr|leq|lss|neq)\b/i, + }, + }, + { + // ELSE command + pattern: /((?:^|[&()])[ \t]*)else\b/im, + lookbehind: true, + inside: { + keyword: /^else\b/i, + }, + }, + { + // SET command + pattern: + /((?:^|[&(])[ \t]*)set(?: \/[a-z](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, + lookbehind: true, + inside: { + keyword: /^set\b/i, + string: string, + parameter: parameter, + variable: [variable, /\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/], + number: number, + operator: /[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/, + punctuation: /[()',]/, + }, + }, + { + // Other commands + pattern: + /((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/m, + lookbehind: true, + inside: { + keyword: /^\w+\b/, + string: string, + parameter: parameter, + label: { + pattern: /(^\s*):\S+/m, + lookbehind: true, + alias: 'property', + }, + variable: variable, + number: number, + operator: /\^/, + }, + }, + ], + operator: /[&@]/, + punctuation: /[()']/, + }; +})(Prism); diff --git a/public/prism/prism-batch.min.js b/public/prism/prism-batch.min.js new file mode 100644 index 0000000..b3d691a --- /dev/null +++ b/public/prism/prism-batch.min.js @@ -0,0 +1,83 @@ +!(function (e) { + var r = /%%?[~:\w]+%?|!\S+!/, + t = { + pattern: /\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im, + alias: 'attr-name', + inside: { punctuation: /:/ }, + }, + n = /"(?:[\\"]"|[^"])*"(?!")/, + i = /(?:\b|-)\d+\b/; + Prism.languages.batch = { + comment: [ + /^::.*/m, + { + pattern: /((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, + lookbehind: !0, + }, + ], + label: { pattern: /^:.*/m, alias: 'property' }, + command: [ + { + pattern: + /((?:^|[&(])[ \t]*)for(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* \S+ in \([^)]+\) do/im, + lookbehind: !0, + inside: { + keyword: /\b(?:do|in)\b|^for\b/i, + string: n, + parameter: t, + variable: r, + number: i, + punctuation: /[()',]/, + }, + }, + { + pattern: + /((?:^|[&(])[ \t]*)if(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|(?!")(?:(?!==)\S)+)?(?:==| (?:equ|geq|gtr|leq|lss|neq) )(?:"[^"]*"|[^\s"]\S*))/im, + lookbehind: !0, + inside: { + keyword: /\b(?:cmdextversion|defined|errorlevel|exist|not)\b|^if\b/i, + string: n, + parameter: t, + variable: r, + number: i, + operator: /\^|==|\b(?:equ|geq|gtr|leq|lss|neq)\b/i, + }, + }, + { + pattern: /((?:^|[&()])[ \t]*)else\b/im, + lookbehind: !0, + inside: { keyword: /^else\b/i }, + }, + { + pattern: + /((?:^|[&(])[ \t]*)set(?: \/[a-z](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, + lookbehind: !0, + inside: { + keyword: /^set\b/i, + string: n, + parameter: t, + variable: [r, /\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/], + number: i, + operator: /[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/, + punctuation: /[()',]/, + }, + }, + { + pattern: + /((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/m, + lookbehind: !0, + inside: { + keyword: /^\w+\b/, + string: n, + parameter: t, + label: { pattern: /(^\s*):\S+/m, lookbehind: !0, alias: 'property' }, + variable: r, + number: i, + operator: /\^/, + }, + }, + ], + operator: /[&@]/, + punctuation: /[()']/, + }; +})(); diff --git a/public/prism/prism-bbcode.js b/public/prism/prism-bbcode.js new file mode 100644 index 0000000..836956e --- /dev/null +++ b/public/prism/prism-bbcode.js @@ -0,0 +1,30 @@ +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'"\]=]+)/, + inside: { + punctuation: [ + /^=/, + { + pattern: /^(\s*)["']|["']$/, + lookbehind: true, + }, + ], + }, + }, + punctuation: /\]/, + 'attr-name': /[^\s=\]]+/, + }, + }, +}; + +Prism.languages.shortcode = Prism.languages.bbcode; diff --git a/public/prism/prism-bbcode.min.js b/public/prism/prism-bbcode.min.js new file mode 100644 index 0000000..fc2c7a8 --- /dev/null +++ b/public/prism/prism-bbcode.min.js @@ -0,0 +1,18 @@ +(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'"\]=]+)/, + inside: { + punctuation: [/^=/, { pattern: /^(\s*)["']|["']$/, lookbehind: !0 }], + }, + }, + punctuation: /\]/, + 'attr-name': /[^\s=\]]+/, + }, + }, +}), + (Prism.languages.shortcode = Prism.languages.bbcode); diff --git a/public/prism/prism-bicep.js b/public/prism/prism-bicep.js new file mode 100644 index 0000000..f601ce4 --- /dev/null +++ b/public/prism/prism-bicep.js @@ -0,0 +1,81 @@ +// based loosely upon: https://github.com/Azure/bicep/blob/main/src/textmate/bicep.tmlanguage +Prism.languages.bicep = { + comment: [ + { + // multiline comments eg /* ASDF */ + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true, + greedy: true, + }, + { + // singleline comments eg // ASDF + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true, + }, + ], + + property: [ + { + pattern: /([\r\n][ \t]*)[a-z_]\w*(?=[ \t]*:)/i, + lookbehind: true, + }, + { + pattern: /([\r\n][ \t]*)'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'(?=[ \t]*:)/, + lookbehind: true, + greedy: true, + }, + ], + string: [ + { + pattern: /'''[^'][\s\S]*?'''/, + greedy: true, + }, + { + pattern: /(^|[^\\'])'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'/, + lookbehind: true, + greedy: true, + }, + ], + 'interpolated-string': { + pattern: /(^|[^\\'])'(?:\\.|\$(?:(?!\{)|\{[^{}\r\n]*\})|[^'\\\r\n$])*'/, + lookbehind: true, + greedy: true, + inside: { + interpolation: { + pattern: /\$\{[^{}\r\n]*\}/, + inside: { + expression: { + pattern: /(^\$\{)[\s\S]+(?=\}$)/, + lookbehind: true, + }, + punctuation: /^\$\{|\}$/, + }, + }, + string: /[\s\S]+/, + }, + }, + + datatype: { + pattern: /(\b(?:output|param)\b[ \t]+\w+[ \t]+)\w+\b/, + lookbehind: true, + alias: 'class-name', + }, + + boolean: /\b(?:false|true)\b/, + // https://github.com/Azure/bicep/blob/114a3251b4e6e30082a58729f19a8cc4e374ffa6/src/textmate/bicep.tmlanguage#L184 + keyword: + /\b(?:existing|for|if|in|module|null|output|param|resource|targetScope|var)\b/, + + decorator: /@\w+\b/, + function: /\b[a-z_]\w*(?=[ \t]*\()/i, + + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + operator: + /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/, + punctuation: /[{}[\];(),.:]/, +}; + +Prism.languages.bicep['interpolated-string'].inside['interpolation'].inside[ + 'expression' +].inside = Prism.languages.bicep; diff --git a/public/prism/prism-bicep.min.js b/public/prism/prism-bicep.min.js new file mode 100644 index 0000000..980ee93 --- /dev/null +++ b/public/prism/prism-bicep.min.js @@ -0,0 +1,54 @@ +(Prism.languages.bicep = { + comment: [ + { pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, + { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }, + ], + property: [ + { pattern: /([\r\n][ \t]*)[a-z_]\w*(?=[ \t]*:)/i, lookbehind: !0 }, + { + pattern: /([\r\n][ \t]*)'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'(?=[ \t]*:)/, + lookbehind: !0, + greedy: !0, + }, + ], + string: [ + { pattern: /'''[^'][\s\S]*?'''/, greedy: !0 }, + { + pattern: /(^|[^\\'])'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'/, + lookbehind: !0, + greedy: !0, + }, + ], + 'interpolated-string': { + pattern: /(^|[^\\'])'(?:\\.|\$(?:(?!\{)|\{[^{}\r\n]*\})|[^'\\\r\n$])*'/, + lookbehind: !0, + greedy: !0, + inside: { + interpolation: { + pattern: /\$\{[^{}\r\n]*\}/, + inside: { + expression: { pattern: /(^\$\{)[\s\S]+(?=\}$)/, lookbehind: !0 }, + punctuation: /^\$\{|\}$/, + }, + }, + string: /[\s\S]+/, + }, + }, + datatype: { + pattern: /(\b(?:output|param)\b[ \t]+\w+[ \t]+)\w+\b/, + lookbehind: !0, + alias: 'class-name', + }, + boolean: /\b(?:false|true)\b/, + keyword: + /\b(?:existing|for|if|in|module|null|output|param|resource|targetScope|var)\b/, + decorator: /@\w+\b/, + function: /\b[a-z_]\w*(?=[ \t]*\()/i, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + operator: + /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/, + punctuation: /[{}[\];(),.:]/, +}), + (Prism.languages.bicep[ + 'interpolated-string' + ].inside.interpolation.inside.expression.inside = Prism.languages.bicep); diff --git a/public/prism/prism-birb.js b/public/prism/prism-birb.js new file mode 100644 index 0000000..d0d6919 --- /dev/null +++ b/public/prism/prism-birb.js @@ -0,0 +1,24 @@ +Prism.languages.birb = Prism.languages.extend('clike', { + string: { + pattern: /r?("|')(?:\\.|(?!\1)[^\\])*\1/, + greedy: true, + }, + 'class-name': [ + /\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/, + + // matches variable and function return types (parameters as well). + /\b(?:[A-Z]\w*|(?!(?:var|void)\b)[a-z]\w*)(?=\s+\w+\s*[;,=()])/, + ], + keyword: + /\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|new|next|noSeeb|return|static|switch|throw|var|void|while)\b/, + operator: /\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/, + variable: /\b[a-z_]\w*\b/, +}); + +Prism.languages.insertBefore('birb', 'function', { + metadata: { + pattern: /<\w+>/, + greedy: true, + alias: 'symbol', + }, +}); diff --git a/public/prism/prism-birb.min.js b/public/prism/prism-birb.min.js new file mode 100644 index 0000000..1b39b91 --- /dev/null +++ b/public/prism/prism-birb.min.js @@ -0,0 +1,14 @@ +(Prism.languages.birb = Prism.languages.extend('clike', { + string: { pattern: /r?("|')(?:\\.|(?!\1)[^\\])*\1/, greedy: !0 }, + 'class-name': [ + /\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/, + /\b(?:[A-Z]\w*|(?!(?:var|void)\b)[a-z]\w*)(?=\s+\w+\s*[;,=()])/, + ], + keyword: + /\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|new|next|noSeeb|return|static|switch|throw|var|void|while)\b/, + operator: /\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/, + variable: /\b[a-z_]\w*\b/, +})), + Prism.languages.insertBefore('birb', 'function', { + metadata: { pattern: /<\w+>/, greedy: !0, alias: 'symbol' }, + }); diff --git a/public/prism/prism-bison.js b/public/prism/prism-bison.js new file mode 100644 index 0000000..2d150f1 --- /dev/null +++ b/public/prism/prism-bison.js @@ -0,0 +1,39 @@ +Prism.languages.bison = Prism.languages.extend('c', {}); + +Prism.languages.insertBefore('bison', 'comment', { + bison: { + // This should match all the beginning of the file + // including the prologue(s), the bison declarations and + // the grammar rules. + pattern: /^(?:[^%]|%(?!%))*%%[\s\S]*?%%/, + inside: { + c: { + // Allow for one level of nested braces + pattern: /%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/, + inside: { + delimiter: { + pattern: /^%?\{|%?\}$/, + alias: 'punctuation', + }, + 'bison-variable': { + pattern: /[$@](?:<[^\s>]+>)?[\w$]+/, + alias: 'variable', + inside: { + punctuation: /<|>/, + }, + }, + rest: Prism.languages.c, + }, + }, + comment: Prism.languages.c.comment, + string: Prism.languages.c.string, + property: /\S+(?=:)/, + keyword: /%\w+/, + number: { + pattern: /(^|[^@])\b(?:0x[\da-f]+|\d+)/i, + lookbehind: true, + }, + punctuation: /%[%?]|[|:;\[\]<>]/, + }, + }, +}); diff --git a/public/prism/prism-bison.min.js b/public/prism/prism-bison.min.js new file mode 100644 index 0000000..0b35fc5 --- /dev/null +++ b/public/prism/prism-bison.min.js @@ -0,0 +1,26 @@ +(Prism.languages.bison = Prism.languages.extend('c', {})), + Prism.languages.insertBefore('bison', 'comment', { + bison: { + pattern: /^(?:[^%]|%(?!%))*%%[\s\S]*?%%/, + inside: { + c: { + pattern: /%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/, + inside: { + delimiter: { pattern: /^%?\{|%?\}$/, alias: 'punctuation' }, + 'bison-variable': { + pattern: /[$@](?:<[^\s>]+>)?[\w$]+/, + alias: 'variable', + inside: { punctuation: /<|>/ }, + }, + rest: Prism.languages.c, + }, + }, + comment: Prism.languages.c.comment, + string: Prism.languages.c.string, + property: /\S+(?=:)/, + keyword: /%\w+/, + number: { pattern: /(^|[^@])\b(?:0x[\da-f]+|\d+)/i, lookbehind: !0 }, + punctuation: /%[%?]|[|:;\[\]<>]/, + }, + }, + }); diff --git a/public/prism/prism-bnf.js b/public/prism/prism-bnf.js new file mode 100644 index 0000000..873c277 --- /dev/null +++ b/public/prism/prism-bnf.js @@ -0,0 +1,21 @@ +Prism.languages.bnf = { + string: { + pattern: /"[^\r\n"]*"|'[^\r\n']*'/, + }, + definition: { + pattern: /<[^<>\r\n\t]+>(?=\s*::=)/, + alias: ['rule', 'keyword'], + inside: { + punctuation: /^<|>$/, + }, + }, + rule: { + pattern: /<[^<>\r\n\t]+>/, + inside: { + punctuation: /^<|>$/, + }, + }, + operator: /::=|[|()[\]{}*+?]|\.{3}/, +}; + +Prism.languages.rbnf = Prism.languages.bnf; diff --git a/public/prism/prism-bnf.min.js b/public/prism/prism-bnf.min.js new file mode 100644 index 0000000..a3e7b81 --- /dev/null +++ b/public/prism/prism-bnf.min.js @@ -0,0 +1,11 @@ +(Prism.languages.bnf = { + string: { pattern: /"[^\r\n"]*"|'[^\r\n']*'/ }, + definition: { + pattern: /<[^<>\r\n\t]+>(?=\s*::=)/, + alias: ['rule', 'keyword'], + inside: { punctuation: /^<|>$/ }, + }, + rule: { pattern: /<[^<>\r\n\t]+>/, inside: { punctuation: /^<|>$/ } }, + operator: /::=|[|()[\]{}*+?]|\.{3}/, +}), + (Prism.languages.rbnf = Prism.languages.bnf); diff --git a/public/prism/prism-brainfuck.js b/public/prism/prism-brainfuck.js new file mode 100644 index 0000000..0277e79 --- /dev/null +++ b/public/prism/prism-brainfuck.js @@ -0,0 +1,20 @@ +Prism.languages.brainfuck = { + pointer: { + pattern: /<|>/, + alias: 'keyword', + }, + increment: { + pattern: /\+/, + alias: 'inserted', + }, + decrement: { + pattern: /-/, + alias: 'deleted', + }, + branching: { + pattern: /\[|\]/, + alias: 'important', + }, + operator: /[.,]/, + comment: /\S+/, +}; diff --git a/public/prism/prism-brainfuck.min.js b/public/prism/prism-brainfuck.min.js new file mode 100644 index 0000000..d2245e7 --- /dev/null +++ b/public/prism/prism-brainfuck.min.js @@ -0,0 +1,8 @@ +Prism.languages.brainfuck = { + pointer: { pattern: /<|>/, alias: 'keyword' }, + increment: { pattern: /\+/, alias: 'inserted' }, + decrement: { pattern: /-/, alias: 'deleted' }, + branching: { pattern: /\[|\]/, alias: 'important' }, + operator: /[.,]/, + comment: /\S+/, +}; diff --git a/public/prism/prism-brightscript.js b/public/prism/prism-brightscript.js new file mode 100644 index 0000000..7248374 --- /dev/null +++ b/public/prism/prism-brightscript.js @@ -0,0 +1,46 @@ +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(?:false|true)\b/i, + function: /\b(?!\d)\w+(?=[\t ]*\()/, + 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; diff --git a/public/prism/prism-brightscript.min.js b/public/prism/prism-brightscript.min.js new file mode 100644 index 0000000..38e8162 --- /dev/null +++ b/public/prism/prism-brightscript.min.js @@ -0,0 +1,34 @@ +(Prism.languages.brightscript = { + comment: /(?:\brem|').*/i, + 'directive-statement': { + pattern: /(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im, + lookbehind: !0, + alias: 'property', + inside: { + 'error-message': { pattern: /(^#error).+/, lookbehind: !0 }, + directive: { + pattern: /^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/, + alias: 'keyword', + }, + expression: { pattern: /[\s\S]+/, inside: null }, + }, + }, + property: { + pattern: /([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/, + lookbehind: !0, + greedy: !0, + }, + string: { pattern: /"(?:[^"\r\n]|"")*"(?!")/, greedy: !0 }, + 'class-name': { pattern: /(\bAs[\t ]+)\w+/i, lookbehind: !0 }, + 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(?:false|true)\b/i, + function: /\b(?!\d)\w+(?=[\t ]*\()/, + 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); diff --git a/public/prism/prism-bro.js b/public/prism/prism-bro.js new file mode 100644 index 0000000..a369595 --- /dev/null +++ b/public/prism/prism-bro.js @@ -0,0 +1,38 @@ +Prism.languages.bro = { + comment: { + pattern: /(^|[^\\$])#.*/, + lookbehind: true, + inside: { + italic: /\b(?:FIXME|TODO|XXX)\b/, + }, + }, + + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + + boolean: /\b[TF]\b/, + + function: { + pattern: /(\b(?:event|function|hook)[ \t]+)\w+(?:::\w+)?/, + lookbehind: true, + }, + + builtin: + /(?:@(?:load(?:-(?:plugin|sigs))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:add_func|create_expire|default|delete_func|encrypt|error_handler|expire_func|group|log|mergeable|optional|persistent|priority|raw_output|read_expire|redef|rotate_interval|rotate_size|synchronized|type_column|write_expire))/, + + constant: { + pattern: /(\bconst[ \t]+)\w+/i, + lookbehind: true, + }, + + keyword: + /\b(?:add|addr|alarm|any|bool|break|const|continue|count|delete|double|else|enum|event|export|file|for|function|global|hook|if|in|int|interval|local|module|next|of|opaque|pattern|port|print|record|return|schedule|set|string|subnet|table|time|timeout|using|vector|when)\b/, + + operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/, + + number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + + punctuation: /[{}[\];(),.:]/, +}; diff --git a/public/prism/prism-bro.min.js b/public/prism/prism-bro.min.js new file mode 100644 index 0000000..3c550b3 --- /dev/null +++ b/public/prism/prism-bro.min.js @@ -0,0 +1,24 @@ +Prism.languages.bro = { + comment: { + pattern: /(^|[^\\$])#.*/, + lookbehind: !0, + inside: { italic: /\b(?:FIXME|TODO|XXX)\b/ }, + }, + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: !0, + }, + boolean: /\b[TF]\b/, + function: { + pattern: /(\b(?:event|function|hook)[ \t]+)\w+(?:::\w+)?/, + lookbehind: !0, + }, + builtin: + /(?:@(?:load(?:-(?:plugin|sigs))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:add_func|create_expire|default|delete_func|encrypt|error_handler|expire_func|group|log|mergeable|optional|persistent|priority|raw_output|read_expire|redef|rotate_interval|rotate_size|synchronized|type_column|write_expire))/, + constant: { pattern: /(\bconst[ \t]+)\w+/i, lookbehind: !0 }, + keyword: + /\b(?:add|addr|alarm|any|bool|break|const|continue|count|delete|double|else|enum|event|export|file|for|function|global|hook|if|in|int|interval|local|module|next|of|opaque|pattern|port|print|record|return|schedule|set|string|subnet|table|time|timeout|using|vector|when)\b/, + operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/, + number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + punctuation: /[{}[\];(),.:]/, +}; diff --git a/public/prism/prism-bsl.js b/public/prism/prism-bsl.js new file mode 100644 index 0000000..d7367fe --- /dev/null +++ b/public/prism/prism-bsl.js @@ -0,0 +1,79 @@ +/* eslint-disable no-misleading-character-class */ + +// 1C:Enterprise +// https://github.com/Diversus23/ +// +Prism.languages.bsl = { + comment: /\/\/.*/, + string: [ + // Строки + // Strings + { + pattern: /"(?:[^"]|"")*"(?!")/, + greedy: true, + }, + // Дата и время + // Date & time + { + pattern: /'(?:[^'\r\n\\]|\\.)*'/, + }, + ], + keyword: [ + { + // RU + pattern: + /(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i, + lookbehind: true, + }, + { + // EN + pattern: + /\b(?:break|do|each|else|elseif|enddo|endfunction|endif|endprocedure|endtry|except|execute|export|false|for|function|if|in|new|null|procedure|raise|return|then|to|true|try|undefined|val|var|while)\b/i, + }, + ], + number: { + pattern: + /(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?/i, + lookbehind: true, + }, + operator: [ + /[<>+\-*/]=?|[%=]/, + // RU + { + pattern: + /(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i, + lookbehind: true, + }, + // EN + { + pattern: /\b(?:and|not|or)\b/i, + }, + ], + punctuation: /\(\.|\.\)|[()\[\]:;,.]/, + directive: [ + // Теги препроцессора вида &Клиент, &Сервер, ... + // Preprocessor tags of the type &Client, &Server, ... + { + pattern: /^([ \t]*)&.*/m, + lookbehind: true, + greedy: true, + alias: 'important', + }, + // Инструкции препроцессора вида: + // #Если Сервер Тогда + // ... + // #КонецЕсли + // Preprocessor instructions of the form: + // #If Server Then + // ... + // #EndIf + { + pattern: /^([ \t]*)#.*/gm, + lookbehind: true, + greedy: true, + alias: 'important', + }, + ], +}; + +Prism.languages.oscript = Prism.languages['bsl']; diff --git a/public/prism/prism-bsl.min.js b/public/prism/prism-bsl.min.js new file mode 100644 index 0000000..7076214 --- /dev/null +++ b/public/prism/prism-bsl.min.js @@ -0,0 +1,48 @@ +(Prism.languages.bsl = { + comment: /\/\/.*/, + string: [ + { pattern: /"(?:[^"]|"")*"(?!")/, greedy: !0 }, + { pattern: /'(?:[^'\r\n\\]|\\.)*'/ }, + ], + keyword: [ + { + pattern: + /(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i, + lookbehind: !0, + }, + { + pattern: + /\b(?:break|do|each|else|elseif|enddo|endfunction|endif|endprocedure|endtry|except|execute|export|false|for|function|if|in|new|null|procedure|raise|return|then|to|true|try|undefined|val|var|while)\b/i, + }, + ], + number: { + pattern: + /(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?/i, + lookbehind: !0, + }, + operator: [ + /[<>+\-*/]=?|[%=]/, + { + pattern: + /(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i, + lookbehind: !0, + }, + { pattern: /\b(?:and|not|or)\b/i }, + ], + punctuation: /\(\.|\.\)|[()\[\]:;,.]/, + directive: [ + { + pattern: /^([ \t]*)&.*/m, + lookbehind: !0, + greedy: !0, + alias: 'important', + }, + { + pattern: /^([ \t]*)#.*/gm, + lookbehind: !0, + greedy: !0, + alias: 'important', + }, + ], +}), + (Prism.languages.oscript = Prism.languages.bsl); diff --git a/public/prism/prism-c.js b/public/prism/prism-c.js new file mode 100644 index 0000000..39cc673 --- /dev/null +++ b/public/prism/prism-c.js @@ -0,0 +1,86 @@ +Prism.languages.c = Prism.languages.extend('clike', { + comment: { + pattern: + /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: true, + }, + string: { + // https://en.cppreference.com/w/c/language/string_literal + pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, + greedy: true, + }, + 'class-name': { + pattern: + /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/, + lookbehind: true, + }, + keyword: + /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/, + function: /\b[a-z_]\w*(?=\s*\()/i, + number: + /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, + operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, +}); + +Prism.languages.insertBefore('c', 'string', { + char: { + // https://en.cppreference.com/w/c/language/character_constant + pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/, + greedy: true, + }, +}); + +Prism.languages.insertBefore('c', 'string', { + macro: { + // allow for multiline macro definitions + // spaces after the # character compile fine with gcc + pattern: + /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, + lookbehind: true, + greedy: true, + alias: 'property', + inside: { + string: [ + { + // highlight the path of the include statement as a string + pattern: /^(#\s*include\s*)<[^>]+>/, + lookbehind: true, + }, + Prism.languages.c['string'], + ], + char: Prism.languages.c['char'], + comment: Prism.languages.c['comment'], + 'macro-name': [ + { + pattern: /(^#\s*define\s+)\w+\b(?!\()/i, + lookbehind: true, + }, + { + pattern: /(^#\s*define\s+)\w+\b(?=\()/i, + lookbehind: true, + alias: 'function', + }, + ], + // highlight macro directives as keywords + directive: { + pattern: /^(#\s*)[a-z]+/, + lookbehind: true, + alias: 'keyword', + }, + 'directive-hash': /^#/, + punctuation: /##|\\(?=[\r\n])/, + expression: { + pattern: /\S[\s\S]*/, + inside: Prism.languages.c, + }, + }, + }, +}); + +Prism.languages.insertBefore('c', 'function', { + // highlight predefined macros as constants + constant: + /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/, +}); + +delete Prism.languages.c['boolean']; diff --git a/public/prism/prism-c.min.js b/public/prism/prism-c.min.js new file mode 100644 index 0000000..c8e821c --- /dev/null +++ b/public/prism/prism-c.min.js @@ -0,0 +1,60 @@ +(Prism.languages.c = Prism.languages.extend('clike', { + comment: { + pattern: + /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: !0, + }, + string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: !0 }, + 'class-name': { + pattern: + /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/, + lookbehind: !0, + }, + keyword: + /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/, + function: /\b[a-z_]\w*(?=\s*\()/i, + number: + /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, + operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, +})), + Prism.languages.insertBefore('c', 'string', { + char: { pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/, greedy: !0 }, + }), + Prism.languages.insertBefore('c', 'string', { + macro: { + pattern: + /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, + lookbehind: !0, + greedy: !0, + alias: 'property', + inside: { + string: [ + { pattern: /^(#\s*include\s*)<[^>]+>/, lookbehind: !0 }, + Prism.languages.c.string, + ], + char: Prism.languages.c.char, + comment: Prism.languages.c.comment, + 'macro-name': [ + { pattern: /(^#\s*define\s+)\w+\b(?!\()/i, lookbehind: !0 }, + { + pattern: /(^#\s*define\s+)\w+\b(?=\()/i, + lookbehind: !0, + alias: 'function', + }, + ], + directive: { + pattern: /^(#\s*)[a-z]+/, + lookbehind: !0, + alias: 'keyword', + }, + 'directive-hash': /^#/, + punctuation: /##|\\(?=[\r\n])/, + expression: { pattern: /\S[\s\S]*/, inside: Prism.languages.c }, + }, + }, + }), + Prism.languages.insertBefore('c', 'function', { + constant: + /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/, + }), + delete Prism.languages.c.boolean; diff --git a/public/prism/prism-cfscript.js b/public/prism/prism-cfscript.js new file mode 100644 index 0000000..da83537 --- /dev/null +++ b/public/prism/prism-cfscript.js @@ -0,0 +1,48 @@ +// https://cfdocs.org/script +Prism.languages.cfscript = Prism.languages.extend('clike', { + comment: [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true, + inside: { + annotation: { + pattern: /(?:^|[^.])@[\w\.]+/, + alias: 'punctuation', + }, + }, + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true, + }, + ], + keyword: + /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/, + operator: [ + /\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/, + /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/, + ], + scope: { + pattern: + /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/, + alias: 'global', + }, + type: { + pattern: + /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/, + alias: 'builtin', + }, +}); + +Prism.languages.insertBefore('cfscript', 'keyword', { + // This must be declared before keyword because we use "function" inside the lookahead + 'function-variable': { + pattern: + /[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, + alias: 'function', + }, +}); + +delete Prism.languages.cfscript['class-name']; +Prism.languages.cfc = Prism.languages['cfscript']; diff --git a/public/prism/prism-cfscript.min.js b/public/prism/prism-cfscript.min.js new file mode 100644 index 0000000..abeee99 --- /dev/null +++ b/public/prism/prism-cfscript.min.js @@ -0,0 +1,37 @@ +(Prism.languages.cfscript = Prism.languages.extend('clike', { + comment: [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: !0, + inside: { + annotation: { pattern: /(?:^|[^.])@[\w\.]+/, alias: 'punctuation' }, + }, + }, + { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }, + ], + keyword: + /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/, + operator: [ + /\+\+|--|&&|\|\||::|=>|[!=]==|<=?|>=?|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|[?:]/, + /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/, + ], + scope: { + pattern: + /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/, + alias: 'global', + }, + type: { + pattern: + /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/, + alias: 'builtin', + }, +})), + Prism.languages.insertBefore('cfscript', 'keyword', { + 'function-variable': { + pattern: + /[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, + alias: 'function', + }, + }), + delete Prism.languages.cfscript['class-name'], + (Prism.languages.cfc = Prism.languages.cfscript); diff --git a/public/prism/prism-chaiscript.js b/public/prism/prism-chaiscript.js new file mode 100644 index 0000000..731a18f --- /dev/null +++ b/public/prism/prism-chaiscript.js @@ -0,0 +1,61 @@ +Prism.languages.chaiscript = Prism.languages.extend('clike', { + string: { + pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/, + lookbehind: true, + greedy: true, + }, + 'class-name': [ + { + // e.g. class Rectangle { ... } + pattern: /(\bclass\s+)\w+/, + lookbehind: true, + }, + { + // e.g. attr Rectangle::height, def Rectangle::area() { ... } + pattern: /(\b(?:attr|def)\s+)\w+(?=\s*::)/, + lookbehind: true, + }, + ], + keyword: + /\b(?:attr|auto|break|case|catch|class|continue|def|default|else|finally|for|fun|global|if|return|switch|this|try|var|while)\b/, + number: [Prism.languages.cpp.number, /\b(?:Infinity|NaN)\b/], + operator: + />>=?|<<=?|\|\||&&|:[:=]?|--|\+\+|[=!<>+\-*/%|&^]=?|[?~]|`[^`\r\n]{1,4}`/, +}); + +Prism.languages.insertBefore('chaiscript', 'operator', { + 'parameter-type': { + // e.g. def foo(int x, Vector y) {...} + pattern: /([,(]\s*)\w+(?=\s+\w)/, + lookbehind: true, + alias: 'class-name', + }, +}); + +Prism.languages.insertBefore('chaiscript', 'string', { + 'string-interpolation': { + pattern: + /(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/, + lookbehind: true, + greedy: true, + inside: { + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/, + lookbehind: true, + inside: { + 'interpolation-expression': { + pattern: /(^\$\{)[\s\S]+(?=\}$)/, + lookbehind: true, + inside: Prism.languages.chaiscript, + }, + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation', + }, + }, + }, + string: /[\s\S]+/, + }, + }, +}); diff --git a/public/prism/prism-chaiscript.min.js b/public/prism/prism-chaiscript.min.js new file mode 100644 index 0000000..a64400b --- /dev/null +++ b/public/prism/prism-chaiscript.min.js @@ -0,0 +1,50 @@ +(Prism.languages.chaiscript = Prism.languages.extend('clike', { + string: { + pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/, + lookbehind: !0, + greedy: !0, + }, + 'class-name': [ + { pattern: /(\bclass\s+)\w+/, lookbehind: !0 }, + { pattern: /(\b(?:attr|def)\s+)\w+(?=\s*::)/, lookbehind: !0 }, + ], + keyword: + /\b(?:attr|auto|break|case|catch|class|continue|def|default|else|finally|for|fun|global|if|return|switch|this|try|var|while)\b/, + number: [Prism.languages.cpp.number, /\b(?:Infinity|NaN)\b/], + operator: + />>=?|<<=?|\|\||&&|:[:=]?|--|\+\+|[=!<>+\-*/%|&^]=?|[?~]|`[^`\r\n]{1,4}`/, +})), + Prism.languages.insertBefore('chaiscript', 'operator', { + 'parameter-type': { + pattern: /([,(]\s*)\w+(?=\s+\w)/, + lookbehind: !0, + alias: 'class-name', + }, + }), + Prism.languages.insertBefore('chaiscript', 'string', { + 'string-interpolation': { + pattern: + /(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/, + lookbehind: !0, + greedy: !0, + inside: { + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/, + lookbehind: !0, + inside: { + 'interpolation-expression': { + pattern: /(^\$\{)[\s\S]+(?=\}$)/, + lookbehind: !0, + inside: Prism.languages.chaiscript, + }, + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation', + }, + }, + }, + string: /[\s\S]+/, + }, + }, + }); diff --git a/public/prism/prism-cil.js b/public/prism/prism-cil.js new file mode 100644 index 0000000..5e94ac3 --- /dev/null +++ b/public/prism/prism-cil.js @@ -0,0 +1,28 @@ +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|u?int(?:8|16|32|64)?|iant|idispatch|implements|import|initonly|instance|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|no|readonly|tail|unaligned|volatile)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.\d+|\.[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(?:\.\d+|\.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|castclass|ldvirtftn|beq(?:\.s)?|ckfinite|ldsflda|ldtoken|localloc|mkrefany|rethrow|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/, + + boolean: /\b(?:false|true)\b/, + number: /\b-?(?:0x[0-9a-f]+|\d+)(?:\.[0-9a-f]+)?\b/i, + + punctuation: /[{}[\];(),:=]|IL_[0-9A-Za-z]+/, +}; diff --git a/public/prism/prism-cil.min.js b/public/prism/prism-cil.min.js new file mode 100644 index 0000000..7cd74fa --- /dev/null +++ b/public/prism/prism-cil.min.js @@ -0,0 +1,20 @@ +Prism.languages.cil = { + comment: /\/\/.*/, + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: !0, + }, + directive: { + pattern: /(^|\W)\.[a-z]+(?=\s)/, + lookbehind: !0, + alias: 'class-name', + }, + 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|u?int(?:8|16|32|64)?|iant|idispatch|implements|import|initonly|instance|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|no|readonly|tail|unaligned|volatile)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.\d+|\.[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(?:\.\d+|\.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|castclass|ldvirtftn|beq(?:\.s)?|ckfinite|ldsflda|ldtoken|localloc|mkrefany|rethrow|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/, + boolean: /\b(?:false|true)\b/, + number: /\b-?(?:0x[0-9a-f]+|\d+)(?:\.[0-9a-f]+)?\b/i, + punctuation: /[{}[\];(),:=]|IL_[0-9A-Za-z]+/, +}; diff --git a/public/prism/prism-clike.js b/public/prism/prism-clike.js new file mode 100644 index 0000000..e1f4acd --- /dev/null +++ b/public/prism/prism-clike.js @@ -0,0 +1,33 @@ +Prism.languages.clike = { + comment: [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true, + greedy: true, + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true, + }, + ], + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + 'class-name': { + pattern: + /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: true, + inside: { + punctuation: /[.\\]/, + }, + }, + keyword: + /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, + boolean: /\b(?:false|true)\b/, + function: /\b\w+(?=\()/, + number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, + punctuation: /[{}[\];(),.:]/, +}; diff --git a/public/prism/prism-clike.min.js b/public/prism/prism-clike.min.js new file mode 100644 index 0000000..aebeff9 --- /dev/null +++ b/public/prism/prism-clike.min.js @@ -0,0 +1,23 @@ +Prism.languages.clike = { + comment: [ + { pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, + { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }, + ], + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: !0, + }, + 'class-name': { + pattern: + /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: !0, + inside: { punctuation: /[.\\]/ }, + }, + keyword: + /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, + boolean: /\b(?:false|true)\b/, + function: /\b\w+(?=\()/, + number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, + punctuation: /[{}[\];(),.:]/, +}; diff --git a/public/prism/prism-clojure.js b/public/prism/prism-clojure.js new file mode 100644 index 0000000..e1bf1b2 --- /dev/null +++ b/public/prism/prism-clojure.js @@ -0,0 +1,33 @@ +// Copied from https://github.com/jeluard/prism-clojure +Prism.languages.clojure = { + comment: { + pattern: /;.*/, + greedy: true, + }, + string: { + pattern: /"(?:[^"\\]|\\.)*"/, + greedy: true, + }, + char: /\\\w+/, + symbol: { + pattern: /(^|[\s()\[\]{},])::?[\w*+!?'<>=/.-]+/, + lookbehind: true, + }, + keyword: { + pattern: + /(\()(?:-|->|->>|\.|\.\.|\*|\/|\+|<|<=|=|==|>|>=|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|cond|conj|cons|constantly|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|declare|def|def-|definline|definterface|defmacro|defmethod|defmulti|defn|defn-|defonce|defproject|defprotocol|defrecord|defstruct|deftype|deref|difference|disj|dissoc|distinct|do|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|fn|fnseq|for|frest|gensym|get|get-proxy-class|hash-map|hash-set|identical\?|identity|if|if-let|if-not|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|let|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|monitor-enter|name|namespace|neg\?|new|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns|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|quote|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|recur|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|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|throw|time|to-array|to-array-2d|tree-seq|true\?|try|union|up|update-proxy|val|vals|var|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)(?=[\s)]|$)/, + lookbehind: true, + }, + boolean: /\b(?:false|nil|true)\b/, + number: { + pattern: + /(^|[^\w$@])(?:\d+(?:[/.]\d+)?(?:e[+-]?\d+)?|0x[a-f0-9]+|[1-9]\d?r[a-z0-9]+)[lmn]?(?![\w$@])/i, + lookbehind: true, + }, + function: { + pattern: /((?:^|[^'])\()[\w*+!?'<>=/.-]+(?=[\s)]|$)/, + lookbehind: true, + }, + operator: /[#@^`~]/, + punctuation: /[{}\[\](),]/, +}; diff --git a/public/prism/prism-clojure.min.js b/public/prism/prism-clojure.min.js new file mode 100644 index 0000000..aaeee82 --- /dev/null +++ b/public/prism/prism-clojure.min.js @@ -0,0 +1,23 @@ +Prism.languages.clojure = { + comment: { pattern: /;.*/, greedy: !0 }, + string: { pattern: /"(?:[^"\\]|\\.)*"/, greedy: !0 }, + char: /\\\w+/, + symbol: { pattern: /(^|[\s()\[\]{},])::?[\w*+!?'<>=/.-]+/, lookbehind: !0 }, + keyword: { + pattern: + /(\()(?:-|->|->>|\.|\.\.|\*|\/|\+|<|<=|=|==|>|>=|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|cond|conj|cons|constantly|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|declare|def|def-|definline|definterface|defmacro|defmethod|defmulti|defn|defn-|defonce|defproject|defprotocol|defrecord|defstruct|deftype|deref|difference|disj|dissoc|distinct|do|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|fn|fnseq|for|frest|gensym|get|get-proxy-class|hash-map|hash-set|identical\?|identity|if|if-let|if-not|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|let|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|monitor-enter|name|namespace|neg\?|new|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns|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|quote|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|recur|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|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|throw|time|to-array|to-array-2d|tree-seq|true\?|try|union|up|update-proxy|val|vals|var|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)(?=[\s)]|$)/, + lookbehind: !0, + }, + boolean: /\b(?:false|nil|true)\b/, + number: { + pattern: + /(^|[^\w$@])(?:\d+(?:[/.]\d+)?(?:e[+-]?\d+)?|0x[a-f0-9]+|[1-9]\d?r[a-z0-9]+)[lmn]?(?![\w$@])/i, + lookbehind: !0, + }, + function: { + pattern: /((?:^|[^'])\()[\w*+!?'<>=/.-]+(?=[\s)]|$)/, + lookbehind: !0, + }, + operator: /[#@^`~]/, + punctuation: /[{}\[\](),]/, +}; diff --git a/public/prism/prism-cmake.js b/public/prism/prism-cmake.js new file mode 100644 index 0000000..986327f --- /dev/null +++ b/public/prism/prism-cmake.js @@ -0,0 +1,34 @@ +Prism.languages.cmake = { + comment: /#.*/, + string: { + pattern: /"(?:[^\\"]|\\.)*"/, + greedy: true, + inside: { + interpolation: { + pattern: /\$\{(?:[^{}$]|\$\{[^{}$]*\})*\}/, + inside: { + punctuation: /\$\{|\}/, + variable: /\w+/, + }, + }, + }, + }, + variable: + /\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_(?:BINARY_DIR|DESCRIPTION|HOMEPAGE_URL|NAME|SOURCE_DIR|VERSION|VERSION_(?:MAJOR|MINOR|PATCH|TWEAK))|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE|XCODE_VERSION))\b/, + property: + /\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|GLOBAL_KEYWORD|GLOBAL_PROJECT_TYPES|GLOBAL_ROOTNAMESPACE|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/, + keyword: + /\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/, + boolean: /\b(?:FALSE|OFF|ON|TRUE)\b/, + namespace: + /\b(?:INTERFACE|PRIVATE|PROPERTIES|PUBLIC|SHARED|STATIC|TARGET_OBJECTS)\b/, + operator: + /\b(?:AND|DEFINED|EQUAL|GREATER|LESS|MATCHES|NOT|OR|STREQUAL|STRGREATER|STRLESS|VERSION_EQUAL|VERSION_GREATER|VERSION_LESS)\b/, + inserted: { + pattern: /\b\w+::\w+\b/, + alias: 'class-name', + }, + number: /\b\d+(?:\.\d+)*\b/, + function: /\b[a-z_]\w*(?=\s*\()\b/i, + punctuation: /[()>}]|\$[<{]/, +}; diff --git a/public/prism/prism-cmake.min.js b/public/prism/prism-cmake.min.js new file mode 100644 index 0000000..bb0d567 --- /dev/null +++ b/public/prism/prism-cmake.min.js @@ -0,0 +1,28 @@ +Prism.languages.cmake = { + comment: /#.*/, + string: { + pattern: /"(?:[^\\"]|\\.)*"/, + greedy: !0, + inside: { + interpolation: { + pattern: /\$\{(?:[^{}$]|\$\{[^{}$]*\})*\}/, + inside: { punctuation: /\$\{|\}/, variable: /\w+/ }, + }, + }, + }, + variable: + /\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_(?:BINARY_DIR|DESCRIPTION|HOMEPAGE_URL|NAME|SOURCE_DIR|VERSION|VERSION_(?:MAJOR|MINOR|PATCH|TWEAK))|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE|XCODE_VERSION))\b/, + property: + /\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|GLOBAL_KEYWORD|GLOBAL_PROJECT_TYPES|GLOBAL_ROOTNAMESPACE|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/, + keyword: + /\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/, + boolean: /\b(?:FALSE|OFF|ON|TRUE)\b/, + namespace: + /\b(?:INTERFACE|PRIVATE|PROPERTIES|PUBLIC|SHARED|STATIC|TARGET_OBJECTS)\b/, + operator: + /\b(?:AND|DEFINED|EQUAL|GREATER|LESS|MATCHES|NOT|OR|STREQUAL|STRGREATER|STRLESS|VERSION_EQUAL|VERSION_GREATER|VERSION_LESS)\b/, + inserted: { pattern: /\b\w+::\w+\b/, alias: 'class-name' }, + number: /\b\d+(?:\.\d+)*\b/, + function: /\b[a-z_]\w*(?=\s*\()\b/i, + punctuation: /[()>}]|\$[<{]/, +}; diff --git a/public/prism/prism-cobol.js b/public/prism/prism-cobol.js new file mode 100644 index 0000000..3883aef --- /dev/null +++ b/public/prism/prism-cobol.js @@ -0,0 +1,56 @@ +Prism.languages.cobol = { + comment: { + pattern: /\*>.*|(^[ \t]*)\*.*/m, + lookbehind: true, + greedy: true, + }, + string: { + pattern: /[xzgn]?(?:"(?:[^\r\n"]|"")*"(?!")|'(?:[^\r\n']|'')*'(?!'))/i, + greedy: true, + }, + + level: { + pattern: /(^[ \t]*)\d+\b/m, + lookbehind: true, + greedy: true, + alias: 'number', + }, + + 'class-name': { + // https://github.com/antlr/grammars-v4/blob/42edd5b687d183b5fa679e858a82297bd27141e7/cobol85/Cobol85.g4#L1015 + pattern: + /(\bpic(?:ture)?\s+)(?:(?:[-\w$/,:*+<>]|\.(?!\s|$))(?:\(\d+\))?)+/i, + lookbehind: true, + inside: { + number: { + pattern: /(\()\d+/, + lookbehind: true, + }, + punctuation: /[()]/, + }, + }, + + keyword: { + pattern: + /(^|[^\w-])(?:ABORT|ACCEPT|ACCESS|ADD|ADDRESS|ADVANCING|AFTER|ALIGNED|ALL|ALPHABET|ALPHABETIC|ALPHABETIC-LOWER|ALPHABETIC-UPPER|ALPHANUMERIC|ALPHANUMERIC-EDITED|ALSO|ALTER|ALTERNATE|ANY|ARE|AREA|AREAS|AS|ASCENDING|ASCII|ASSIGN|ASSOCIATED-DATA|ASSOCIATED-DATA-LENGTH|AT|ATTRIBUTE|AUTHOR|AUTO|AUTO-SKIP|BACKGROUND-COLOR|BACKGROUND-COLOUR|BASIS|BEEP|BEFORE|BEGINNING|BELL|BINARY|BIT|BLANK|BLINK|BLOCK|BOTTOM|BOUNDS|BY|BYFUNCTION|BYTITLE|CALL|CANCEL|CAPABLE|CCSVERSION|CD|CF|CH|CHAINING|CHANGED|CHANNEL|CHARACTER|CHARACTERS|CLASS|CLASS-ID|CLOCK-UNITS|CLOSE|CLOSE-DISPOSITION|COBOL|CODE|CODE-SET|COL|COLLATING|COLUMN|COM-REG|COMMA|COMMITMENT|COMMON|COMMUNICATION|COMP|COMP-1|COMP-2|COMP-3|COMP-4|COMP-5|COMPUTATIONAL|COMPUTATIONAL-1|COMPUTATIONAL-2|COMPUTATIONAL-3|COMPUTATIONAL-4|COMPUTATIONAL-5|COMPUTE|CONFIGURATION|CONTAINS|CONTENT|CONTINUE|CONTROL|CONTROL-POINT|CONTROLS|CONVENTION|CONVERTING|COPY|CORR|CORRESPONDING|COUNT|CRUNCH|CURRENCY|CURSOR|DATA|DATA-BASE|DATE|DATE-COMPILED|DATE-WRITTEN|DAY|DAY-OF-WEEK|DBCS|DE|DEBUG-CONTENTS|DEBUG-ITEM|DEBUG-LINE|DEBUG-NAME|DEBUG-SUB-1|DEBUG-SUB-2|DEBUG-SUB-3|DEBUGGING|DECIMAL-POINT|DECLARATIVES|DEFAULT|DEFAULT-DISPLAY|DEFINITION|DELETE|DELIMITED|DELIMITER|DEPENDING|DESCENDING|DESTINATION|DETAIL|DFHRESP|DFHVALUE|DISABLE|DISK|DISPLAY|DISPLAY-1|DIVIDE|DIVISION|DONTCARE|DOUBLE|DOWN|DUPLICATES|DYNAMIC|EBCDIC|EGCS|EGI|ELSE|EMI|EMPTY-CHECK|ENABLE|END|END-ACCEPT|END-ADD|END-CALL|END-COMPUTE|END-DELETE|END-DIVIDE|END-EVALUATE|END-IF|END-MULTIPLY|END-OF-PAGE|END-PERFORM|END-READ|END-RECEIVE|END-RETURN|END-REWRITE|END-SEARCH|END-START|END-STRING|END-SUBTRACT|END-UNSTRING|END-WRITE|ENDING|ENTER|ENTRY|ENTRY-PROCEDURE|ENVIRONMENT|EOL|EOP|EOS|ERASE|ERROR|ESCAPE|ESI|EVALUATE|EVENT|EVERY|EXCEPTION|EXCLUSIVE|EXHIBIT|EXIT|EXPORT|EXTEND|EXTENDED|EXTERNAL|FD|FILE|FILE-CONTROL|FILLER|FINAL|FIRST|FOOTING|FOR|FOREGROUND-COLOR|FOREGROUND-COLOUR|FROM|FULL|FUNCTION|FUNCTION-POINTER|FUNCTIONNAME|GENERATE|GIVING|GLOBAL|GO|GOBACK|GRID|GROUP|HEADING|HIGH-VALUE|HIGH-VALUES|HIGHLIGHT|I-O|I-O-CONTROL|ID|IDENTIFICATION|IF|IMPLICIT|IMPORT|IN|INDEX|INDEXED|INDICATE|INITIAL|INITIALIZE|INITIATE|INPUT|INPUT-OUTPUT|INSPECT|INSTALLATION|INTEGER|INTO|INVALID|INVOKE|IS|JUST|JUSTIFIED|KANJI|KEPT|KEY|KEYBOARD|LABEL|LANGUAGE|LAST|LB|LD|LEADING|LEFT|LEFTLINE|LENGTH|LENGTH-CHECK|LIBACCESS|LIBPARAMETER|LIBRARY|LIMIT|LIMITS|LINAGE|LINAGE-COUNTER|LINE|LINE-COUNTER|LINES|LINKAGE|LIST|LOCAL|LOCAL-STORAGE|LOCK|LONG-DATE|LONG-TIME|LOW-VALUE|LOW-VALUES|LOWER|LOWLIGHT|MEMORY|MERGE|MESSAGE|MMDDYYYY|MODE|MODULES|MORE-LABELS|MOVE|MULTIPLE|MULTIPLY|NAMED|NATIONAL|NATIONAL-EDITED|NATIVE|NEGATIVE|NETWORK|NEXT|NO|NO-ECHO|NULL|NULLS|NUMBER|NUMERIC|NUMERIC-DATE|NUMERIC-EDITED|NUMERIC-TIME|OBJECT-COMPUTER|OCCURS|ODT|OF|OFF|OMITTED|ON|OPEN|OPTIONAL|ORDER|ORDERLY|ORGANIZATION|OTHER|OUTPUT|OVERFLOW|OVERLINE|OWN|PACKED-DECIMAL|PADDING|PAGE|PAGE-COUNTER|PASSWORD|PERFORM|PF|PH|PIC|PICTURE|PLUS|POINTER|PORT|POSITION|POSITIVE|PRINTER|PRINTING|PRIVATE|PROCEDURE|PROCEDURE-POINTER|PROCEDURES|PROCEED|PROCESS|PROGRAM|PROGRAM-ID|PROGRAM-LIBRARY|PROMPT|PURGE|QUEUE|QUOTE|QUOTES|RANDOM|RD|READ|READER|REAL|RECEIVE|RECEIVED|RECORD|RECORDING|RECORDS|RECURSIVE|REDEFINES|REEL|REF|REFERENCE|REFERENCES|RELATIVE|RELEASE|REMAINDER|REMARKS|REMOTE|REMOVAL|REMOVE|RENAMES|REPLACE|REPLACING|REPORT|REPORTING|REPORTS|REQUIRED|RERUN|RESERVE|RESET|RETURN|RETURN-CODE|RETURNING|REVERSE-VIDEO|REVERSED|REWIND|REWRITE|RF|RH|RIGHT|ROUNDED|RUN|SAME|SAVE|SCREEN|SD|SEARCH|SECTION|SECURE|SECURITY|SEGMENT|SEGMENT-LIMIT|SELECT|SEND|SENTENCE|SEPARATE|SEQUENCE|SEQUENTIAL|SET|SHARED|SHAREDBYALL|SHAREDBYRUNUNIT|SHARING|SHIFT-IN|SHIFT-OUT|SHORT-DATE|SIGN|SIZE|SORT|SORT-CONTROL|SORT-CORE-SIZE|SORT-FILE-SIZE|SORT-MERGE|SORT-MESSAGE|SORT-MODE-SIZE|SORT-RETURN|SOURCE|SOURCE-COMPUTER|SPACE|SPACES|SPECIAL-NAMES|STANDARD|STANDARD-1|STANDARD-2|START|STATUS|STOP|STRING|SUB-QUEUE-1|SUB-QUEUE-2|SUB-QUEUE-3|SUBTRACT|SUM|SUPPRESS|SYMBOL|SYMBOLIC|SYNC|SYNCHRONIZED|TABLE|TALLY|TALLYING|TAPE|TASK|TERMINAL|TERMINATE|TEST|TEXT|THEN|THREAD|THREAD-LOCAL|THROUGH|THRU|TIME|TIMER|TIMES|TITLE|TO|TODAYS-DATE|TODAYS-NAME|TOP|TRAILING|TRUNCATED|TYPE|TYPEDEF|UNDERLINE|UNIT|UNSTRING|UNTIL|UP|UPON|USAGE|USE|USING|VALUE|VALUES|VARYING|VIRTUAL|WAIT|WHEN|WHEN-COMPILED|WITH|WORDS|WORKING-STORAGE|WRITE|YEAR|YYYYDDD|YYYYMMDD|ZERO-FILL|ZEROES|ZEROS)(?![\w-])/i, + lookbehind: true, + }, + + boolean: { + pattern: /(^|[^\w-])(?:false|true)(?![\w-])/i, + lookbehind: true, + }, + number: { + pattern: + /(^|[^\w-])(?:[+-]?(?:(?:\d+(?:[.,]\d+)?|[.,]\d+)(?:e[+-]?\d+)?|zero))(?![\w-])/i, + lookbehind: true, + }, + operator: [ + /<>|[<>]=?|[=+*/&]/, + { + pattern: /(^|[^\w-])(?:-|and|equal|greater|less|not|or|than)(?![\w-])/i, + lookbehind: true, + }, + ], + punctuation: /[.:,()]/, +}; diff --git a/public/prism/prism-cobol.min.js b/public/prism/prism-cobol.min.js new file mode 100644 index 0000000..6d10b19 --- /dev/null +++ b/public/prism/prism-cobol.min.js @@ -0,0 +1,41 @@ +Prism.languages.cobol = { + comment: { pattern: /\*>.*|(^[ \t]*)\*.*/m, lookbehind: !0, greedy: !0 }, + string: { + pattern: /[xzgn]?(?:"(?:[^\r\n"]|"")*"(?!")|'(?:[^\r\n']|'')*'(?!'))/i, + greedy: !0, + }, + level: { + pattern: /(^[ \t]*)\d+\b/m, + lookbehind: !0, + greedy: !0, + alias: 'number', + }, + 'class-name': { + pattern: + /(\bpic(?:ture)?\s+)(?:(?:[-\w$/,:*+<>]|\.(?!\s|$))(?:\(\d+\))?)+/i, + lookbehind: !0, + inside: { + number: { pattern: /(\()\d+/, lookbehind: !0 }, + punctuation: /[()]/, + }, + }, + keyword: { + pattern: + /(^|[^\w-])(?:ABORT|ACCEPT|ACCESS|ADD|ADDRESS|ADVANCING|AFTER|ALIGNED|ALL|ALPHABET|ALPHABETIC|ALPHABETIC-LOWER|ALPHABETIC-UPPER|ALPHANUMERIC|ALPHANUMERIC-EDITED|ALSO|ALTER|ALTERNATE|ANY|ARE|AREA|AREAS|AS|ASCENDING|ASCII|ASSIGN|ASSOCIATED-DATA|ASSOCIATED-DATA-LENGTH|AT|ATTRIBUTE|AUTHOR|AUTO|AUTO-SKIP|BACKGROUND-COLOR|BACKGROUND-COLOUR|BASIS|BEEP|BEFORE|BEGINNING|BELL|BINARY|BIT|BLANK|BLINK|BLOCK|BOTTOM|BOUNDS|BY|BYFUNCTION|BYTITLE|CALL|CANCEL|CAPABLE|CCSVERSION|CD|CF|CH|CHAINING|CHANGED|CHANNEL|CHARACTER|CHARACTERS|CLASS|CLASS-ID|CLOCK-UNITS|CLOSE|CLOSE-DISPOSITION|COBOL|CODE|CODE-SET|COL|COLLATING|COLUMN|COM-REG|COMMA|COMMITMENT|COMMON|COMMUNICATION|COMP|COMP-1|COMP-2|COMP-3|COMP-4|COMP-5|COMPUTATIONAL|COMPUTATIONAL-1|COMPUTATIONAL-2|COMPUTATIONAL-3|COMPUTATIONAL-4|COMPUTATIONAL-5|COMPUTE|CONFIGURATION|CONTAINS|CONTENT|CONTINUE|CONTROL|CONTROL-POINT|CONTROLS|CONVENTION|CONVERTING|COPY|CORR|CORRESPONDING|COUNT|CRUNCH|CURRENCY|CURSOR|DATA|DATA-BASE|DATE|DATE-COMPILED|DATE-WRITTEN|DAY|DAY-OF-WEEK|DBCS|DE|DEBUG-CONTENTS|DEBUG-ITEM|DEBUG-LINE|DEBUG-NAME|DEBUG-SUB-1|DEBUG-SUB-2|DEBUG-SUB-3|DEBUGGING|DECIMAL-POINT|DECLARATIVES|DEFAULT|DEFAULT-DISPLAY|DEFINITION|DELETE|DELIMITED|DELIMITER|DEPENDING|DESCENDING|DESTINATION|DETAIL|DFHRESP|DFHVALUE|DISABLE|DISK|DISPLAY|DISPLAY-1|DIVIDE|DIVISION|DONTCARE|DOUBLE|DOWN|DUPLICATES|DYNAMIC|EBCDIC|EGCS|EGI|ELSE|EMI|EMPTY-CHECK|ENABLE|END|END-ACCEPT|END-ADD|END-CALL|END-COMPUTE|END-DELETE|END-DIVIDE|END-EVALUATE|END-IF|END-MULTIPLY|END-OF-PAGE|END-PERFORM|END-READ|END-RECEIVE|END-RETURN|END-REWRITE|END-SEARCH|END-START|END-STRING|END-SUBTRACT|END-UNSTRING|END-WRITE|ENDING|ENTER|ENTRY|ENTRY-PROCEDURE|ENVIRONMENT|EOL|EOP|EOS|ERASE|ERROR|ESCAPE|ESI|EVALUATE|EVENT|EVERY|EXCEPTION|EXCLUSIVE|EXHIBIT|EXIT|EXPORT|EXTEND|EXTENDED|EXTERNAL|FD|FILE|FILE-CONTROL|FILLER|FINAL|FIRST|FOOTING|FOR|FOREGROUND-COLOR|FOREGROUND-COLOUR|FROM|FULL|FUNCTION|FUNCTION-POINTER|FUNCTIONNAME|GENERATE|GIVING|GLOBAL|GO|GOBACK|GRID|GROUP|HEADING|HIGH-VALUE|HIGH-VALUES|HIGHLIGHT|I-O|I-O-CONTROL|ID|IDENTIFICATION|IF|IMPLICIT|IMPORT|IN|INDEX|INDEXED|INDICATE|INITIAL|INITIALIZE|INITIATE|INPUT|INPUT-OUTPUT|INSPECT|INSTALLATION|INTEGER|INTO|INVALID|INVOKE|IS|JUST|JUSTIFIED|KANJI|KEPT|KEY|KEYBOARD|LABEL|LANGUAGE|LAST|LB|LD|LEADING|LEFT|LEFTLINE|LENGTH|LENGTH-CHECK|LIBACCESS|LIBPARAMETER|LIBRARY|LIMIT|LIMITS|LINAGE|LINAGE-COUNTER|LINE|LINE-COUNTER|LINES|LINKAGE|LIST|LOCAL|LOCAL-STORAGE|LOCK|LONG-DATE|LONG-TIME|LOW-VALUE|LOW-VALUES|LOWER|LOWLIGHT|MEMORY|MERGE|MESSAGE|MMDDYYYY|MODE|MODULES|MORE-LABELS|MOVE|MULTIPLE|MULTIPLY|NAMED|NATIONAL|NATIONAL-EDITED|NATIVE|NEGATIVE|NETWORK|NEXT|NO|NO-ECHO|NULL|NULLS|NUMBER|NUMERIC|NUMERIC-DATE|NUMERIC-EDITED|NUMERIC-TIME|OBJECT-COMPUTER|OCCURS|ODT|OF|OFF|OMITTED|ON|OPEN|OPTIONAL|ORDER|ORDERLY|ORGANIZATION|OTHER|OUTPUT|OVERFLOW|OVERLINE|OWN|PACKED-DECIMAL|PADDING|PAGE|PAGE-COUNTER|PASSWORD|PERFORM|PF|PH|PIC|PICTURE|PLUS|POINTER|PORT|POSITION|POSITIVE|PRINTER|PRINTING|PRIVATE|PROCEDURE|PROCEDURE-POINTER|PROCEDURES|PROCEED|PROCESS|PROGRAM|PROGRAM-ID|PROGRAM-LIBRARY|PROMPT|PURGE|QUEUE|QUOTE|QUOTES|RANDOM|RD|READ|READER|REAL|RECEIVE|RECEIVED|RECORD|RECORDING|RECORDS|RECURSIVE|REDEFINES|REEL|REF|REFERENCE|REFERENCES|RELATIVE|RELEASE|REMAINDER|REMARKS|REMOTE|REMOVAL|REMOVE|RENAMES|REPLACE|REPLACING|REPORT|REPORTING|REPORTS|REQUIRED|RERUN|RESERVE|RESET|RETURN|RETURN-CODE|RETURNING|REVERSE-VIDEO|REVERSED|REWIND|REWRITE|RF|RH|RIGHT|ROUNDED|RUN|SAME|SAVE|SCREEN|SD|SEARCH|SECTION|SECURE|SECURITY|SEGMENT|SEGMENT-LIMIT|SELECT|SEND|SENTENCE|SEPARATE|SEQUENCE|SEQUENTIAL|SET|SHARED|SHAREDBYALL|SHAREDBYRUNUNIT|SHARING|SHIFT-IN|SHIFT-OUT|SHORT-DATE|SIGN|SIZE|SORT|SORT-CONTROL|SORT-CORE-SIZE|SORT-FILE-SIZE|SORT-MERGE|SORT-MESSAGE|SORT-MODE-SIZE|SORT-RETURN|SOURCE|SOURCE-COMPUTER|SPACE|SPACES|SPECIAL-NAMES|STANDARD|STANDARD-1|STANDARD-2|START|STATUS|STOP|STRING|SUB-QUEUE-1|SUB-QUEUE-2|SUB-QUEUE-3|SUBTRACT|SUM|SUPPRESS|SYMBOL|SYMBOLIC|SYNC|SYNCHRONIZED|TABLE|TALLY|TALLYING|TAPE|TASK|TERMINAL|TERMINATE|TEST|TEXT|THEN|THREAD|THREAD-LOCAL|THROUGH|THRU|TIME|TIMER|TIMES|TITLE|TO|TODAYS-DATE|TODAYS-NAME|TOP|TRAILING|TRUNCATED|TYPE|TYPEDEF|UNDERLINE|UNIT|UNSTRING|UNTIL|UP|UPON|USAGE|USE|USING|VALUE|VALUES|VARYING|VIRTUAL|WAIT|WHEN|WHEN-COMPILED|WITH|WORDS|WORKING-STORAGE|WRITE|YEAR|YYYYDDD|YYYYMMDD|ZERO-FILL|ZEROES|ZEROS)(?![\w-])/i, + lookbehind: !0, + }, + boolean: { pattern: /(^|[^\w-])(?:false|true)(?![\w-])/i, lookbehind: !0 }, + number: { + pattern: + /(^|[^\w-])(?:[+-]?(?:(?:\d+(?:[.,]\d+)?|[.,]\d+)(?:e[+-]?\d+)?|zero))(?![\w-])/i, + lookbehind: !0, + }, + operator: [ + /<>|[<>]=?|[=+*/&]/, + { + pattern: /(^|[^\w-])(?:-|and|equal|greater|less|not|or|than)(?![\w-])/i, + lookbehind: !0, + }, + ], + punctuation: /[.:,()]/, +}; diff --git a/public/prism/prism-coffeescript.js b/public/prism/prism-coffeescript.js new file mode 100644 index 0000000..c1ca019 --- /dev/null +++ b/public/prism/prism-coffeescript.js @@ -0,0 +1,94 @@ +(function (Prism) { + // Ignore comments starting with { to privilege string interpolation highlighting + var comment = /#(?!\{).+/; + var interpolation = { + pattern: /#\{[^}]+\}/, + alias: 'variable', + }; + + Prism.languages.coffeescript = Prism.languages.extend('javascript', { + comment: comment, + string: [ + // Strings are multiline + { + pattern: /'(?:\\[\s\S]|[^\\'])*'/, + greedy: true, + }, + + { + // Strings are multiline + pattern: /"(?:\\[\s\S]|[^\\"])*"/, + greedy: true, + inside: { + interpolation: interpolation, + }, + }, + ], + keyword: + /\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/, + 'class-member': { + pattern: /@(?!\d)\w+/, + alias: 'variable', + }, + }); + + Prism.languages.insertBefore('coffeescript', 'comment', { + 'multiline-comment': { + pattern: /###[\s\S]+?###/, + alias: 'comment', + }, + + // Block regexp can contain comments and interpolation + 'block-regex': { + pattern: /\/{3}[\s\S]*?\/{3}/, + alias: 'regex', + inside: { + comment: comment, + interpolation: interpolation, + }, + }, + }); + + Prism.languages.insertBefore('coffeescript', 'string', { + 'inline-javascript': { + pattern: /`(?:\\[\s\S]|[^\\`])*`/, + inside: { + delimiter: { + pattern: /^`|`$/, + alias: 'punctuation', + }, + script: { + pattern: /[\s\S]+/, + alias: 'language-javascript', + inside: Prism.languages.javascript, + }, + }, + }, + + // Block strings + 'multiline-string': [ + { + pattern: /'''[\s\S]*?'''/, + greedy: true, + alias: 'string', + }, + { + pattern: /"""[\s\S]*?"""/, + greedy: true, + alias: 'string', + inside: { + interpolation: interpolation, + }, + }, + ], + }); + + Prism.languages.insertBefore('coffeescript', 'keyword', { + // Object property + property: /(?!\d)\w+(?=\s*:(?!:))/, + }); + + delete Prism.languages.coffeescript['template-string']; + + Prism.languages.coffee = Prism.languages.coffeescript; +})(Prism); diff --git a/public/prism/prism-coffeescript.min.js b/public/prism/prism-coffeescript.min.js new file mode 100644 index 0000000..c5b53d6 --- /dev/null +++ b/public/prism/prism-coffeescript.min.js @@ -0,0 +1,53 @@ +!(function (e) { + var t = /#(?!\{).+/, + n = { pattern: /#\{[^}]+\}/, alias: 'variable' }; + (e.languages.coffeescript = e.languages.extend('javascript', { + comment: t, + string: [ + { pattern: /'(?:\\[\s\S]|[^\\'])*'/, greedy: !0 }, + { + pattern: /"(?:\\[\s\S]|[^\\"])*"/, + greedy: !0, + inside: { interpolation: n }, + }, + ], + keyword: + /\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/, + 'class-member': { pattern: /@(?!\d)\w+/, alias: 'variable' }, + })), + e.languages.insertBefore('coffeescript', 'comment', { + 'multiline-comment': { pattern: /###[\s\S]+?###/, alias: 'comment' }, + 'block-regex': { + pattern: /\/{3}[\s\S]*?\/{3}/, + alias: 'regex', + inside: { comment: t, interpolation: n }, + }, + }), + e.languages.insertBefore('coffeescript', 'string', { + 'inline-javascript': { + pattern: /`(?:\\[\s\S]|[^\\`])*`/, + inside: { + delimiter: { pattern: /^`|`$/, alias: 'punctuation' }, + script: { + pattern: /[\s\S]+/, + alias: 'language-javascript', + inside: e.languages.javascript, + }, + }, + }, + 'multiline-string': [ + { pattern: /'''[\s\S]*?'''/, greedy: !0, alias: 'string' }, + { + pattern: /"""[\s\S]*?"""/, + greedy: !0, + alias: 'string', + inside: { interpolation: n }, + }, + ], + }), + e.languages.insertBefore('coffeescript', 'keyword', { + property: /(?!\d)\w+(?=\s*:(?!:))/, + }), + delete e.languages.coffeescript['template-string'], + (e.languages.coffee = e.languages.coffeescript); +})(Prism); diff --git a/public/prism/prism-concurnas.js b/public/prism/prism-concurnas.js new file mode 100644 index 0000000..5dab39c --- /dev/null +++ b/public/prism/prism-concurnas.js @@ -0,0 +1,66 @@ +Prism.languages.concurnas = { + comment: { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/, + lookbehind: true, + greedy: true, + }, + langext: { + pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/, + greedy: true, + inside: { + 'class-name': /^\w+/, + string: { + pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/, + lookbehind: true, + }, + punctuation: /\|\|/, + }, + }, + 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', { + 'regex-literal': { + pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + greedy: true, + inside: { + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: true, + inside: Prism.languages.concurnas, + }, + regex: /[\s\S]+/, + }, + }, + 'string-literal': { + pattern: /(?:\B|\bs)("|')(?:\\.|(?!\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; diff --git a/public/prism/prism-concurnas.min.js b/public/prism/prism-concurnas.min.js new file mode 100644 index 0000000..c4e2bdf --- /dev/null +++ b/public/prism/prism-concurnas.min.js @@ -0,0 +1,58 @@ +(Prism.languages.concurnas = { + comment: { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/, + lookbehind: !0, + greedy: !0, + }, + langext: { + pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/, + greedy: !0, + inside: { + 'class-name': /^\w+/, + string: { pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/, lookbehind: !0 }, + punctuation: /\|\|/, + }, + }, + function: { + pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/, + lookbehind: !0, + }, + 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', { + 'regex-literal': { + pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + greedy: !0, + inside: { + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: !0, + inside: Prism.languages.concurnas, + }, + regex: /[\s\S]+/, + }, + }, + 'string-literal': { + pattern: /(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + greedy: !0, + inside: { + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: !0, + inside: Prism.languages.concurnas, + }, + string: /[\s\S]+/, + }, + }, + }), + (Prism.languages.conc = Prism.languages.concurnas); diff --git a/public/prism/prism-coq.js b/public/prism/prism-coq.js new file mode 100644 index 0000000..e1f094e --- /dev/null +++ b/public/prism/prism-coq.js @@ -0,0 +1,62 @@ +(function (Prism) { + // https://github.com/coq/coq + + var commentSource = /\(\*(?:[^(*]|\((?!\*)|\*(?!\))|)*\*\)/.source; + for (var i = 0; i < 2; i++) { + commentSource = commentSource.replace(//g, function () { + return commentSource; + }); + } + commentSource = commentSource.replace(//g, '[]'); + + Prism.languages.coq = { + comment: RegExp(commentSource), + string: { + pattern: /"(?:[^"]|"")*"(?!")/, + greedy: true, + }, + attribute: [ + { + pattern: RegExp( + /#\[(?:[^\[\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|)*\]/.source.replace( + //g, + function () { + return commentSource; + } + ) + ), + greedy: true, + alias: 'attr-name', + inside: { + comment: RegExp(commentSource), + string: { + pattern: /"(?:[^"]|"")*"(?!")/, + greedy: true, + }, + + operator: /=/, + punctuation: /^#\[|\]$|[,()]/, + }, + }, + { + pattern: + /\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/, + alias: 'attr-name', + }, + ], + + keyword: + /\b(?:Abort|About|Add|Admit|Admitted|All|Arguments|As|Assumptions|Axiom|Axioms|Back|BackTo|Backtrace|BinOp|BinOpSpec|BinRel|Bind|Blacklist|Canonical|Case|Cd|Check|Class|Classes|Close|CoFixpoint|CoInductive|Coercion|Coercions|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|Fixpoint|Flags|Focus|From|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|IF|Identity|Immediate|Implicit|Implicits|Import|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|ML|Match|Method|Minimality|Module|Modules|Morphism|Next|NoInline|Notation|Number|OCaml|Obligation|Obligations|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|PropOp|PropUOp|Property|Proposition|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|Require|Reserved|Reset|Resolve|Restart|Rewrite|Right|Ring|Rings|SProp|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|Step|Strategies|Strategy|String|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|UnOp|UnOpSpec|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|Unshelve|Variable|Variables|Variant|Verbose|View|Visibility|Zify|_|apply|as|at|by|cofix|else|end|exists|exists2|fix|for|forall|fun|if|in|let|match|measure|move|removed|return|struct|then|using|wf|where|with)\b/, + + number: + /\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i, + + punct: { + pattern: /@\{|\{\||\[=|:>/, + alias: 'punctuation', + }, + operator: + /\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/, + punctuation: /\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/, + }; +})(Prism); diff --git a/public/prism/prism-coq.min.js b/public/prism/prism-coq.min.js new file mode 100644 index 0000000..84e5fe3 --- /dev/null +++ b/public/prism/prism-coq.min.js @@ -0,0 +1,48 @@ +!(function (e) { + for ( + var t = '\\(\\*(?:[^(*]|\\((?!\\*)|\\*(?!\\))|)*\\*\\)', i = 0; + i < 2; + i++ + ) + t = t.replace(//g, function () { + return t; + }); + (t = t.replace(//g, '[]')), + (e.languages.coq = { + comment: RegExp(t), + string: { pattern: /"(?:[^"]|"")*"(?!")/, greedy: !0 }, + attribute: [ + { + pattern: RegExp( + '#\\[(?:[^\\[\\]("]|"(?:[^"]|"")*"(?!")|\\((?!\\*)|)*\\]'.replace( + //g, + function () { + return t; + } + ) + ), + greedy: !0, + alias: 'attr-name', + inside: { + comment: RegExp(t), + string: { pattern: /"(?:[^"]|"")*"(?!")/, greedy: !0 }, + operator: /=/, + punctuation: /^#\[|\]$|[,()]/, + }, + }, + { + pattern: + /\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/, + alias: 'attr-name', + }, + ], + keyword: + /\b(?:Abort|About|Add|Admit|Admitted|All|Arguments|As|Assumptions|Axiom|Axioms|Back|BackTo|Backtrace|BinOp|BinOpSpec|BinRel|Bind|Blacklist|Canonical|Case|Cd|Check|Class|Classes|Close|CoFixpoint|CoInductive|Coercion|Coercions|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|Fixpoint|Flags|Focus|From|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|IF|Identity|Immediate|Implicit|Implicits|Import|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|ML|Match|Method|Minimality|Module|Modules|Morphism|Next|NoInline|Notation|Number|OCaml|Obligation|Obligations|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|PropOp|PropUOp|Property|Proposition|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|Require|Reserved|Reset|Resolve|Restart|Rewrite|Right|Ring|Rings|SProp|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|Step|Strategies|Strategy|String|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|UnOp|UnOpSpec|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|Unshelve|Variable|Variables|Variant|Verbose|View|Visibility|Zify|_|apply|as|at|by|cofix|else|end|exists|exists2|fix|for|forall|fun|if|in|let|match|measure|move|removed|return|struct|then|using|wf|where|with)\b/, + number: + /\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i, + punct: { pattern: /@\{|\{\||\[=|:>/, alias: 'punctuation' }, + operator: + /\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/, + punctuation: /\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/, + }); +})(Prism); diff --git a/public/prism/prism-cpp.js b/public/prism/prism-cpp.js new file mode 100644 index 0000000..0021d84 --- /dev/null +++ b/public/prism/prism-cpp.js @@ -0,0 +1,122 @@ +(function (Prism) { + var keyword = + /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|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|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/; + var modName = /\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace( + //g, + function () { + return keyword.source; + } + ); + + Prism.languages.cpp = Prism.languages.extend('c', { + 'class-name': [ + { + pattern: RegExp( + /(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace( + //g, + function () { + return keyword.source; + } + ) + ), + lookbehind: true, + }, + // This is intended to capture the class name of method implementations like: + // void foo::bar() const {} + // However! The `foo` in the above example could also be a namespace, so we only capture the class name if + // it starts with an uppercase letter. This approximation should give decent results. + /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, + // This will capture the class name before destructors like: + // Foo::~Foo() {} + /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i, + // This also intends to capture the class name of method implementations but here the class has template + // parameters, so it can't be a namespace (until C++ adds generic namespaces). + /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/, + ], + keyword: keyword, + number: { + pattern: + /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i, + greedy: true, + }, + operator: + />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, + boolean: /\b(?:false|true)\b/, + }); + + Prism.languages.insertBefore('cpp', 'string', { + module: { + // https://en.cppreference.com/w/cpp/language/modules + pattern: RegExp( + /(\b(?:import|module)\s+)/.source + + '(?:' + + // header-name + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + + '|' + + // module name or partition or both + /(?:\s*:\s*)?|:\s*/.source.replace( + //g, + function () { + return modName; + } + ) + + ')' + ), + lookbehind: true, + greedy: true, + inside: { + string: /^[<"][\s\S]+/, + operator: /:/, + punctuation: /\./, + }, + }, + 'raw-string': { + pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, + alias: 'string', + greedy: true, + }, + }); + + Prism.languages.insertBefore('cpp', 'keyword', { + 'generic-function': { + pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i, + inside: { + function: /^\w+/, + generic: { + pattern: /<[\s\S]+/, + alias: 'class-name', + inside: Prism.languages.cpp, + }, + }, + }, + }); + + Prism.languages.insertBefore('cpp', 'operator', { + 'double-colon': { + pattern: /::/, + alias: 'punctuation', + }, + }); + + Prism.languages.insertBefore('cpp', 'class-name', { + // the base clause is an optional list of parent classes + // https://en.cppreference.com/w/cpp/language/class + 'base-clause': { + pattern: + /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/, + lookbehind: true, + greedy: true, + inside: Prism.languages.extend('cpp', {}), + }, + }); + + Prism.languages.insertBefore( + 'inside', + 'double-colon', + { + // All untokenized words that are not namespaces should be class names + 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i, + }, + Prism.languages.cpp['base-clause'] + ); +})(Prism); diff --git a/public/prism/prism-cpp.min.js b/public/prism/prism-cpp.min.js new file mode 100644 index 0000000..d4719e2 --- /dev/null +++ b/public/prism/prism-cpp.min.js @@ -0,0 +1,90 @@ +!(function (e) { + var t = + /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|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|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, + n = '\\b(?!)\\w+(?:\\s*\\.\\s*\\w+)*\\b'.replace( + //g, + function () { + return t.source; + } + ); + (e.languages.cpp = e.languages.extend('c', { + 'class-name': [ + { + pattern: RegExp( + '(\\b(?:class|concept|enum|struct|typename)\\s+)(?!)\\w+'.replace( + //g, + function () { + return t.source; + } + ) + ), + lookbehind: !0, + }, + /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, + /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i, + /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/, + ], + keyword: t, + number: { + pattern: + /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i, + greedy: !0, + }, + operator: + />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, + boolean: /\b(?:false|true)\b/, + })), + e.languages.insertBefore('cpp', 'string', { + module: { + pattern: RegExp( + '(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\r\n|[^])|[^"\\\\\r\n])*"|<[^<>\r\n]*>|' + + '(?:\\s*:\\s*)?|:\\s*'.replace( + //g, + function () { + return n; + } + ) + + ')' + ), + lookbehind: !0, + greedy: !0, + inside: { string: /^[<"][\s\S]+/, operator: /:/, punctuation: /\./ }, + }, + 'raw-string': { + pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, + alias: 'string', + greedy: !0, + }, + }), + e.languages.insertBefore('cpp', 'keyword', { + 'generic-function': { + pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i, + inside: { + function: /^\w+/, + generic: { + pattern: /<[\s\S]+/, + alias: 'class-name', + inside: e.languages.cpp, + }, + }, + }, + }), + e.languages.insertBefore('cpp', 'operator', { + 'double-colon': { pattern: /::/, alias: 'punctuation' }, + }), + e.languages.insertBefore('cpp', 'class-name', { + 'base-clause': { + pattern: + /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/, + lookbehind: !0, + greedy: !0, + inside: e.languages.extend('cpp', {}), + }, + }), + e.languages.insertBefore( + 'inside', + 'double-colon', + { 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i }, + e.languages.cpp['base-clause'] + ); +})(Prism); diff --git a/public/prism/prism-crystal.js b/public/prism/prism-crystal.js new file mode 100644 index 0000000..a84b288 --- /dev/null +++ b/public/prism/prism-crystal.js @@ -0,0 +1,55 @@ +(function (Prism) { + Prism.languages.crystal = Prism.languages.extend('ruby', { + keyword: [ + /\b(?:__DIR__|__END_LINE__|__FILE__|__LINE__|abstract|alias|annotation|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|ptr|require|rescue|return|select|self|sizeof|struct|super|then|type|typeof|undef|uninitialized|union|unless|until|when|while|with|yield)\b/, + { + pattern: /(\.\s*)(?:is_a|responds_to)\?/, + lookbehind: true, + }, + ], + number: + /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/, + operator: [/->/, Prism.languages.ruby.operator], + punctuation: /[(){}[\].,;\\]/, + }); + + Prism.languages.insertBefore('crystal', 'string-literal', { + attribute: { + pattern: /@\[.*?\]/, + inside: { + delimiter: { + pattern: /^@\[|\]$/, + alias: 'punctuation', + }, + attribute: { + pattern: /^(\s*)\w+/, + lookbehind: true, + alias: 'class-name', + }, + args: { + pattern: /\S(?:[\s\S]*\S)?/, + inside: Prism.languages.crystal, + }, + }, + }, + expansion: { + pattern: /\{(?:\{.*?\}|%.*?%)\}/, + inside: { + content: { + pattern: /^(\{.)[\s\S]+(?=.\}$)/, + lookbehind: true, + inside: Prism.languages.crystal, + }, + delimiter: { + pattern: /^\{[\{%]|[\}%]\}$/, + alias: 'operator', + }, + }, + }, + char: { + pattern: + /'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/, + greedy: true, + }, + }); +})(Prism); diff --git a/public/prism/prism-crystal.min.js b/public/prism/prism-crystal.min.js new file mode 100644 index 0000000..32ee0b9 --- /dev/null +++ b/public/prism/prism-crystal.min.js @@ -0,0 +1,42 @@ +!(function (e) { + (e.languages.crystal = e.languages.extend('ruby', { + keyword: [ + /\b(?:__DIR__|__END_LINE__|__FILE__|__LINE__|abstract|alias|annotation|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|ptr|require|rescue|return|select|self|sizeof|struct|super|then|type|typeof|undef|uninitialized|union|unless|until|when|while|with|yield)\b/, + { pattern: /(\.\s*)(?:is_a|responds_to)\?/, lookbehind: !0 }, + ], + number: + /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/, + operator: [/->/, e.languages.ruby.operator], + punctuation: /[(){}[\].,;\\]/, + })), + e.languages.insertBefore('crystal', 'string-literal', { + attribute: { + pattern: /@\[.*?\]/, + inside: { + delimiter: { pattern: /^@\[|\]$/, alias: 'punctuation' }, + attribute: { + pattern: /^(\s*)\w+/, + lookbehind: !0, + alias: 'class-name', + }, + args: { pattern: /\S(?:[\s\S]*\S)?/, inside: e.languages.crystal }, + }, + }, + expansion: { + pattern: /\{(?:\{.*?\}|%.*?%)\}/, + inside: { + content: { + pattern: /^(\{.)[\s\S]+(?=.\}$)/, + lookbehind: !0, + inside: e.languages.crystal, + }, + delimiter: { pattern: /^\{[\{%]|[\}%]\}$/, alias: 'operator' }, + }, + }, + char: { + pattern: + /'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/, + greedy: !0, + }, + }); +})(Prism); diff --git a/public/prism/prism-csharp.js b/public/prism/prism-csharp.js new file mode 100644 index 0000000..a10d9c2 --- /dev/null +++ b/public/prism/prism-csharp.js @@ -0,0 +1,478 @@ +(function (Prism) { + /** + * Replaces all placeholders "<>" 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 `<>` 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(/<>/g, function () { + return '(?:' + pattern + ')'; + }); + } + return pattern.replace(/<>/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 record struct', + // contextual keywords + // ("var" and "dynamic" are missing because they are used like types) + contextual: + 'add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)', + // 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(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source, 2); // the idea behind the other forbidden characters is to prevent false positives. Same for tupleElement. + var nestedRound = nested(/\((?:[^()]|<>)*\)/.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 typeExpressionWithoutTuple = replace( + /<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, + [identifier, array] + ); + 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, + }, + ], + '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 + // interface Foo + 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, is Bar + // (things like if(a is Foo b) is covered by variable declaration) + pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [ + typeExpressionWithoutTuple, + ]), + lookbehind: true, + inside: typeInside, + }, + { + // Variable, field and parameter declaration + // (Foo bar, Bar baz, Foo[,,] bay, Foo> bax) + pattern: re( + /\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/ + .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+)*)?)(?:[dflmu]|lu|ul)?\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', + }, + }); + + 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: /\./, + }, + }, + 'type-expression': { + // default(Foo), typeof(Foo), sizeof(int) + pattern: re( + /(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/ + .source, + [nestedRound] + ), + lookbehind: true, + alias: 'class-name', + inside: typeInside, + }, + 'return-type': { + // Foo ForBar(); Foo IFoo.Bar() => 0 + // int this[int index] => 0; T IReadOnlyList.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> { } + pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]), + lookbehind: true, + inside: typeInside, + alias: 'class-name', + }, + /*'explicit-implementation': { + // int IFoo.Bar => 0; void IFoo>.Foo(); + pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration), + inside: classNameInside, + alias: 'class-name' + },*/ + 'generic-method': { + // foo() + pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [name, generic]), + inside: { + function: re(/^<<0>>/.source, [name]), + generic: { + pattern: RegExp(generic), + alias: 'class-name', + inside: typeInside, + }, + }, + }, + 'type-list': { + // The list of types inherited or of generic constraints + // class Foo : Bar, IList + // where F : Bar, IList + pattern: re( + /\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/ + .source, + [ + typeDeclarationKeywords, + genericName, + name, + typeExpression, + keywords.source, + nestedRound, + /\bnew\s*\(\s*\)/.source, + ] + ), + lookbehind: true, + inside: { + 'record-arguments': { + pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [ + genericName, + nestedRound, + ]), + lookbehind: true, + greedy: true, + inside: Prism.languages.csharp, + }, + keyword: keywords, + 'class-name': { + pattern: RegExp(typeExpression), + greedy: true, + inside: typeInside, + }, + punctuation: /[,()]/, + }, + }, + preprocessor: { + pattern: /(^[\t ]*)#.*/m, + lookbehind: true, + alias: 'property', + inside: { + // highlight preprocessor directives as keywords + directive: { + pattern: + /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/, + lookbehind: true, + alias: 'keyword', + }, + }, + }, + }); + + // attributes + var regularStringOrCharacter = regularString + '|' + character; + var regularStringCharacterOrComment = replace( + /\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, + [regularStringOrCharacter] + ); + var roundExpression = nested( + replace(/[^"'/()]|<<0>>|\(<>*\)/.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: { + 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: /[:,]/, + }, + }, + }); + + // string interpolation + var formatString = /:[^}\r\n]+/.source; + // multi line + var mInterpolationRound = nested( + replace(/[^"'/()]|<<0>>|\(<>*\)/.source, [ + regularStringCharacterOrComment, + ]), + 2 + ); + var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [ + mInterpolationRound, + formatString, + ]); + // single line + var sInterpolationRound = nested( + replace( + /[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.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: { + '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, + }, + }, + }, + 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, + greedy: true, + inside: createInterpolationInside(sInterpolation, sInterpolationRound), + }, + ], + char: { + pattern: RegExp(character), + greedy: true, + }, + }); + + Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp; +})(Prism); diff --git a/public/prism/prism-csharp.min.js b/public/prism/prism-csharp.min.js new file mode 100644 index 0000000..bb80a4c --- /dev/null +++ b/public/prism/prism-csharp.min.js @@ -0,0 +1,254 @@ +!(function (s) { + function a(e, s) { + return e.replace(/<<(\d+)>>/g, function (e, n) { + return '(?:' + s[+n] + ')'; + }); + } + function t(e, n, s) { + return RegExp(a(e, n), s || ''); + } + function e(e, n) { + for (var s = 0; s < n; s++) + e = e.replace(/<>/g, function () { + return '(?:' + e + ')'; + }); + return e.replace(/<>/g, '[^\\s\\S]'); + } + var n = + 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void', + r = 'class enum interface record struct', + i = + 'add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)', + o = + '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'; + function l(e) { + return '\\b(?:' + e.trim().replace(/ /g, '|') + ')\\b'; + } + var d = l(r), + p = RegExp(l(n + ' ' + r + ' ' + i + ' ' + o)), + c = l(r + ' ' + i + ' ' + o), + u = l(n + ' ' + r + ' ' + o), + g = e('<(?:[^<>;=+\\-*/%&|^]|<>)*>', 2), + b = e('\\((?:[^()]|<>)*\\)', 2), + h = '@?\\b[A-Za-z_]\\w*\\b', + f = a('<<0>>(?:\\s*<<1>>)?', [h, g]), + m = a('(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*', [c, f]), + k = '\\[\\s*(?:,\\s*)*\\]', + y = a('<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?', [m, k]), + w = a('(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?', [ + a('\\(<<0>>+(?:,<<0>>+)+\\)', [ + a('[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>', [g, b, k]), + ]), + m, + k, + ]), + v = { keyword: p, punctuation: /[<>()?,.:[\]]/ }, + x = "'(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'", + $ = '"(?:\\\\.|[^\\\\"\r\n])*"'; + (s.languages.csharp = s.languages.extend('clike', { + string: [ + { + pattern: t('(^|[^$\\\\])<<0>>', ['@"(?:""|\\\\[^]|[^\\\\"])*"(?!")']), + lookbehind: !0, + greedy: !0, + }, + { pattern: t('(^|[^@$\\\\])<<0>>', [$]), lookbehind: !0, greedy: !0 }, + ], + 'class-name': [ + { + pattern: t('(\\busing\\s+static\\s+)<<0>>(?=\\s*;)', [m]), + lookbehind: !0, + inside: v, + }, + { + pattern: t('(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)', [h, w]), + lookbehind: !0, + inside: v, + }, + { pattern: t('(\\busing\\s+)<<0>>(?=\\s*=)', [h]), lookbehind: !0 }, + { pattern: t('(\\b<<0>>\\s+)<<1>>', [d, f]), lookbehind: !0, inside: v }, + { + pattern: t('(\\bcatch\\s*\\(\\s*)<<0>>', [m]), + lookbehind: !0, + inside: v, + }, + { pattern: t('(\\bwhere\\s+)<<0>>', [h]), lookbehind: !0 }, + { + pattern: t('(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>', [y]), + lookbehind: !0, + inside: v, + }, + { + pattern: t( + '\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))', + [w, u, h] + ), + inside: v, + }, + ], + keyword: p, + number: + /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i, + operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/, + punctuation: /\?\.?|::|[{}[\];(),.:]/, + })), + s.languages.insertBefore('csharp', 'number', { + range: { pattern: /\.\./, alias: 'operator' }, + }), + s.languages.insertBefore('csharp', 'punctuation', { + 'named-parameter': { + pattern: t('([(,]\\s*)<<0>>(?=\\s*:)', [h]), + lookbehind: !0, + alias: 'punctuation', + }, + }), + s.languages.insertBefore('csharp', 'class-name', { + namespace: { + pattern: t( + '(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])', + [h] + ), + lookbehind: !0, + inside: { punctuation: /\./ }, + }, + 'type-expression': { + pattern: t( + '(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))', + [b] + ), + lookbehind: !0, + alias: 'class-name', + inside: v, + }, + 'return-type': { + pattern: t( + '<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))', + [w, m] + ), + inside: v, + alias: 'class-name', + }, + 'constructor-invocation': { + pattern: t('(\\bnew\\s+)<<0>>(?=\\s*[[({])', [w]), + lookbehind: !0, + inside: v, + alias: 'class-name', + }, + 'generic-method': { + pattern: t('<<0>>\\s*<<1>>(?=\\s*\\()', [h, g]), + inside: { + function: t('^<<0>>', [h]), + generic: { pattern: RegExp(g), alias: 'class-name', inside: v }, + }, + }, + 'type-list': { + pattern: t( + '\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))', + [d, f, h, w, p.source, b, '\\bnew\\s*\\(\\s*\\)'] + ), + lookbehind: !0, + inside: { + 'record-arguments': { + pattern: t('(^(?!new\\s*\\()<<0>>\\s*)<<1>>', [f, b]), + lookbehind: !0, + greedy: !0, + inside: s.languages.csharp, + }, + keyword: p, + 'class-name': { pattern: RegExp(w), greedy: !0, inside: v }, + punctuation: /[,()]/, + }, + }, + preprocessor: { + pattern: /(^[\t ]*)#.*/m, + lookbehind: !0, + alias: 'property', + inside: { + directive: { + pattern: + /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/, + lookbehind: !0, + alias: 'keyword', + }, + }, + }, + }); + var _ = $ + '|' + x, + B = a('/(?![*/])|//[^\r\n]*[\r\n]|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>', [_]), + E = e(a('[^"\'/()]|<<0>>|\\(<>*\\)', [B]), 2), + R = + '\\b(?:assembly|event|field|method|module|param|property|return|type)\\b', + z = a('<<0>>(?:\\s*\\(<<1>>*\\))?', [m, E]); + s.languages.insertBefore('csharp', 'class-name', { + attribute: { + pattern: t( + '((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])', + [R, z] + ), + lookbehind: !0, + greedy: !0, + inside: { + target: { pattern: t('^<<0>>(?=\\s*:)', [R]), alias: 'keyword' }, + 'attribute-arguments': { + pattern: t('\\(<<0>>*\\)', [E]), + inside: s.languages.csharp, + }, + 'class-name': { pattern: RegExp(m), inside: { punctuation: /\./ } }, + punctuation: /[:,]/, + }, + }, + }); + var S = ':[^}\r\n]+', + j = e(a('[^"\'/()]|<<0>>|\\(<>*\\)', [B]), 2), + A = a('\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}', [j, S]), + F = e( + a('[^"\'/()]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>|\\(<>*\\)', [ + _, + ]), + 2 + ), + P = a('\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}', [F, S]); + function U(e, n) { + return { + interpolation: { + pattern: t('((?:^|[^{])(?:\\{\\{)*)<<0>>', [e]), + lookbehind: !0, + inside: { + 'format-string': { + pattern: t('(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)', [n, S]), + lookbehind: !0, + inside: { punctuation: /^:/ }, + }, + punctuation: /^\{|\}$/, + expression: { + pattern: /[\s\S]+/, + alias: 'language-csharp', + inside: s.languages.csharp, + }, + }, + }, + string: /[\s\S]+/, + }; + } + s.languages.insertBefore('csharp', 'string', { + 'interpolation-string': [ + { + pattern: t( + '(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[^]|\\{\\{|<<0>>|[^\\\\{"])*"', + [A] + ), + lookbehind: !0, + greedy: !0, + inside: U(A, j), + }, + { + pattern: t('(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"', [P]), + lookbehind: !0, + greedy: !0, + inside: U(P, F), + }, + ], + char: { pattern: RegExp(x), greedy: !0 }, + }), + (s.languages.dotnet = s.languages.cs = s.languages.csharp); +})(Prism); diff --git a/public/prism/prism-cshtml.js b/public/prism/prism-cshtml.js new file mode 100644 index 0000000..df73bac --- /dev/null +++ b/public/prism/prism-cshtml.js @@ -0,0 +1,234 @@ +// Docs: +// https://docs.microsoft.com/en-us/aspnet/core/razor-pages/?view=aspnetcore-5.0&tabs=visual-studio +// https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-5.0 + +(function (Prism) { + var commentLike = /\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\// + .source; + var stringLike = + /@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source + + '|' + + /'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source; + + /** + * Creates a nested pattern where all occurrences of the string `<>` 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(//g, function () { + return '(?:' + pattern + ')'; + }); + } + return pattern + .replace(//g, '[^\\s\\S]') + .replace(//g, '(?:' + stringLike + ')') + .replace(//g, '(?:' + commentLike + ')'); + } + + var round = nested(/\((?:[^()'"@/]|||)*\)/.source, 2); + var square = nested(/\[(?:[^\[\]'"@/]|||)*\]/.source, 2); + var curly = nested(/\{(?:[^{}'"@/]|||)*\}/.source, 2); + var angle = nested(/<(?:[^<>'"@/]|||)*>/.source, 2); + + // Note about the above bracket patterns: + // They all ignore HTML expressions that might be in the C# code. This is a problem because HTML (like strings and + // comments) is parsed differently. This is a huge problem because HTML might contain brackets and quotes which + // messes up the bracket and string counting implemented by the above patterns. + // + // This problem is not fixable because 1) HTML expression are highly context sensitive and very difficult to detect + // and 2) they require one capturing group at every nested level. See the `tagRegion` pattern to admire the + // complexity of an HTML expression. + // + // To somewhat alleviate the problem a bit, the patterns for characters (e.g. 'a') is very permissive, it also + // allows invalid characters to support HTML expressions like this:

That's it!

. + + var tagAttrs = + /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?/ + .source; + var tagContent = /(?!\d)[^\s>\/=$<%]+/.source + tagAttrs + /\s*\/?>/.source; + var tagRegion = + /\B@?/.source + + '(?:' + + /<([a-zA-Z][\w:]*)/.source + + tagAttrs + + /\s*>/.source + + '(?:' + + (/[^<]/.source + + '|' + + // all tags that are not the start tag + // eslint-disable-next-line regexp/strict + /<\/?(?!\1\b)/.source + + tagContent + + '|' + + // nested start tag + nested( + // eslint-disable-next-line regexp/strict + /<\1/.source + + tagAttrs + + /\s*>/.source + + '(?:' + + (/[^<]/.source + + '|' + + // all tags that are not the start tag + // eslint-disable-next-line regexp/strict + /<\/?(?!\1\b)/.source + + tagContent + + '|' + + '') + + ')*' + + // eslint-disable-next-line regexp/strict + /<\/\1\s*>/.source, + 2 + )) + + ')*' + + // eslint-disable-next-line regexp/strict + /<\/\1\s*>/.source + + '|' + + //g, function () { + return '(?:' + e + ')'; + }); + return e + .replace(//g, '[^\\s\\S]') + .replace( + //g, + '(?:@(?!")|"(?:[^\r\n\\\\"]|\\\\.)*"|@"(?:[^\\\\"]|""|\\\\[^])*"(?!")|' + + "'(?:(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'|(?=[^\\\\](?!'))))" + ) + .replace( + //g, + '(?:/(?![/*])|//.*[\r\n]|/\\*[^*]*(?:\\*(?!/)[^*]*)*\\*/)' + ); + } + var a = s('\\((?:[^()\'"@/]|||)*\\)', 2), + r = s('\\[(?:[^\\[\\]\'"@/]|||)*\\]', 2), + t = s('\\{(?:[^{}\'"@/]|||)*\\}', 2), + n = s('<(?:[^<>\'"@/]|||)*>', 2), + l = + '(?:\\s(?:\\s*[^\\s>/=]+(?:\\s*=\\s*(?:"[^"]*"|\'[^\']*\'|[^\\s\'">=]+(?=[\\s>]))|(?=[\\s/>])))+)?', + i = '(?!\\d)[^\\s>/=$<%]+' + l + '\\s*/?>', + o = + '\\B@?(?:<([a-zA-Z][\\w:]*)' + + l + + '\\s*>(?:[^<]|(?:[^<]|)*', + 2 + ) + + ')*|<' + + i + + ')'; + e.languages.cshtml = e.languages.extend('markup', {}); + var g = { + pattern: /\S[\s\S]*/, + alias: 'language-csharp', + inside: e.languages.insertBefore( + 'csharp', + 'string', + { html: { pattern: RegExp(o), greedy: !0, inside: e.languages.cshtml } }, + { csharp: e.languages.extend('csharp', {}) } + ), + }; + e.languages.insertBefore('cshtml', 'prolog', { + 'razor-comment': { + pattern: /@\*[\s\S]*?\*@/, + greedy: !0, + alias: 'comment', + }, + block: { + pattern: RegExp( + '(^|[^@])@(?:' + + [ + t, + '(?:code|functions)\\s*' + t, + '(?:for|foreach|lock|switch|using|while)\\s*' + a + '\\s*' + t, + 'do\\s*' + t + '\\s*while\\s*' + a + '(?:\\s*;)?', + 'try\\s*' + + t + + '\\s*catch\\s*' + + a + + '\\s*' + + t + + '\\s*finally\\s*' + + t, + 'if\\s*' + + a + + '\\s*' + + t + + '(?:\\s*else(?:\\s+if\\s*' + + a + + ')?\\s*' + + t + + ')*', + ].join('|') + + ')' + ), + lookbehind: !0, + greedy: !0, + inside: { keyword: /^@\w*/, csharp: g }, + }, + directive: { + pattern: + /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m, + lookbehind: !0, + greedy: !0, + inside: { keyword: /^@\w+/, csharp: g }, + }, + value: { + pattern: RegExp( + '(^|[^@])@(?:await\\b\\s*)?(?:\\w+\\b|' + + a + + ')(?:[?!]?\\.\\w+\\b|' + + a + + '|' + + r + + '|' + + n + + a + + ')*' + ), + lookbehind: !0, + greedy: !0, + alias: 'variable', + inside: { keyword: /^@/, csharp: g }, + }, + 'delegate-operator': { + pattern: /(^|[^@])@(?=<)/, + lookbehind: !0, + alias: 'operator', + }, + }), + (e.languages.razor = e.languages.cshtml); +})(Prism); diff --git a/public/prism/prism-csp.js b/public/prism/prism-csp.js new file mode 100644 index 0000000..ed8c852 --- /dev/null +++ b/public/prism/prism-csp.js @@ -0,0 +1,78 @@ +/** + * Original by Scott Helme. + * + * Reference: https://scotthelme.co.uk/csp-cheat-sheet/ + * + * Supports the following: + * - https://www.w3.org/TR/CSP1/ + * - https://www.w3.org/TR/CSP2/ + * - https://www.w3.org/TR/CSP3/ + */ + +(function (Prism) { + /** + * @param {string} source + * @returns {RegExp} + */ + function value(source) { + return RegExp( + /([ \t])/.source + '(?:' + source + ')' + /(?=[\s;]|$)/.source, + 'i' + ); + } + + Prism.languages.csp = { + directive: { + pattern: + /(^|[\s;])(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|prefetch|script|style|worker)-src|disown-opener|form-action|frame-(?:ancestors|options)|input-protection(?:-(?:clip|selectors))?|navigate-to|plugin-types|policy-uri|referrer|reflected-xss|report-(?:to|uri)|require-sri-for|sandbox|(?:script|style)-src-(?:attr|elem)|upgrade-insecure-requests)(?=[\s;]|$)/i, + lookbehind: true, + alias: 'property', + }, + scheme: { + pattern: value(/[a-z][a-z0-9.+-]*:/.source), + lookbehind: true, + }, + none: { + pattern: value(/'none'/.source), + lookbehind: true, + alias: 'keyword', + }, + nonce: { + pattern: value(/'nonce-[-+/\w=]+'/.source), + lookbehind: true, + alias: 'number', + }, + hash: { + pattern: value(/'sha(?:256|384|512)-[-+/\w=]+'/.source), + lookbehind: true, + alias: 'number', + }, + host: { + pattern: value( + /[a-z][a-z0-9.+-]*:\/\/[^\s;,']*/.source + + '|' + + /\*[^\s;,']*/.source + + '|' + + /[a-z0-9-]+(?:\.[a-z0-9-]+)+(?::[\d*]+)?(?:\/[^\s;,']*)?/.source + ), + lookbehind: true, + alias: 'url', + inside: { + important: /\*/, + }, + }, + keyword: [ + { + pattern: value(/'unsafe-[a-z-]+'/.source), + lookbehind: true, + alias: 'unsafe', + }, + { + pattern: value(/'[a-z-]+'/.source), + lookbehind: true, + alias: 'safe', + }, + ], + punctuation: /;/, + }; +})(Prism); diff --git a/public/prism/prism-csp.min.js b/public/prism/prism-csp.min.js new file mode 100644 index 0000000..9460b7b --- /dev/null +++ b/public/prism/prism-csp.min.js @@ -0,0 +1,38 @@ +!(function (e) { + function n(e) { + return RegExp('([ \t])(?:' + e + ')(?=[\\s;]|$)', 'i'); + } + Prism.languages.csp = { + directive: { + pattern: + /(^|[\s;])(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|prefetch|script|style|worker)-src|disown-opener|form-action|frame-(?:ancestors|options)|input-protection(?:-(?:clip|selectors))?|navigate-to|plugin-types|policy-uri|referrer|reflected-xss|report-(?:to|uri)|require-sri-for|sandbox|(?:script|style)-src-(?:attr|elem)|upgrade-insecure-requests)(?=[\s;]|$)/i, + lookbehind: !0, + alias: 'property', + }, + scheme: { pattern: n('[a-z][a-z0-9.+-]*:'), lookbehind: !0 }, + none: { pattern: n("'none'"), lookbehind: !0, alias: 'keyword' }, + nonce: { + pattern: n("'nonce-[-+/\\w=]+'"), + lookbehind: !0, + alias: 'number', + }, + hash: { + pattern: n("'sha(?:256|384|512)-[-+/\\w=]+'"), + lookbehind: !0, + alias: 'number', + }, + host: { + pattern: n( + "[a-z][a-z0-9.+-]*://[^\\s;,']*|\\*[^\\s;,']*|[a-z0-9-]+(?:\\.[a-z0-9-]+)+(?::[\\d*]+)?(?:/[^\\s;,']*)?" + ), + lookbehind: !0, + alias: 'url', + inside: { important: /\*/ }, + }, + keyword: [ + { pattern: n("'unsafe-[a-z-]+'"), lookbehind: !0, alias: 'unsafe' }, + { pattern: n("'[a-z-]+'"), lookbehind: !0, alias: 'safe' }, + ], + punctuation: /;/, + }; +})(); diff --git a/public/prism/prism-css-extras.js b/public/prism/prism-css-extras.js new file mode 100644 index 0000000..08482cf --- /dev/null +++ b/public/prism/prism-css-extras.js @@ -0,0 +1,123 @@ +(function (Prism) { + var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/; + var selectorInside; + + Prism.languages.css.selector = { + pattern: Prism.languages.css.selector.pattern, + lookbehind: true, + 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*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/, + lookbehind: true, + inside: { + punctuation: /\|$/, + }, + }, + 'attr-name': { + pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/, + lookbehind: true, + }, + 'attr-value': [ + string, + { + pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/, + lookbehind: true, + }, + ], + operator: /[|~*^$]?=/, + }, + }, + 'n-th': [ + { + pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/, + lookbehind: true, + inside: { + number: /[\dn]+/, + operator: /[+-]/, + }, + }, + { + pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i, + lookbehind: true, + }, + ], + combinator: />|\+|~|\|\|/, + + // the `tag` token has been existed and removed. + // because we can't find a perfect tokenize to match it. + // if you want to add it, please read https://github.com/PrismJS/prism/pull/2373 first. + + punctuation: /[(),]/, + }), + }; + + Prism.languages.css['atrule'].inside['selector-function-argument'].inside = + selectorInside; + + Prism.languages.insertBefore('css', 'property', { + variable: { + pattern: + /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i, + lookbehind: true, + }, + }); + + var unit = { + pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/, + lookbehind: true, + }; + // 123 -123 .123 -.123 12.3 -12.3 + var number = { + pattern: /(^|[^\w.-])-?(?:\d+(?:\.\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]{3,8}\b/i, + alias: 'color', + }, + color: [ + { + pattern: + /(^|[^\w-])(?: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)(?![\w-])/i, + lookbehind: true, + }, + { + pattern: + /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)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: { + unit: unit, + number: number, + function: /[\w-]+(?=\()/, + punctuation: /[(),]/, + }, + }, + ], + // it's important that there is no boundary assertion after the hex digits + entity: /\\[\da-f]{1,8}/i, + unit: unit, + number: number, + }); +})(Prism); diff --git a/public/prism/prism-css-extras.min.js b/public/prism/prism-css-extras.min.js new file mode 100644 index 0000000..d79b09a --- /dev/null +++ b/public/prism/prism-css-extras.min.js @@ -0,0 +1,88 @@ +!(function (e) { + var a, + n = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/; + (e.languages.css.selector = { + pattern: e.languages.css.selector.pattern, + lookbehind: !0, + inside: (a = { + 'pseudo-element': + /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/, + 'pseudo-class': /:[-\w]+/, + class: /\.[-\w]+/, + id: /#[-\w]+/, + attribute: { + pattern: RegExp('\\[(?:[^[\\]"\']|' + n.source + ')*\\]'), + greedy: !0, + inside: { + punctuation: /^\[|\]$/, + 'case-sensitivity': { + pattern: /(\s)[si]$/i, + lookbehind: !0, + alias: 'keyword', + }, + namespace: { + pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/, + lookbehind: !0, + inside: { punctuation: /\|$/ }, + }, + 'attr-name': { + pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/, + lookbehind: !0, + }, + 'attr-value': [ + n, + { + pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/, + lookbehind: !0, + }, + ], + operator: /[|~*^$]?=/, + }, + }, + 'n-th': [ + { + pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/, + lookbehind: !0, + inside: { number: /[\dn]+/, operator: /[+-]/ }, + }, + { pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i, lookbehind: !0 }, + ], + combinator: />|\+|~|\|\|/, + punctuation: /[(),]/, + }), + }), + (e.languages.css.atrule.inside['selector-function-argument'].inside = a), + e.languages.insertBefore('css', 'property', { + variable: { + pattern: + /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i, + lookbehind: !0, + }, + }); + var r = { pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/, lookbehind: !0 }, + i = { pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/, lookbehind: !0 }; + e.languages.insertBefore('css', 'function', { + operator: { pattern: /(\s)[+\-*\/](?=\s)/, lookbehind: !0 }, + hexcode: { pattern: /\B#[\da-f]{3,8}\b/i, alias: 'color' }, + color: [ + { + pattern: + /(^|[^\w-])(?: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)(?![\w-])/i, + lookbehind: !0, + }, + { + pattern: + /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)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: { + unit: r, + number: i, + function: /[\w-]+(?=\()/, + punctuation: /[(),]/, + }, + }, + ], + entity: /\\[\da-f]{1,8}/i, + unit: r, + number: i, + }); +})(Prism); diff --git a/public/prism/prism-css.js b/public/prism/prism-css.js new file mode 100644 index 0000000..1785a57 --- /dev/null +++ b/public/prism/prism-css.js @@ -0,0 +1,76 @@ +(function (Prism) { + var string = + /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/; + + Prism.languages.css = { + comment: /\/\*[\s\S]*?\*\//, + atrule: { + pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/, + inside: { + rule: /^@[\w-]+/, + 'selector-function-argument': { + pattern: + /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/, + lookbehind: true, + alias: 'selector', + }, + keyword: { + pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, + lookbehind: true, + }, + // See rest below + }, + }, + url: { + // https://drafts.csswg.org/css-values-3/#urls + pattern: RegExp( + '\\burl\\((?:' + + string.source + + '|' + + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + + ')\\)', + 'i' + ), + greedy: true, + inside: { + function: /^url/i, + punctuation: /^\(|\)$/, + string: { + pattern: RegExp('^' + string.source + '$'), + alias: 'url', + }, + }, + }, + selector: { + pattern: RegExp( + '(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + + string.source + + ')*(?=\\s*\\{)' + ), + lookbehind: true, + }, + string: { + pattern: string, + greedy: true, + }, + property: { + pattern: + /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i, + lookbehind: true, + }, + important: /!important\b/i, + function: { + pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, + lookbehind: true, + }, + punctuation: /[(){};:,]/, + }; + + Prism.languages.css['atrule'].inside.rest = Prism.languages.css; + + var markup = Prism.languages.markup; + if (markup) { + markup.tag.addInlined('style', 'css'); + markup.tag.addAttribute('style', 'css'); + } +})(Prism); diff --git a/public/prism/prism-css.min.js b/public/prism/prism-css.min.js new file mode 100644 index 0000000..11926dc --- /dev/null +++ b/public/prism/prism-css.min.js @@ -0,0 +1,55 @@ +!(function (s) { + var e = + /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/; + (s.languages.css = { + comment: /\/\*[\s\S]*?\*\//, + atrule: { + pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/, + inside: { + rule: /^@[\w-]+/, + 'selector-function-argument': { + pattern: + /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/, + lookbehind: !0, + alias: 'selector', + }, + keyword: { + pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, + lookbehind: !0, + }, + }, + }, + url: { + pattern: RegExp( + '\\burl\\((?:' + e.source + '|(?:[^\\\\\r\n()"\']|\\\\[^])*)\\)', + 'i' + ), + greedy: !0, + inside: { + function: /^url/i, + punctuation: /^\(|\)$/, + string: { pattern: RegExp('^' + e.source + '$'), alias: 'url' }, + }, + }, + selector: { + pattern: RegExp( + '(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + + e.source + + ')*(?=\\s*\\{)' + ), + lookbehind: !0, + }, + string: { pattern: e, greedy: !0 }, + property: { + pattern: + /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i, + lookbehind: !0, + }, + important: /!important\b/i, + function: { pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, lookbehind: !0 }, + punctuation: /[(){};:,]/, + }), + (s.languages.css.atrule.inside.rest = s.languages.css); + var t = s.languages.markup; + t && (t.tag.addInlined('style', 'css'), t.tag.addAttribute('style', 'css')); +})(Prism); diff --git a/public/prism/prism-csv.js b/public/prism/prism-csv.js new file mode 100644 index 0000000..f918f08 --- /dev/null +++ b/public/prism/prism-csv.js @@ -0,0 +1,6 @@ +// https://tools.ietf.org/html/rfc4180 + +Prism.languages.csv = { + value: /[^\r\n,"]+|"(?:[^"]|"")*"(?!")/, + punctuation: /,/, +}; diff --git a/public/prism/prism-csv.min.js b/public/prism/prism-csv.min.js new file mode 100644 index 0000000..ff41411 --- /dev/null +++ b/public/prism/prism-csv.min.js @@ -0,0 +1,4 @@ +Prism.languages.csv = { + value: /[^\r\n,"]+|"(?:[^"]|"")*"(?!")/, + punctuation: /,/, +}; diff --git a/public/prism/prism-cypher.js b/public/prism/prism-cypher.js new file mode 100644 index 0000000..72360bf --- /dev/null +++ b/public/prism/prism-cypher.js @@ -0,0 +1,38 @@ +Prism.languages.cypher = { + // https://neo4j.com/docs/cypher-manual/current/syntax/comments/ + comment: /\/\/.*/, + string: { + pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/, + greedy: true, + }, + 'class-name': { + pattern: /(:\s*)(?:\w+|`(?:[^`\\\r\n])*`)(?=\s*[{):])/, + lookbehind: true, + greedy: true, + }, + relationship: { + pattern: + /(-\[\s*(?:\w+\s*|`(?:[^`\\\r\n])*`\s*)?:\s*|\|\s*:\s*)(?:\w+|`(?:[^`\\\r\n])*`)/, + lookbehind: true, + greedy: true, + alias: 'property', + }, + identifier: { + pattern: /`(?:[^`\\\r\n])*`/, + greedy: true, + }, + + variable: /\$\w+/, + + // https://neo4j.com/docs/cypher-manual/current/syntax/reserved/ + keyword: + /\b(?:ADD|ALL|AND|AS|ASC|ASCENDING|ASSERT|BY|CALL|CASE|COMMIT|CONSTRAINT|CONTAINS|CREATE|CSV|DELETE|DESC|DESCENDING|DETACH|DISTINCT|DO|DROP|ELSE|END|ENDS|EXISTS|FOR|FOREACH|IN|INDEX|IS|JOIN|KEY|LIMIT|LOAD|MANDATORY|MATCH|MERGE|NODE|NOT|OF|ON|OPTIONAL|OR|ORDER(?=\s+BY)|PERIODIC|REMOVE|REQUIRE|RETURN|SCALAR|SCAN|SET|SKIP|START|STARTS|THEN|UNION|UNIQUE|UNWIND|USING|WHEN|WHERE|WITH|XOR|YIELD)\b/i, + + function: /\b\w+\b(?=\s*\()/, + + boolean: /\b(?:false|null|true)\b/i, + number: /\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/, + // https://neo4j.com/docs/cypher-manual/current/syntax/operators/ + operator: /:|<--?|--?>?|<>|=~?|[<>]=?|[+*/%^|]|\.\.\.?/, + punctuation: /[()[\]{},;.]/, +}; diff --git a/public/prism/prism-cypher.min.js b/public/prism/prism-cypher.min.js new file mode 100644 index 0000000..6b94feb --- /dev/null +++ b/public/prism/prism-cypher.min.js @@ -0,0 +1,28 @@ +Prism.languages.cypher = { + comment: /\/\/.*/, + string: { + pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/, + greedy: !0, + }, + 'class-name': { + pattern: /(:\s*)(?:\w+|`(?:[^`\\\r\n])*`)(?=\s*[{):])/, + lookbehind: !0, + greedy: !0, + }, + relationship: { + pattern: + /(-\[\s*(?:\w+\s*|`(?:[^`\\\r\n])*`\s*)?:\s*|\|\s*:\s*)(?:\w+|`(?:[^`\\\r\n])*`)/, + lookbehind: !0, + greedy: !0, + alias: 'property', + }, + identifier: { pattern: /`(?:[^`\\\r\n])*`/, greedy: !0 }, + variable: /\$\w+/, + keyword: + /\b(?:ADD|ALL|AND|AS|ASC|ASCENDING|ASSERT|BY|CALL|CASE|COMMIT|CONSTRAINT|CONTAINS|CREATE|CSV|DELETE|DESC|DESCENDING|DETACH|DISTINCT|DO|DROP|ELSE|END|ENDS|EXISTS|FOR|FOREACH|IN|INDEX|IS|JOIN|KEY|LIMIT|LOAD|MANDATORY|MATCH|MERGE|NODE|NOT|OF|ON|OPTIONAL|OR|ORDER(?=\s+BY)|PERIODIC|REMOVE|REQUIRE|RETURN|SCALAR|SCAN|SET|SKIP|START|STARTS|THEN|UNION|UNIQUE|UNWIND|USING|WHEN|WHERE|WITH|XOR|YIELD)\b/i, + function: /\b\w+\b(?=\s*\()/, + boolean: /\b(?:false|null|true)\b/i, + number: /\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/, + operator: /:|<--?|--?>?|<>|=~?|[<>]=?|[+*/%^|]|\.\.\.?/, + punctuation: /[()[\]{},;.]/, +}; diff --git a/public/prism/prism-d.js b/public/prism/prism-d.js new file mode 100644 index 0000000..80c3968 --- /dev/null +++ b/public/prism/prism-d.js @@ -0,0 +1,96 @@ +Prism.languages.d = Prism.languages.extend('clike', { + comment: [ + { + // Shebang + pattern: /^\s*#!.+/, + greedy: true, + }, + { + pattern: RegExp( + /(^|[^\\])/.source + + '(?:' + + [ + // /+ comment +/ + // Allow one level of nesting + /\/\+(?:\/\+(?:[^+]|\+(?!\/))*\+\/|(?!\/\+)[\s\S])*?\+\//.source, + // // comment + /\/\/.*/.source, + // /* comment */ + /\/\*[\s\S]*?\*\//.source, + ].join('|') + + ')' + ), + lookbehind: true, + greedy: true, + }, + ], + string: [ + { + 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. + // eslint-disable-next-line regexp/strict + /\bq"(.)[\s\S]*?\2"/.source, + + // eslint-disable-next-line regexp/strict + /(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source, + ].join('|'), + 'm' + ), + greedy: true, + }, + { + pattern: /\bq\{(?:\{[^{}]*\}|[^{}])*\}/, + greedy: true, + alias: 'token-string', + }, + ], + + // In order: $, keywords and special tokens, globally defined symbols + keyword: + /\$|\b(?:__(?:(?:DATE|EOF|FILE|FUNCTION|LINE|MODULE|PRETTY_FUNCTION|TIMESTAMP|TIME|VENDOR|VERSION)__|gshared|parameters|traits|vector)|abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|dstring|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|ptrdiff_t|public|pure|real|ref|return|scope|shared|short|size_t|static|string|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|wstring)\b/, + + number: [ + // The lookbehind and the negative look-ahead try to prevent bad highlighting of the .. operator + // Hexadecimal numbers must be handled separately to avoid problems with exponent "e" + /\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]{0,4}/i, + { + pattern: + /((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}/i, + lookbehind: true, + }, + ], + + operator: + /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/, +}); + +Prism.languages.insertBefore('d', 'string', { + // Characters + // 'a', '\\', '\n', '\xFF', '\377', '\uFFFF', '\U0010FFFF', '\quot' + char: /'(?:\\(?:\W|\w+)|[^\\])'/, +}); + +Prism.languages.insertBefore('d', 'keyword', { + property: /\B@\w*/, +}); + +Prism.languages.insertBefore('d', 'function', { + register: { + // Iasm registers + pattern: + /\b(?:[ABCD][LHX]|E?(?:BP|DI|SI|SP)|[BS]PL|[ECSDGF]S|CR[0234]|[DS]IL|DR[012367]|E[ABCD]X|X?MM[0-7]|R(?:1[0-5]|[89])[BWD]?|R[ABCD]X|R[BS]P|R[DS]I|TR[3-7]|XMM(?:1[0-5]|[89])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/, + alias: 'variable', + }, +}); diff --git a/public/prism/prism-d.min.js b/public/prism/prism-d.min.js new file mode 100644 index 0000000..de8fa41 --- /dev/null +++ b/public/prism/prism-d.min.js @@ -0,0 +1,61 @@ +(Prism.languages.d = Prism.languages.extend('clike', { + comment: [ + { pattern: /^\s*#!.+/, greedy: !0 }, + { + pattern: RegExp( + '(^|[^\\\\])(?:' + + [ + '/\\+(?:/\\+(?:[^+]|\\+(?!/))*\\+/|(?!/\\+)[^])*?\\+/', + '//.*', + '/\\*[^]*?\\*/', + ].join('|') + + ')' + ), + lookbehind: !0, + greedy: !0, + }, + ], + string: [ + { + pattern: RegExp( + [ + '\\b[rx]"(?:\\\\[^]|[^\\\\"])*"[cwd]?', + '\\bq"(?:\\[[^]*?\\]|\\([^]*?\\)|<[^]*?>|\\{[^]*?\\})"', + '\\bq"((?!\\d)\\w+)$[^]*?^\\1"', + '\\bq"(.)[^]*?\\2"', + '(["`])(?:\\\\[^]|(?!\\3)[^\\\\])*\\3[cwd]?', + ].join('|'), + 'm' + ), + greedy: !0, + }, + { + pattern: /\bq\{(?:\{[^{}]*\}|[^{}])*\}/, + greedy: !0, + alias: 'token-string', + }, + ], + keyword: + /\$|\b(?:__(?:(?:DATE|EOF|FILE|FUNCTION|LINE|MODULE|PRETTY_FUNCTION|TIMESTAMP|TIME|VENDOR|VERSION)__|gshared|parameters|traits|vector)|abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|dstring|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|ptrdiff_t|public|pure|real|ref|return|scope|shared|short|size_t|static|string|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|wstring)\b/, + number: [ + /\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]{0,4}/i, + { + pattern: + /((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}/i, + lookbehind: !0, + }, + ], + operator: + /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/, +})), + Prism.languages.insertBefore('d', 'string', { + char: /'(?:\\(?:\W|\w+)|[^\\])'/, + }), + Prism.languages.insertBefore('d', 'keyword', { property: /\B@\w*/ }), + Prism.languages.insertBefore('d', 'function', { + register: { + pattern: + /\b(?:[ABCD][LHX]|E?(?:BP|DI|SI|SP)|[BS]PL|[ECSDGF]S|CR[0234]|[DS]IL|DR[012367]|E[ABCD]X|X?MM[0-7]|R(?:1[0-5]|[89])[BWD]?|R[ABCD]X|R[BS]P|R[DS]I|TR[3-7]|XMM(?:1[0-5]|[89])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/, + alias: 'variable', + }, + }); diff --git a/public/prism/prism-dart.js b/public/prism/prism-dart.js new file mode 100644 index 0000000..1f7f88d --- /dev/null +++ b/public/prism/prism-dart.js @@ -0,0 +1,83 @@ +(function (Prism) { + var keywords = [ + /\b(?:async|sync|yield)\*/, + /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/, + ]; + + // Handles named imports, such as http.Client + var packagePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/ + .source; + + // based on the dart naming conventions + var className = { + pattern: RegExp(packagePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source), + lookbehind: true, + inside: { + namespace: { + pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, + inside: { + punctuation: /\./, + }, + }, + }, + }; + + Prism.languages.dart = Prism.languages.extend('clike', { + 'class-name': [ + className, + { + // variables and parameters + // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods) + pattern: RegExp(packagePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source), + lookbehind: true, + inside: className.inside, + }, + ], + keyword: keywords, + operator: + /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/, + }); + + Prism.languages.insertBefore('dart', 'string', { + 'string-literal': { + pattern: + /r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/, + greedy: true, + inside: { + interpolation: { + pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/, + lookbehind: true, + inside: { + punctuation: /^\$\{?|\}$/, + expression: { + pattern: /[\s\S]+/, + inside: Prism.languages.dart, + }, + }, + }, + string: /[\s\S]+/, + }, + }, + string: undefined, + }); + + Prism.languages.insertBefore('dart', 'class-name', { + metadata: { + pattern: /@\w+/, + alias: 'function', + }, + }); + + Prism.languages.insertBefore('dart', 'class-name', { + generics: { + pattern: + /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/, + inside: { + 'class-name': className, + keyword: keywords, + punctuation: /[<>(),.:]/, + operator: /[?&|]/, + }, + }, + }); +})(Prism); diff --git a/public/prism/prism-dart.min.js b/public/prism/prism-dart.min.js new file mode 100644 index 0000000..6b90b8b --- /dev/null +++ b/public/prism/prism-dart.min.js @@ -0,0 +1,65 @@ +!(function (e) { + var a = [ + /\b(?:async|sync|yield)\*/, + /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/, + ], + n = '(^|[^\\w.])(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*', + s = { + pattern: RegExp(n + '[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b'), + lookbehind: !0, + inside: { + namespace: { + pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, + inside: { punctuation: /\./ }, + }, + }, + }; + (e.languages.dart = e.languages.extend('clike', { + 'class-name': [ + s, + { + pattern: RegExp(n + '[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()])'), + lookbehind: !0, + inside: s.inside, + }, + ], + keyword: a, + operator: + /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/, + })), + e.languages.insertBefore('dart', 'string', { + 'string-literal': { + pattern: + /r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/, + greedy: !0, + inside: { + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/, + lookbehind: !0, + inside: { + punctuation: /^\$\{?|\}$/, + expression: { pattern: /[\s\S]+/, inside: e.languages.dart }, + }, + }, + string: /[\s\S]+/, + }, + }, + string: void 0, + }), + e.languages.insertBefore('dart', 'class-name', { + metadata: { pattern: /@\w+/, alias: 'function' }, + }), + e.languages.insertBefore('dart', 'class-name', { + generics: { + pattern: + /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/, + inside: { + 'class-name': s, + keyword: a, + punctuation: /[<>(),.:]/, + operator: /[?&|]/, + }, + }, + }); +})(Prism); diff --git a/public/prism/prism-dataweave.js b/public/prism/prism-dataweave.js new file mode 100644 index 0000000..b1d5f55 --- /dev/null +++ b/public/prism/prism-dataweave.js @@ -0,0 +1,41 @@ +(function (Prism) { + Prism.languages.dataweave = { + url: /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/, + property: { + pattern: /(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/, + greedy: true, + }, + string: { + pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/, + greedy: true, + }, + 'mime-type': /\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/, + date: { + pattern: /\|[\w:+-]+\|/, + greedy: true, + }, + comment: [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true, + greedy: true, + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true, + }, + ], + regex: { + pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//, + greedy: true, + }, + keyword: + /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/, + function: /\b[A-Z_]\w*(?=\s*\()/i, + number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, + punctuation: /[{}[\];(),.:@]/, + operator: /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/, + boolean: /\b(?:false|true)\b/, + }; +})(Prism); diff --git a/public/prism/prism-dataweave.min.js b/public/prism/prism-dataweave.min.js new file mode 100644 index 0000000..a0d2dde --- /dev/null +++ b/public/prism/prism-dataweave.min.js @@ -0,0 +1,22 @@ +Prism.languages.dataweave = { + url: /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/, + property: { + pattern: /(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/, + greedy: !0, + }, + string: { pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/, greedy: !0 }, + 'mime-type': /\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/, + date: { pattern: /\|[\w:+-]+\|/, greedy: !0 }, + comment: [ + { pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, + { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }, + ], + regex: { pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//, greedy: !0 }, + keyword: + /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/, + function: /\b[A-Z_]\w*(?=\s*\()/i, + number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, + punctuation: /[{}[\];(),.:@]/, + operator: /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/, + boolean: /\b(?:false|true)\b/, +}; diff --git a/public/prism/prism-dax.js b/public/prism/prism-dax.js new file mode 100644 index 0000000..3b73497 --- /dev/null +++ b/public/prism/prism-dax.js @@ -0,0 +1,30 @@ +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|EVALUATE|MEASURE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i, + boolean: { + pattern: /\b(?:FALSE|NULL|TRUE)\b/i, + alias: 'constant', + }, + number: /\b\d+(?:\.\d*)?|\B\.\d+\b/, + operator: /:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i, + punctuation: /[;\[\](){}`,.]/, +}; diff --git a/public/prism/prism-dax.min.js b/public/prism/prism-dax.min.js new file mode 100644 index 0000000..09e9175 --- /dev/null +++ b/public/prism/prism-dax.min.js @@ -0,0 +1,21 @@ +Prism.languages.dax = { + comment: { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/).*)/, + lookbehind: !0, + }, + 'data-field': { + pattern: + /'(?:[^']|'')*'(?!')(?:\[[ \w\xA0-\uFFFF]+\])?|\w+\[[ \w\xA0-\uFFFF]+\]/, + alias: 'symbol', + }, + measure: { pattern: /\[[ \w\xA0-\uFFFF]+\]/, alias: 'constant' }, + string: { pattern: /"(?:[^"]|"")*"(?!")/, greedy: !0 }, + 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|EVALUATE|MEASURE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i, + boolean: { pattern: /\b(?:FALSE|NULL|TRUE)\b/i, alias: 'constant' }, + number: /\b\d+(?:\.\d*)?|\B\.\d+\b/, + operator: /:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i, + punctuation: /[;\[\](){}`,.]/, +}; diff --git a/public/prism/prism-dhall.js b/public/prism/prism-dhall.js new file mode 100644 index 0000000..102a5bd --- /dev/null +++ b/public/prism/prism-dhall.js @@ -0,0 +1,75 @@ +// ABNF grammar: +// https://github.com/dhall-lang/dhall-lang/blob/master/standard/dhall.abnf + +Prism.languages.dhall = { + // Multi-line comments can be nested. E.g. {- foo {- bar -} -} + // The multi-line pattern is essentially this: + // \{-(?:[^-{]|-(?!\})|\{(?!-)|)*-\} + comment: + /--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/, + string: { + pattern: /"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/, + greedy: true, + inside: { + interpolation: { + pattern: /\$\{[^{}]*\}/, + inside: { + expression: { + pattern: /(^\$\{)[\s\S]+(?=\}$)/, + lookbehind: true, + alias: 'language-dhall', + inside: null, // see blow + }, + punctuation: /\$\{|\}/, + }, + }, + }, + }, + label: { + pattern: /`[^`]*`/, + greedy: true, + }, + url: { + // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L596 + pattern: + /\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/, + greedy: true, + }, + env: { + // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L661 + pattern: /\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/, + greedy: true, + inside: { + function: /^env/, + operator: /^:/, + variable: /[\s\S]+/, + }, + }, + hash: { + // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L725 + pattern: /\bsha256:[\da-fA-F]{64}\b/, + inside: { + function: /sha256/, + operator: /:/, + number: /[\da-fA-F]{64}/, + }, + }, + + // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L359 + keyword: + /\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/, + builtin: /\b(?:None|Some)\b/, + + boolean: /\b(?:False|True)\b/, + number: + /\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/, + operator: + /\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/, + punctuation: /\.\.|[{}\[\](),./]/, + + // we'll just assume that every capital word left is a type name + 'class-name': /\b[A-Z]\w*\b/, +}; + +Prism.languages.dhall.string.inside.interpolation.inside.expression.inside = + Prism.languages.dhall; diff --git a/public/prism/prism-dhall.min.js b/public/prism/prism-dhall.min.js new file mode 100644 index 0000000..65dd3df --- /dev/null +++ b/public/prism/prism-dhall.min.js @@ -0,0 +1,49 @@ +(Prism.languages.dhall = { + comment: + /--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/, + string: { + pattern: /"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/, + greedy: !0, + inside: { + interpolation: { + pattern: /\$\{[^{}]*\}/, + inside: { + expression: { + pattern: /(^\$\{)[\s\S]+(?=\}$)/, + lookbehind: !0, + alias: 'language-dhall', + inside: null, + }, + punctuation: /\$\{|\}/, + }, + }, + }, + }, + label: { pattern: /`[^`]*`/, greedy: !0 }, + url: { + pattern: + /\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/, + greedy: !0, + }, + env: { + pattern: /\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/, + greedy: !0, + inside: { function: /^env/, operator: /^:/, variable: /[\s\S]+/ }, + }, + hash: { + pattern: /\bsha256:[\da-fA-F]{64}\b/, + inside: { function: /sha256/, operator: /:/, number: /[\da-fA-F]{64}/ }, + }, + keyword: + /\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/, + builtin: /\b(?:None|Some)\b/, + boolean: /\b(?:False|True)\b/, + number: + /\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/, + operator: + /\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/, + punctuation: /\.\.|[{}\[\](),./]/, + 'class-name': /\b[A-Z]\w*\b/, +}), + (Prism.languages.dhall.string.inside.interpolation.inside.expression.inside = + Prism.languages.dhall); diff --git a/public/prism/prism-diff.js b/public/prism/prism-diff.js new file mode 100644 index 0000000..44e111a --- /dev/null +++ b/public/prism/prism-diff.js @@ -0,0 +1,62 @@ +(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} + */ + 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: RegExp('^(?:[' + prefix + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'), + alias: alias, + inside: { + line: { + pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/, + lookbehind: true, + }, + prefix: { + pattern: /[\s\S]/, + alias: /\w+/.exec(name)[0], + }, + }, + }; + }); + + // make prefixes available to Diff plugin + Object.defineProperty(Prism.languages.diff, 'PREFIXES', { + value: PREFIXES, + }); +})(Prism); diff --git a/public/prism/prism-diff.min.js b/public/prism/prism-diff.min.js new file mode 100644 index 0000000..899368a --- /dev/null +++ b/public/prism/prism-diff.min.js @@ -0,0 +1,28 @@ +!(function (i) { + i.languages.diff = { + coord: [/^(?:\*{3}|-{3}|\+{3}).*$/m, /^@@.*@@$/m, /^\d.*$/m], + }; + var r = { + 'deleted-sign': '-', + 'deleted-arrow': '<', + 'inserted-sign': '+', + 'inserted-arrow': '>', + unchanged: ' ', + diff: '!', + }; + Object.keys(r).forEach(function (e) { + var n = r[e], + a = []; + /^\w+$/.test(e) || a.push(/\w+/.exec(e)[0]), + 'diff' === e && a.push('bold'), + (i.languages.diff[e] = { + pattern: RegExp('^(?:[' + n + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'), + alias: a, + inside: { + line: { pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/, lookbehind: !0 }, + prefix: { pattern: /[\s\S]/, alias: /\w+/.exec(e)[0] }, + }, + }); + }), + Object.defineProperty(i.languages.diff, 'PREFIXES', { value: r }); +})(Prism); diff --git a/public/prism/prism-django.js b/public/prism/prism-django.js new file mode 100644 index 0000000..915b0a1 --- /dev/null +++ b/public/prism/prism-django.js @@ -0,0 +1,58 @@ +// Django/Jinja2 syntax definition for Prism.js syntax highlighter. +// Mostly it works OK but can paint code incorrectly on complex html/template tag combinations. + +(function (Prism) { + Prism.languages.django = { + comment: /^\{#[\s\S]*?#\}$/, + tag: { + pattern: /(^\{%[+-]?\s*)\w+/, + lookbehind: true, + alias: 'keyword', + }, + delimiter: { + pattern: /^\{[{%][+-]?|[+-]?[}%]\}$/, + alias: 'punctuation', + }, + string: { + pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + filter: { + pattern: /(\|)\w+/, + lookbehind: true, + alias: 'function', + }, + test: { + pattern: /(\bis\s+(?:not\s+)?)(?!not\b)\w+/, + lookbehind: true, + alias: 'function', + }, + function: /\b[a-z_]\w+(?=\s*\()/i, + keyword: + /\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/, + operator: /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, + number: /\b\d+(?:\.\d+)?\b/, + boolean: /[Ff]alse|[Nn]one|[Tt]rue/, + variable: /\b\w+\b/, + punctuation: /[{}[\](),.:;]/, + }; + + var pattern = /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g; + var markupTemplating = Prism.languages['markup-templating']; + + Prism.hooks.add('before-tokenize', function (env) { + markupTemplating.buildPlaceholders(env, 'django', pattern); + }); + Prism.hooks.add('after-tokenize', function (env) { + markupTemplating.tokenizePlaceholders(env, 'django'); + }); + + // Add an Jinja2 alias + Prism.languages.jinja2 = Prism.languages.django; + Prism.hooks.add('before-tokenize', function (env) { + markupTemplating.buildPlaceholders(env, 'jinja2', pattern); + }); + Prism.hooks.add('after-tokenize', function (env) { + markupTemplating.tokenizePlaceholders(env, 'jinja2'); + }); +})(Prism); diff --git a/public/prism/prism-django.min.js b/public/prism/prism-django.min.js new file mode 100644 index 0000000..05c9801 --- /dev/null +++ b/public/prism/prism-django.min.js @@ -0,0 +1,37 @@ +!(function (e) { + e.languages.django = { + comment: /^\{#[\s\S]*?#\}$/, + tag: { pattern: /(^\{%[+-]?\s*)\w+/, lookbehind: !0, alias: 'keyword' }, + delimiter: { pattern: /^\{[{%][+-]?|[+-]?[}%]\}$/, alias: 'punctuation' }, + string: { pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, + filter: { pattern: /(\|)\w+/, lookbehind: !0, alias: 'function' }, + test: { + pattern: /(\bis\s+(?:not\s+)?)(?!not\b)\w+/, + lookbehind: !0, + alias: 'function', + }, + function: /\b[a-z_]\w+(?=\s*\()/i, + keyword: + /\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/, + operator: /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, + number: /\b\d+(?:\.\d+)?\b/, + boolean: /[Ff]alse|[Nn]one|[Tt]rue/, + variable: /\b\w+\b/, + punctuation: /[{}[\](),.:;]/, + }; + var n = /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g, + o = e.languages['markup-templating']; + e.hooks.add('before-tokenize', function (e) { + o.buildPlaceholders(e, 'django', n); + }), + e.hooks.add('after-tokenize', function (e) { + o.tokenizePlaceholders(e, 'django'); + }), + (e.languages.jinja2 = e.languages.django), + e.hooks.add('before-tokenize', function (e) { + o.buildPlaceholders(e, 'jinja2', n); + }), + e.hooks.add('after-tokenize', function (e) { + o.tokenizePlaceholders(e, 'jinja2'); + }); +})(Prism); diff --git a/public/prism/prism-dns-zone-file.js b/public/prism/prism-dns-zone-file.js new file mode 100644 index 0000000..4272ecc --- /dev/null +++ b/public/prism/prism-dns-zone-file.js @@ -0,0 +1,34 @@ +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: /^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m, + class: { + // https://tools.ietf.org/html/rfc1035#page-13 + pattern: /(^|\s)(?:CH|CS|HS|IN)(?=\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']; diff --git a/public/prism/prism-dns-zone-file.min.js b/public/prism/prism-dns-zone-file.min.js new file mode 100644 index 0000000..b608784 --- /dev/null +++ b/public/prism/prism-dns-zone-file.min.js @@ -0,0 +1,22 @@ +(Prism.languages['dns-zone-file'] = { + comment: /;.*/, + string: { pattern: /"(?:\\.|[^"\\\r\n])*"/, greedy: !0 }, + variable: [ + { pattern: /(^\$ORIGIN[ \t]+)\S+/m, lookbehind: !0 }, + { pattern: /(^|\s)@(?=\s|$)/, lookbehind: !0 }, + ], + keyword: /^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m, + class: { + pattern: /(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/, + lookbehind: !0, + alias: 'keyword', + }, + type: { + 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: !0, + alias: 'keyword', + }, + punctuation: /[()]/, +}), + (Prism.languages['dns-zone'] = Prism.languages['dns-zone-file']); diff --git a/public/prism/prism-docker.js b/public/prism/prism-docker.js new file mode 100644 index 0000000..2468db1 --- /dev/null +++ b/public/prism/prism-docker.js @@ -0,0 +1,124 @@ +(function (Prism) { + // Many of the following regexes will contain negated lookaheads like `[ \t]+(?![ \t])`. This is a trick to ensure + // that quantifiers behave *atomically*. Atomic quantifiers are necessary to prevent exponential backtracking. + + var spaceAfterBackSlash = + /\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source; + // At least one space, comment, or line break + var space = /(?:[ \t]+(?![ \t])(?:)?|)/.source.replace( + //g, + function () { + return spaceAfterBackSlash; + } + ); + + var string = + /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/ + .source; + var option = /--[\w-]+=(?:|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace( + //g, + function () { + return string; + } + ); + + var stringRule = { + pattern: RegExp(string), + greedy: true, + }; + var commentRule = { + pattern: /(^[ \t]*)#.*/m, + lookbehind: true, + greedy: true, + }; + + /** + * @param {string} source + * @param {string} flags + * @returns {RegExp} + */ + function re(source, flags) { + source = source + .replace(//g, function () { + return option; + }) + .replace(//g, function () { + return space; + }); + + return RegExp(source, flags); + } + + Prism.languages.docker = { + instruction: { + pattern: + /(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im, + lookbehind: true, + greedy: true, + inside: { + options: { + pattern: re( + /(^(?:ONBUILD)?\w+)(?:)*/.source, + 'i' + ), + lookbehind: true, + greedy: true, + inside: { + property: { + pattern: /(^|\s)--[\w-]+/, + lookbehind: true, + }, + string: [ + stringRule, + { + pattern: /(=)(?!["'])(?:[^\s\\]|\\.)+/, + lookbehind: true, + }, + ], + operator: /\\$/m, + punctuation: /=/, + }, + }, + keyword: [ + { + // https://docs.docker.com/engine/reference/builder/#healthcheck + pattern: re( + /(^(?:ONBUILD)?HEALTHCHECK(?:)*)(?:CMD|NONE)\b/ + .source, + 'i' + ), + lookbehind: true, + greedy: true, + }, + { + // https://docs.docker.com/engine/reference/builder/#from + pattern: re( + /(^(?:ONBUILD)?FROM(?:)*(?!--)[^ \t\\]+)AS/ + .source, + 'i' + ), + lookbehind: true, + greedy: true, + }, + { + // https://docs.docker.com/engine/reference/builder/#onbuild + pattern: re(/(^ONBUILD)\w+/.source, 'i'), + lookbehind: true, + greedy: true, + }, + { + pattern: /^\w+/, + greedy: true, + }, + ], + comment: commentRule, + string: stringRule, + variable: /\$(?:\w+|\{[^{}"'\\]*\})/, + operator: /\\$/m, + }, + }, + comment: commentRule, + }; + + Prism.languages.dockerfile = Prism.languages.docker; +})(Prism); diff --git a/public/prism/prism-docker.min.js b/public/prism/prism-docker.min.js new file mode 100644 index 0000000..87e86ea --- /dev/null +++ b/public/prism/prism-docker.min.js @@ -0,0 +1,80 @@ +!(function (e) { + var r = '(?:[ \t]+(?![ \t])(?:)?|)'.replace( + //g, + function () { + return '\\\\[\r\n](?:\\s|\\\\[\r\n]|#.*(?!.))*(?![\\s#]|\\\\[\r\n])'; + } + ), + n = + '"(?:[^"\\\\\r\n]|\\\\(?:\r\n|[^]))*"|\'(?:[^\'\\\\\r\n]|\\\\(?:\r\n|[^]))*\'', + t = '--[\\w-]+=(?:|(?!["\'])(?:[^\\s\\\\]|\\\\.)+)'.replace( + //g, + function () { + return n; + } + ), + o = { pattern: RegExp(n), greedy: !0 }, + i = { pattern: /(^[ \t]*)#.*/m, lookbehind: !0, greedy: !0 }; + function a(e, n) { + return ( + (e = e + .replace(//g, function () { + return t; + }) + .replace(//g, function () { + return r; + })), + RegExp(e, n) + ); + } + (e.languages.docker = { + instruction: { + pattern: + /(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im, + lookbehind: !0, + greedy: !0, + inside: { + options: { + pattern: a('(^(?:ONBUILD)?\\w+)(?:)*', 'i'), + lookbehind: !0, + greedy: !0, + inside: { + property: { pattern: /(^|\s)--[\w-]+/, lookbehind: !0 }, + string: [ + o, + { pattern: /(=)(?!["'])(?:[^\s\\]|\\.)+/, lookbehind: !0 }, + ], + operator: /\\$/m, + punctuation: /=/, + }, + }, + keyword: [ + { + pattern: a( + '(^(?:ONBUILD)?HEALTHCHECK(?:)*)(?:CMD|NONE)\\b', + 'i' + ), + lookbehind: !0, + greedy: !0, + }, + { + pattern: a( + '(^(?:ONBUILD)?FROM(?:)*(?!--)[^ \t\\\\]+)AS', + 'i' + ), + lookbehind: !0, + greedy: !0, + }, + { pattern: a('(^ONBUILD)\\w+', 'i'), lookbehind: !0, greedy: !0 }, + { pattern: /^\w+/, greedy: !0 }, + ], + comment: i, + string: o, + variable: /\$(?:\w+|\{[^{}"'\\]*\})/, + operator: /\\$/m, + }, + }, + comment: i, + }), + (e.languages.dockerfile = e.languages.docker); +})(Prism); diff --git a/public/prism/prism-dot.js b/public/prism/prism-dot.js new file mode 100644 index 0000000..c6cd170 --- /dev/null +++ b/public/prism/prism-dot.js @@ -0,0 +1,86 @@ +// https://www.graphviz.org/doc/info/lang.html + +(function (Prism) { + var ID = + '(?:' + + [ + // an identifier + /[a-zA-Z_\x80-\uFFFF][\w\x80-\uFFFF]*/.source, + // a number + /-?(?:\.\d+|\d+(?:\.\d*)?)/.source, + // a double-quoted string + /"[^"\\]*(?:\\[\s\S][^"\\]*)*"/.source, + // HTML-like string + /<(?:[^<>]|(?!)*>/ + .source, + ].join('|') + + ')'; + + var IDInside = { + markup: { + pattern: /(^<)[\s\S]+(?=>$)/, + lookbehind: true, + alias: ['language-markup', 'language-html', 'language-xml'], + inside: Prism.languages.markup, + }, + }; + + /** + * @param {string} source + * @param {string} flags + * @returns {RegExp} + */ + function withID(source, flags) { + return RegExp( + source.replace(//g, function () { + return ID; + }), + flags + ); + } + + Prism.languages.dot = { + comment: { + pattern: /\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m, + greedy: true, + }, + 'graph-name': { + pattern: withID( + /(\b(?:digraph|graph|subgraph)[ \t\r\n]+)/.source, + 'i' + ), + lookbehind: true, + greedy: true, + alias: 'class-name', + inside: IDInside, + }, + 'attr-value': { + pattern: withID(/(=[ \t\r\n]*)/.source), + lookbehind: true, + greedy: true, + inside: IDInside, + }, + 'attr-name': { + pattern: withID(/([\[;, \t\r\n])(?=[ \t\r\n]*=)/.source), + lookbehind: true, + greedy: true, + inside: IDInside, + }, + keyword: /\b(?:digraph|edge|graph|node|strict|subgraph)\b/i, + 'compass-point': { + pattern: /(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/, + lookbehind: true, + alias: 'builtin', + }, + node: { + pattern: withID(/(^|[^-.\w\x80-\uFFFF\\])/.source), + lookbehind: true, + greedy: true, + inside: IDInside, + }, + operator: /[=:]|-[->]/, + punctuation: /[\[\]{};,]/, + }; + + Prism.languages.gv = Prism.languages.dot; +})(Prism); diff --git a/public/prism/prism-dot.min.js b/public/prism/prism-dot.min.js new file mode 100644 index 0000000..44dd9a3 --- /dev/null +++ b/public/prism/prism-dot.min.js @@ -0,0 +1,64 @@ +!(function (e) { + var n = + '(?:' + + [ + '[a-zA-Z_\\x80-\\uFFFF][\\w\\x80-\\uFFFF]*', + '-?(?:\\.\\d+|\\d+(?:\\.\\d*)?)', + '"[^"\\\\]*(?:\\\\[^][^"\\\\]*)*"', + '<(?:[^<>]|(?!\x3c!--)<(?:[^<>"\']|"[^"]*"|\'[^\']*\')+>|\x3c!--(?:[^-]|-(?!->))*--\x3e)*>', + ].join('|') + + ')', + a = { + markup: { + pattern: /(^<)[\s\S]+(?=>$)/, + lookbehind: !0, + alias: ['language-markup', 'language-html', 'language-xml'], + inside: e.languages.markup, + }, + }; + function r(e, a) { + return RegExp( + e.replace(//g, function () { + return n; + }), + a + ); + } + (e.languages.dot = { + comment: { pattern: /\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m, greedy: !0 }, + 'graph-name': { + pattern: r('(\\b(?:digraph|graph|subgraph)[ \t\r\n]+)', 'i'), + lookbehind: !0, + greedy: !0, + alias: 'class-name', + inside: a, + }, + 'attr-value': { + pattern: r('(=[ \t\r\n]*)'), + lookbehind: !0, + greedy: !0, + inside: a, + }, + 'attr-name': { + pattern: r('([\\[;, \t\r\n])(?=[ \t\r\n]*=)'), + lookbehind: !0, + greedy: !0, + inside: a, + }, + keyword: /\b(?:digraph|edge|graph|node|strict|subgraph)\b/i, + 'compass-point': { + pattern: /(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/, + lookbehind: !0, + alias: 'builtin', + }, + node: { + pattern: r('(^|[^-.\\w\\x80-\\uFFFF\\\\])'), + lookbehind: !0, + greedy: !0, + inside: a, + }, + operator: /[=:]|-[->]/, + punctuation: /[\[\]{};,]/, + }), + (e.languages.gv = e.languages.dot); +})(Prism); diff --git a/public/prism/prism-ebnf.js b/public/prism/prism-ebnf.js new file mode 100644 index 0000000..136b3df --- /dev/null +++ b/public/prism/prism-ebnf.js @@ -0,0 +1,22 @@ +Prism.languages.ebnf = { + comment: /\(\*[\s\S]*?\*\)/, + string: { + pattern: /"[^"\r\n]*"|'[^'\r\n]*'/, + greedy: true, + }, + special: { + pattern: /\?[^?\r\n]*\?/, + greedy: true, + alias: 'class-name', + }, + + definition: { + pattern: /^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im, + lookbehind: true, + alias: ['rule', 'keyword'], + }, + rule: /\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i, + + punctuation: /\([:/]|[:/]\)|[.,;()[\]{}]/, + operator: /[-=|*/!]/, +}; diff --git a/public/prism/prism-ebnf.min.js b/public/prism/prism-ebnf.min.js new file mode 100644 index 0000000..43c59fd --- /dev/null +++ b/public/prism/prism-ebnf.min.js @@ -0,0 +1,13 @@ +Prism.languages.ebnf = { + comment: /\(\*[\s\S]*?\*\)/, + string: { pattern: /"[^"\r\n]*"|'[^'\r\n]*'/, greedy: !0 }, + special: { pattern: /\?[^?\r\n]*\?/, greedy: !0, alias: 'class-name' }, + definition: { + pattern: /^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im, + lookbehind: !0, + alias: ['rule', 'keyword'], + }, + rule: /\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i, + punctuation: /\([:/]|[:/]\)|[.,;()[\]{}]/, + operator: /[-=|*/!]/, +}; diff --git a/public/prism/prism-editorconfig.js b/public/prism/prism-editorconfig.js new file mode 100644 index 0000000..66fad09 --- /dev/null +++ b/public/prism/prism-editorconfig.js @@ -0,0 +1,26 @@ +Prism.languages.editorconfig = { + // https://editorconfig-specification.readthedocs.io + comment: /[;#].*/, + section: { + pattern: /(^[ \t]*)\[.+\]/m, + lookbehind: true, + alias: 'keyword', + inside: { + regex: /\\\\[\[\]{},!?.*]/, // Escape special characters with '\\' + operator: /[!?]|\.\.|\*{1,2}/, + punctuation: /[\[\]{},]/, + }, + }, + key: { + pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m, + lookbehind: true, + alias: 'attr-name', + }, + value: { + pattern: /=.*/, + alias: 'attr-value', + inside: { + punctuation: /^=/, + }, + }, +}; diff --git a/public/prism/prism-editorconfig.min.js b/public/prism/prism-editorconfig.min.js new file mode 100644 index 0000000..fe6660b --- /dev/null +++ b/public/prism/prism-editorconfig.min.js @@ -0,0 +1,19 @@ +Prism.languages.editorconfig = { + comment: /[;#].*/, + section: { + pattern: /(^[ \t]*)\[.+\]/m, + lookbehind: !0, + alias: 'keyword', + inside: { + regex: /\\\\[\[\]{},!?.*]/, + operator: /[!?]|\.\.|\*{1,2}/, + punctuation: /[\[\]{},]/, + }, + }, + key: { + pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m, + lookbehind: !0, + alias: 'attr-name', + }, + value: { pattern: /=.*/, alias: 'attr-value', inside: { punctuation: /^=/ } }, +}; diff --git a/public/prism/prism-eiffel.js b/public/prism/prism-eiffel.js new file mode 100644 index 0000000..8d14b8f --- /dev/null +++ b/public/prism/prism-eiffel.js @@ -0,0 +1,35 @@ +Prism.languages.eiffel = { + comment: /--.*/, + string: [ + // Aligned-verbatim-strings + { + pattern: /"([^[]*)\[[\s\S]*?\]\1"/, + greedy: true, + }, + // Non-aligned-verbatim-strings + { + pattern: /"([^{]*)\{[\s\S]*?\}\1"/, + greedy: true, + }, + // Single-line string + { + pattern: /"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/, + greedy: true, + }, + ], + // normal char | special char | char code + char: /'(?:%.|[^%'\r\n])+'/, + keyword: + /\b(?:across|agent|alias|all|and|as|assign|attached|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i, + boolean: /\b(?:False|True)\b/i, + // Convention: class-names are always all upper-case characters + 'class-name': /\b[A-Z][\dA-Z_]*\b/, + number: [ + // hexa | octal | bin + /\b0[xcb][\da-f](?:_*[\da-f])*\b/i, + // Decimal + /(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i, + ], + punctuation: /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/, + operator: /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/, +}; diff --git a/public/prism/prism-eiffel.min.js b/public/prism/prism-eiffel.min.js new file mode 100644 index 0000000..18651b9 --- /dev/null +++ b/public/prism/prism-eiffel.min.js @@ -0,0 +1,19 @@ +Prism.languages.eiffel = { + comment: /--.*/, + string: [ + { pattern: /"([^[]*)\[[\s\S]*?\]\1"/, greedy: !0 }, + { pattern: /"([^{]*)\{[\s\S]*?\}\1"/, greedy: !0 }, + { pattern: /"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/, greedy: !0 }, + ], + char: /'(?:%.|[^%'\r\n])+'/, + keyword: + /\b(?:across|agent|alias|all|and|as|assign|attached|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i, + boolean: /\b(?:False|True)\b/i, + 'class-name': /\b[A-Z][\dA-Z_]*\b/, + number: [ + /\b0[xcb][\da-f](?:_*[\da-f])*\b/i, + /(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i, + ], + punctuation: /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/, + operator: /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/, +}; diff --git a/public/prism/prism-ejs.js b/public/prism/prism-ejs.js new file mode 100644 index 0000000..b585520 --- /dev/null +++ b/public/prism/prism-ejs.js @@ -0,0 +1,28 @@ +(function (Prism) { + Prism.languages.ejs = { + delimiter: { + pattern: /^<%[-_=]?|[-_]?%>$/, + alias: 'punctuation', + }, + comment: /^#[\s\S]*/, + 'language-javascript': { + pattern: /[\s\S]+/, + inside: Prism.languages.javascript, + }, + }; + + Prism.hooks.add('before-tokenize', function (env) { + var ejsPattern = /<%(?!%)[\s\S]+?%>/g; + Prism.languages['markup-templating'].buildPlaceholders( + env, + 'ejs', + ejsPattern + ); + }); + + Prism.hooks.add('after-tokenize', function (env) { + Prism.languages['markup-templating'].tokenizePlaceholders(env, 'ejs'); + }); + + Prism.languages.eta = Prism.languages.ejs; +})(Prism); diff --git a/public/prism/prism-ejs.min.js b/public/prism/prism-ejs.min.js new file mode 100644 index 0000000..fe2c434 --- /dev/null +++ b/public/prism/prism-ejs.min.js @@ -0,0 +1,21 @@ +!(function (e) { + (e.languages.ejs = { + delimiter: { pattern: /^<%[-_=]?|[-_]?%>$/, alias: 'punctuation' }, + comment: /^#[\s\S]*/, + 'language-javascript': { + pattern: /[\s\S]+/, + inside: e.languages.javascript, + }, + }), + e.hooks.add('before-tokenize', function (a) { + e.languages['markup-templating'].buildPlaceholders( + a, + 'ejs', + /<%(?!%)[\s\S]+?%>/g + ); + }), + e.hooks.add('after-tokenize', function (a) { + e.languages['markup-templating'].tokenizePlaceholders(a, 'ejs'); + }), + (e.languages.eta = e.languages.ejs); +})(Prism); diff --git a/public/prism/prism-elixir.js b/public/prism/prism-elixir.js new file mode 100644 index 0000000..a0f6376 --- /dev/null +++ b/public/prism/prism-elixir.js @@ -0,0 +1,102 @@ +Prism.languages.elixir = { + doc: { + pattern: + /@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/, + inside: { + attribute: /^@\w+/, + string: /['"][\s\S]+/, + }, + }, + comment: { + pattern: /#.*/, + greedy: true, + }, + // ~r"""foo""" (multi-line), ~r'''foo''' (multi-line), ~r/foo/, ~r|foo|, ~r"foo", ~r'foo', ~r(foo), ~r[foo], ~r{foo}, ~r + regex: { + pattern: + /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/, + greedy: true, + }, + string: [ + { + // ~s"""foo""" (multi-line), ~s'''foo''' (multi-line), ~s/foo/, ~s|foo|, ~s"foo", ~s'foo', ~s(foo), ~s[foo], ~s{foo} (with interpolation care), ~s + pattern: + /~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/, + greedy: true, + inside: { + // See interpolation below + }, + }, + { + pattern: /("""|''')[\s\S]*?\1/, + greedy: true, + inside: { + // See interpolation below + }, + }, + { + // Multi-line strings are allowed + pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + inside: { + // See interpolation below + }, + }, + ], + atom: { + // Look-behind prevents bad highlighting of the :: operator + pattern: /(^|[^:]):\w+/, + lookbehind: true, + alias: 'symbol', + }, + module: { + pattern: /\b[A-Z]\w*\b/, + alias: 'class-name', + }, + // Look-ahead prevents bad highlighting of the :: operator + 'attr-name': /\b\w+\??:(?!:)/, + argument: { + // Look-behind prevents bad highlighting of the && operator + pattern: /(^|[^&])&\d+/, + lookbehind: true, + alias: 'variable', + }, + attribute: { + pattern: /@\w+/, + alias: 'variable', + }, + function: /\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/, + number: /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i, + keyword: + /\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/, + boolean: /\b(?:false|nil|true)\b/, + operator: [ + /\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/, + { + // We don't want to match << + pattern: /([^<])<(?!<)/, + lookbehind: true, + }, + { + // We don't want to match >> + pattern: /([^>])>(?!>)/, + lookbehind: true, + }, + ], + punctuation: /<<|>>|[.,%\[\]{}()]/, +}; + +Prism.languages.elixir.string.forEach(function (o) { + o.inside = { + interpolation: { + pattern: /#\{[^}]+\}/, + inside: { + delimiter: { + pattern: /^#\{|\}$/, + alias: 'punctuation', + }, + rest: Prism.languages.elixir, + }, + }, + }; +}); diff --git a/public/prism/prism-elixir.min.js b/public/prism/prism-elixir.min.js new file mode 100644 index 0000000..b6138e9 --- /dev/null +++ b/public/prism/prism-elixir.min.js @@ -0,0 +1,54 @@ +(Prism.languages.elixir = { + doc: { + pattern: + /@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/, + inside: { attribute: /^@\w+/, string: /['"][\s\S]+/ }, + }, + comment: { pattern: /#.*/, greedy: !0 }, + regex: { + pattern: + /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/, + greedy: !0, + }, + string: [ + { + pattern: + /~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/, + greedy: !0, + inside: {}, + }, + { pattern: /("""|''')[\s\S]*?\1/, greedy: !0, inside: {} }, + { + pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: !0, + inside: {}, + }, + ], + atom: { pattern: /(^|[^:]):\w+/, lookbehind: !0, alias: 'symbol' }, + module: { pattern: /\b[A-Z]\w*\b/, alias: 'class-name' }, + 'attr-name': /\b\w+\??:(?!:)/, + argument: { pattern: /(^|[^&])&\d+/, lookbehind: !0, alias: 'variable' }, + attribute: { pattern: /@\w+/, alias: 'variable' }, + function: /\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/, + number: /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i, + keyword: + /\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/, + boolean: /\b(?:false|nil|true)\b/, + operator: [ + /\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/, + { pattern: /([^<])<(?!<)/, lookbehind: !0 }, + { pattern: /([^>])>(?!>)/, lookbehind: !0 }, + ], + punctuation: /<<|>>|[.,%\[\]{}()]/, +}), + Prism.languages.elixir.string.forEach(function (e) { + e.inside = { + interpolation: { + pattern: /#\{[^}]+\}/, + inside: { + delimiter: { pattern: /^#\{|\}$/, alias: 'punctuation' }, + rest: Prism.languages.elixir, + }, + }, + }; + }); diff --git a/public/prism/prism-elm.js b/public/prism/prism-elm.js new file mode 100644 index 0000000..8614888 --- /dev/null +++ b/public/prism/prism-elm.js @@ -0,0 +1,49 @@ +Prism.languages.elm = { + comment: /--.*|\{-[\s\S]*?-\}/, + char: { + pattern: + /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}))'/, + greedy: true, + }, + string: [ + { + // Multiline strings are wrapped in triple ". Quotes may appear unescaped. + pattern: /"""[\s\S]*?"""/, + greedy: true, + }, + { + pattern: /"(?:[^\\"\r\n]|\\.)*"/, + greedy: true, + }, + ], + 'import-statement': { + // 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: + /(^[\t ]*)import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m, + lookbehind: true, + inside: { + keyword: /\b(?:as|exposing|import)\b/, + }, + }, + keyword: + /\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/, + // These are builtin variables only. Constructors are highlighted later as a constant. + builtin: + /\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/, + // decimal integers and floating point numbers | hexadecimal integers + number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i, + // Most of this is needed because of the meaning of a single '.'. + // If it stands alone freely, it is the function composition. + // 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. + // Valid operator characters in 0.18: +-/*=.$<>:&|^?%#@~! + // Ref: https://groups.google.com/forum/#!msg/elm-dev/0AHSnDdkSkQ/E0SVU70JEQAJ + operator: /\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/, + // In Elm, 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/, + punctuation: /[{}[\]|(),.:]/, +}; diff --git a/public/prism/prism-elm.min.js b/public/prism/prism-elm.min.js new file mode 100644 index 0000000..2fdcae9 --- /dev/null +++ b/public/prism/prism-elm.min.js @@ -0,0 +1,27 @@ +Prism.languages.elm = { + comment: /--.*|\{-[\s\S]*?-\}/, + char: { + pattern: + /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}))'/, + greedy: !0, + }, + string: [ + { pattern: /"""[\s\S]*?"""/, greedy: !0 }, + { pattern: /"(?:[^\\"\r\n]|\\.)*"/, greedy: !0 }, + ], + 'import-statement': { + pattern: + /(^[\t ]*)import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m, + lookbehind: !0, + inside: { keyword: /\b(?:as|exposing|import)\b/ }, + }, + keyword: + /\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/, + builtin: + /\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/, + number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i, + operator: /\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/, + hvariable: /\b(?:[A-Z]\w*\.)*[a-z]\w*\b/, + constant: /\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/, + punctuation: /[{}[\]|(),.:]/, +}; diff --git a/public/prism/prism-erb.js b/public/prism/prism-erb.js new file mode 100644 index 0000000..9b406dc --- /dev/null +++ b/public/prism/prism-erb.js @@ -0,0 +1,28 @@ +(function (Prism) { + Prism.languages.erb = { + delimiter: { + pattern: /^(\s*)<%=?|%>(?=\s*$)/, + lookbehind: true, + alias: 'punctuation', + }, + ruby: { + pattern: /\s*\S[\s\S]*/, + alias: 'language-ruby', + inside: Prism.languages.ruby, + }, + }; + + Prism.hooks.add('before-tokenize', function (env) { + var erbPattern = + /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/g; + Prism.languages['markup-templating'].buildPlaceholders( + env, + 'erb', + erbPattern + ); + }); + + Prism.hooks.add('after-tokenize', function (env) { + Prism.languages['markup-templating'].tokenizePlaceholders(env, 'erb'); + }); +})(Prism); diff --git a/public/prism/prism-erb.min.js b/public/prism/prism-erb.min.js new file mode 100644 index 0000000..90e72c9 --- /dev/null +++ b/public/prism/prism-erb.min.js @@ -0,0 +1,24 @@ +!(function (n) { + (n.languages.erb = { + delimiter: { + pattern: /^(\s*)<%=?|%>(?=\s*$)/, + lookbehind: !0, + alias: 'punctuation', + }, + ruby: { + pattern: /\s*\S[\s\S]*/, + alias: 'language-ruby', + inside: n.languages.ruby, + }, + }), + n.hooks.add('before-tokenize', function (e) { + n.languages['markup-templating'].buildPlaceholders( + e, + 'erb', + /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/g + ); + }), + n.hooks.add('after-tokenize', function (e) { + n.languages['markup-templating'].tokenizePlaceholders(e, 'erb'); + }); +})(Prism); diff --git a/public/prism/prism-erlang.js b/public/prism/prism-erlang.js new file mode 100644 index 0000000..bfd4aa3 --- /dev/null +++ b/public/prism/prism-erlang.js @@ -0,0 +1,43 @@ +Prism.languages.erlang = { + comment: /%.+/, + string: { + pattern: /"(?:\\.|[^\\"\r\n])*"/, + greedy: true, + }, + 'quoted-function': { + pattern: /'(?:\\.|[^\\'\r\n])+'(?=\()/, + alias: 'function', + }, + 'quoted-atom': { + pattern: /'(?:\\.|[^\\'\r\n])+'/, + alias: 'atom', + }, + boolean: /\b(?:false|true)\b/, + keyword: /\b(?:after|case|catch|end|fun|if|of|receive|try|when)\b/, + number: [ + /\$\\?./, + /\b\d+#[a-z0-9]+/i, + /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + ], + function: /\b[a-z][\w@]*(?=\()/, + variable: { + // Look-behind is used to prevent wrong highlighting of atoms containing "@" + pattern: /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/, + lookbehind: true, + }, + operator: [ + /[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/, + { + // We don't want to match << + pattern: /(^|[^<])<(?!<)/, + lookbehind: true, + }, + { + // We don't want to match >> + pattern: /(^|[^>])>(?!>)/, + lookbehind: true, + }, + ], + atom: /\b[a-z][\w@]*/, + punctuation: /[()[\]{}:;,.#|]|<<|>>/, +}; diff --git a/public/prism/prism-erlang.min.js b/public/prism/prism-erlang.min.js new file mode 100644 index 0000000..c670dd5 --- /dev/null +++ b/public/prism/prism-erlang.min.js @@ -0,0 +1,25 @@ +Prism.languages.erlang = { + comment: /%.+/, + string: { pattern: /"(?:\\.|[^\\"\r\n])*"/, greedy: !0 }, + 'quoted-function': { + pattern: /'(?:\\.|[^\\'\r\n])+'(?=\()/, + alias: 'function', + }, + 'quoted-atom': { pattern: /'(?:\\.|[^\\'\r\n])+'/, alias: 'atom' }, + boolean: /\b(?:false|true)\b/, + keyword: /\b(?:after|case|catch|end|fun|if|of|receive|try|when)\b/, + number: [ + /\$\\?./, + /\b\d+#[a-z0-9]+/i, + /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + ], + function: /\b[a-z][\w@]*(?=\()/, + variable: { pattern: /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/, lookbehind: !0 }, + operator: [ + /[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/, + { pattern: /(^|[^<])<(?!<)/, lookbehind: !0 }, + { pattern: /(^|[^>])>(?!>)/, lookbehind: !0 }, + ], + atom: /\b[a-z][\w@]*/, + punctuation: /[()[\]{}:;,.#|]|<<|>>/, +}; diff --git a/public/prism/prism-etlua.js b/public/prism/prism-etlua.js new file mode 100644 index 0000000..782d525 --- /dev/null +++ b/public/prism/prism-etlua.js @@ -0,0 +1,25 @@ +(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); diff --git a/public/prism/prism-etlua.min.js b/public/prism/prism-etlua.min.js new file mode 100644 index 0000000..331398d --- /dev/null +++ b/public/prism/prism-etlua.min.js @@ -0,0 +1,16 @@ +!(function (e) { + (e.languages.etlua = { + delimiter: { pattern: /^<%[-=]?|-?%>$/, alias: 'punctuation' }, + 'language-lua': { pattern: /[\s\S]+/, inside: e.languages.lua }, + }), + e.hooks.add('before-tokenize', function (a) { + e.languages['markup-templating'].buildPlaceholders( + a, + 'etlua', + /<%[\s\S]+?%>/g + ); + }), + e.hooks.add('after-tokenize', function (a) { + e.languages['markup-templating'].tokenizePlaceholders(a, 'etlua'); + }); +})(Prism); diff --git a/public/prism/prism-excel-formula.js b/public/prism/prism-excel-formula.js new file mode 100644 index 0000000..1338efe --- /dev/null +++ b/public/prism/prism-excel-formula.js @@ -0,0 +1,69 @@ +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: /\b[A-Z]\w*(?=\()/i, + alias: 'keyword', + }, + range: { + pattern: + /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/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: /\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/, + alias: 'property', + }, + number: /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i, + boolean: /\b(?:FALSE|TRUE)\b/i, + operator: /[-+*/^%=&,]|<[=>]?|>=?/, + punctuation: /[[\]();{}|]/, +}; + +Prism.languages['xlsx'] = Prism.languages['xls'] = + Prism.languages['excel-formula']; diff --git a/public/prism/prism-excel-formula.min.js b/public/prism/prism-excel-formula.min.js new file mode 100644 index 0000000..838e1fc --- /dev/null +++ b/public/prism/prism-excel-formula.min.js @@ -0,0 +1,43 @@ +(Prism.languages['excel-formula'] = { + comment: { + pattern: /(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i, + lookbehind: !0, + greedy: !0, + }, + string: { pattern: /"(?:[^"]|"")*"(?!")/, greedy: !0 }, + reference: { + pattern: + /(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/, + greedy: !0, + alias: 'string', + inside: { + operator: /!$/, + punctuation: /'/, + sheet: { pattern: /[^[\]]+$/, alias: 'function' }, + file: { pattern: /\[[^[\]]+\]$/, inside: { punctuation: /[[\]]/ } }, + path: /[\s\S]+/, + }, + }, + 'function-name': { pattern: /\b[A-Z]\w*(?=\()/i, alias: 'keyword' }, + range: { + pattern: + /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i, + alias: 'property', + inside: { + operator: /:/, + cell: /\$?[A-Z]+\$?\d+/i, + column: /\$?[A-Z]+/i, + row: /\$?\d+/, + }, + }, + cell: { + pattern: /\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/, + alias: 'property', + }, + number: /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i, + boolean: /\b(?:FALSE|TRUE)\b/i, + operator: /[-+*/^%=&,]|<[=>]?|>=?/, + punctuation: /[[\]();{}|]/, +}), + (Prism.languages.xlsx = Prism.languages.xls = + Prism.languages['excel-formula']); diff --git a/public/prism/prism-factor.js b/public/prism/prism-factor.js new file mode 100644 index 0000000..fdbe1cc --- /dev/null +++ b/public/prism/prism-factor.js @@ -0,0 +1,963 @@ +(function (Prism) { + var comment_inside = { + function: + /\b(?:BUGS?|FIX(?:MES?)?|NOTES?|TODOS?|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." + + */ + 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: /([\r\n][ \t]*);(?=\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|eval|execute)?\((?=\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': { + // 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] + + , SYNTAX:, etc are supported by their own patterns. + + `with` and `new` from `kernel` are their own builtins. + + see + */ + 'conventionally-named-word': { + pattern: + /(^|\s)(?!")(?:(?:change|new|set|with)-\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 + + 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', + '', + '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', + '>>>>>', + '<<<<<<<', + '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?', + '', + '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', + '', + '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?', + '', + '3append-as', + 'virtual-sequence', + 'subseq?', + 'remove-nth!', + 'length', + 'last-index', + 'lengthen', + 'assert-sequence', + 'copy', + 'move', + 'third', + 'first', + 'tail?', + 'set-first', + 'prefix', + 'bounds-error', + '', + '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', + '', + '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', + 'inputsequence', + // tafn + ]; + + factor.combinators.pattern = arrToWordsRegExp(combinators); + + Prism.languages.factor = factor; +})(Prism); diff --git a/public/prism/prism-factor.min.js b/public/prism/prism-factor.min.js new file mode 100644 index 0000000..70fb151 --- /dev/null +++ b/public/prism/prism-factor.min.js @@ -0,0 +1,745 @@ +!(function (e) { + var t = { + function: + /\b(?:BUGS?|FIX(?:MES?)?|NOTES?|TODOS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/, + }, + s = { number: /\\[^\s']|%\w/ }, + i = { + comment: [ + { pattern: /(^|\s)(?:! .*|!$)/, lookbehind: !0, inside: t }, + { + pattern: /(^|\s)\/\*\s[\s\S]*?\*\/(?=\s|$)/, + lookbehind: !0, + greedy: !0, + inside: t, + }, + { + pattern: /(^|\s)!\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/, + lookbehind: !0, + greedy: !0, + inside: t, + }, + ], + number: [ + { pattern: /(^|\s)[+-]?\d+(?=\s|$)/, lookbehind: !0 }, + { + pattern: /(^|\s)[+-]?0(?:b[01]+|o[0-7]+|d\d+|x[\dA-F]+)(?=\s|$)/i, + lookbehind: !0, + }, + { pattern: /(^|\s)[+-]?\d+\/\d+\.?(?=\s|$)/, lookbehind: !0 }, + { pattern: /(^|\s)\+?\d+\+\d+\/\d+(?=\s|$)/, lookbehind: !0 }, + { pattern: /(^|\s)-\d+-\d+\/\d+(?=\s|$)/, lookbehind: !0 }, + { + pattern: + /(^|\s)[+-]?(?:\d*\.\d+|\d+\.\d*|\d+)(?:e[+-]?\d+)?(?=\s|$)/i, + lookbehind: !0, + }, + { pattern: /(^|\s)NAN:\s+[\da-fA-F]+(?=\s|$)/, lookbehind: !0 }, + { + pattern: + /(^|\s)[+-]?0(?:b1\.[01]*|o1\.[0-7]*|d1\.\d*|x1\.[\dA-F]*)p\d+(?=\s|$)/i, + lookbehind: !0, + }, + ], + regexp: { + pattern: + /(^|\s)R\/\s(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/, + lookbehind: !0, + alias: 'number', + inside: { + variable: /\\\S/, + keyword: /[+?*\[\]^$(){}.|]/, + operator: { pattern: /(\/)[idmsr]+(?:-[idmsr]+)?/, lookbehind: !0 }, + }, + }, + boolean: { pattern: /(^|\s)[tf](?=\s|$)/, lookbehind: !0 }, + 'custom-string': { + pattern: /(^|\s)[A-Z0-9\-]+"\s(?:\\\S|[^"\\])*"/, + lookbehind: !0, + greedy: !0, + alias: 'string', + inside: { number: /\\\S|%\w|\// }, + }, + 'multiline-string': [ + { + pattern: /(^|\s)STRING:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*;(?=\s|$)/, + lookbehind: !0, + greedy: !0, + alias: 'string', + inside: { + number: s.number, + 'semicolon-or-setlocal': { + pattern: /([\r\n][ \t]*);(?=\s|$)/, + lookbehind: !0, + alias: 'function', + }, + }, + }, + { + pattern: /(^|\s)HEREDOC:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*\S+(?=\s|$)/, + lookbehind: !0, + greedy: !0, + alias: 'string', + inside: s, + }, + { + pattern: /(^|\s)\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/, + lookbehind: !0, + greedy: !0, + alias: 'string', + inside: s, + }, + ], + 'special-using': { + pattern: /(^|\s)USING:(?:\s\S+)*(?=\s+;(?:\s|$))/, + lookbehind: !0, + alias: 'function', + inside: { string: { pattern: /(\s)[^:\s]+/, lookbehind: !0 } }, + }, + 'stack-effect-delimiter': [ + { + pattern: /(^|\s)(?:call|eval|execute)?\((?=\s)/, + lookbehind: !0, + alias: 'operator', + }, + { pattern: /(\s)--(?=\s)/, lookbehind: !0, alias: 'operator' }, + { pattern: /(\s)\)(?=\s|$)/, lookbehind: !0, alias: 'operator' }, + ], + combinators: { pattern: null, lookbehind: !0, alias: 'keyword' }, + 'kernel-builtin': { pattern: null, lookbehind: !0, alias: 'variable' }, + 'sequences-builtin': { pattern: null, lookbehind: !0, alias: 'variable' }, + 'math-builtin': { pattern: null, lookbehind: !0, alias: 'variable' }, + 'constructor-word': { + pattern: /(^|\s)<(?!=+>|-+>)\S+>(?=\s|$)/, + lookbehind: !0, + alias: 'keyword', + }, + 'other-builtin-syntax': { + pattern: null, + lookbehind: !0, + alias: 'operator', + }, + 'conventionally-named-word': { + pattern: + /(^|\s)(?!")(?:(?:change|new|set|with)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/, + lookbehind: !0, + alias: 'keyword', + }, + 'colon-syntax': { + pattern: /(^|\s)(?:[A-Z0-9\-]+#?)?:{1,2}\s+(?:;\S+|(?!;)\S+)(?=\s|$)/, + lookbehind: !0, + greedy: !0, + alias: 'function', + }, + 'semicolon-or-setlocal': { + pattern: /(\s)(?:;|:>)(?=\s|$)/, + lookbehind: !0, + alias: 'function', + }, + 'curly-brace-literal-delimiter': [ + { pattern: /(^|\s)[a-z]*\{(?=\s)/i, lookbehind: !0, alias: 'operator' }, + { pattern: /(\s)\}(?=\s|$)/, lookbehind: !0, alias: 'operator' }, + ], + 'quotation-delimiter': [ + { pattern: /(^|\s)\[(?=\s)/, lookbehind: !0, alias: 'operator' }, + { pattern: /(\s)\](?=\s|$)/, lookbehind: !0, alias: 'operator' }, + ], + 'normal-word': { pattern: /(^|\s)[^"\s]\S*(?=\s|$)/, lookbehind: !0 }, + string: { pattern: /"(?:\\\S|[^"\\])*"/, greedy: !0, inside: s }, + }, + n = function (e) { + return (e + '').replace(/([.?*+\^$\[\]\\(){}|\-])/g, '\\$1'); + }, + r = function (e) { + return new RegExp('(^|\\s)(?:' + e.map(n).join('|') + ')(?=\\s|$)'); + }, + a = { + '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', + '', + 'boolean?', + 'identity-hashcode', + 'identity-tuple?', + 'null', + 'composed?', + 'new', + '5drop', + 'rot', + '-roll', + 'xor', + 'identity-tuple', + 'boolean', + ], + 'other-builtin-syntax': [ + '=======', + 'recursive', + 'flushable', + '>>', + '<<<<<<', + 'M\\', + 'B', + 'PRIVATE>', + '\\', + '======', + 'final', + 'inline', + 'delimiter', + 'deprecated', + '>>>>>', + '<<<<<<<', + 'parse-complex', + 'malformed-complex', + 'read-only', + '>>>>>>>', + 'call-next-method', + '<<', + 'foldable', + '$', + '$[', + '${', + ], + '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?', + '', + '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', + '', + '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?', + '', + '3append-as', + 'virtual-sequence', + 'subseq?', + 'remove-nth!', + 'length', + 'last-index', + 'lengthen', + 'assert-sequence', + 'copy', + 'move', + 'third', + 'first', + 'tail?', + 'set-first', + 'prefix', + 'bounds-error', + '', + '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', + '', + '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', + ], + }; + Object.keys(a).forEach(function (e) { + i[e].pattern = r(a[e]); + }); + (i.combinators.pattern = r([ + '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@', + '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', + 'if-zero', + 'each-integer', + 'unless-zero', + '(find-integer)', + 'when-zero', + 'find-last-integer', + '(all-integers?)', + 'times', + '(each-integer)', + 'find-integer', + 'all-integers?', + 'unless-negative', + 'if-positive', + 'when-positive', + 'when-negative', + 'unless-positive', + 'if-negative', + 'case', + '2cleave', + 'cond>quot', + 'case>quot', + '3cleave', + 'wrong-values', + 'to-fixed-point', + 'alist>quot', + 'cond', + 'cleave', + 'call-effect', + 'recursive-hashcode', + 'spread', + 'deep-spread>quot', + '2||', + '0||', + 'n||', + '0&&', + '2&&', + '3||', + '1||', + '1&&', + 'n&&', + '3&&', + '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', + 'inputsequence', + ])), + (e.languages.factor = i); +})(Prism); diff --git a/public/prism/prism-false.js b/public/prism/prism-false.js new file mode 100644 index 0000000..6748198 --- /dev/null +++ b/public/prism/prism-false.js @@ -0,0 +1,32 @@ +(function (Prism) { + /** + * Based on the manual by Wouter van Oortmerssen. + * + * @see {@link https://github.com/PrismJS/prism/issues/2801#issue-829717504} + */ + Prism.languages['false'] = { + comment: { + pattern: /\{[^}]*\}/, + }, + string: { + pattern: /"[^"]*"/, + greedy: true, + }, + 'character-code': { + pattern: /'(?:[^\r]|\r\n?)/, + alias: 'number', + }, + 'assembler-code': { + pattern: /\d+`/, + alias: 'important', + }, + number: /\d+/, + operator: /[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/, + punctuation: /\[|\]/, + variable: /[a-z]/, + 'non-standard': { + pattern: /[()?@\\^_`|~ßø]/, + punctuation: /\[|\]/, + variable: /[a-z]/, + 'non-standard': { pattern: /[()!=]=?|[-+*/%]|\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: /,/, + }, + }, +}); diff --git a/public/prism/prism-firestore-security-rules.min.js b/public/prism/prism-firestore-security-rules.min.js new file mode 100644 index 0000000..0bb4904 --- /dev/null +++ b/public/prism/prism-firestore-security-rules.min.js @@ -0,0 +1,27 @@ +(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: !0, + greedy: !0, + inside: { + variable: { + pattern: /\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/, + inside: { operator: /=/, keyword: /\*\*/, punctuation: /[.$(){}]/ }, + }, + punctuation: /\//, + }, + }, + method: { + pattern: /(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/, + lookbehind: !0, + alias: 'builtin', + inside: { punctuation: /,/ }, + }, + }); diff --git a/public/prism/prism-flow.js b/public/prism/prism-flow.js new file mode 100644 index 0000000..d9dea65 --- /dev/null +++ b/public/prism/prism-flow.js @@ -0,0 +1,38 @@ +(function (Prism) { + Prism.languages.flow = Prism.languages.extend('javascript', {}); + + Prism.languages.insertBefore('flow', 'keyword', { + type: [ + { + pattern: + /\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|any|mixed|null|void)\b/, + alias: 'tag', + }, + ], + }); + Prism.languages.flow['function-variable'].pattern = + /(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i; + delete Prism.languages.flow['parameter']; + + Prism.languages.insertBefore('flow', 'operator', { + 'flow-punctuation': { + pattern: /\{\||\|\}/, + alias: 'punctuation', + }, + }); + + if (!Array.isArray(Prism.languages.flow.keyword)) { + Prism.languages.flow.keyword = [Prism.languages.flow.keyword]; + } + Prism.languages.flow.keyword.unshift( + { + pattern: /(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/, + lookbehind: true, + }, + { + pattern: + /(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/, + lookbehind: true, + } + ); +})(Prism); diff --git a/public/prism/prism-flow.min.js b/public/prism/prism-flow.min.js new file mode 100644 index 0000000..7f15692 --- /dev/null +++ b/public/prism/prism-flow.min.js @@ -0,0 +1,31 @@ +!(function (a) { + (a.languages.flow = a.languages.extend('javascript', {})), + a.languages.insertBefore('flow', 'keyword', { + type: [ + { + pattern: + /\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|any|mixed|null|void)\b/, + alias: 'tag', + }, + ], + }), + (a.languages.flow['function-variable'].pattern = + /(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i), + delete a.languages.flow.parameter, + a.languages.insertBefore('flow', 'operator', { + 'flow-punctuation': { pattern: /\{\||\|\}/, alias: 'punctuation' }, + }), + Array.isArray(a.languages.flow.keyword) || + (a.languages.flow.keyword = [a.languages.flow.keyword]), + a.languages.flow.keyword.unshift( + { + pattern: /(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/, + lookbehind: !0, + }, + { + pattern: + /(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/, + lookbehind: !0, + } + ); +})(Prism); diff --git a/public/prism/prism-fortran.js b/public/prism/prism-fortran.js new file mode 100644 index 0000000..ff2d51c --- /dev/null +++ b/public/prism/prism-fortran.js @@ -0,0 +1,41 @@ +Prism.languages.fortran = { + 'quoted-number': { + pattern: /[BOZ](['"])[A-F0-9]+\1/i, + alias: 'number', + }, + string: { + pattern: + /(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/, + inside: { + comment: { + pattern: /(&(?:\r\n?|\n)\s*)!.*/, + lookbehind: true, + }, + }, + }, + comment: { + pattern: /!.*/, + greedy: true, + }, + boolean: /\.(?:FALSE|TRUE)\.(?:_\w+)?/i, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i, + keyword: [ + // Types + /\b(?:CHARACTER|COMPLEX|DOUBLE ?PRECISION|INTEGER|LOGICAL|REAL)\b/i, + // END statements + /\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i, + // Statements + /\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i, + // Others + /\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEIF|ELSEWHERE|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i, + ], + operator: [ + /\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i, + { + // Use lookbehind to prevent confusion with (/ /) + pattern: /(^|(?!\().)\/(?!\))/, + lookbehind: true, + }, + ], + punctuation: /\(\/|\/\)|[(),;:&]/, +}; diff --git a/public/prism/prism-fortran.min.js b/public/prism/prism-fortran.min.js new file mode 100644 index 0000000..d4e18bf --- /dev/null +++ b/public/prism/prism-fortran.min.js @@ -0,0 +1,22 @@ +Prism.languages.fortran = { + 'quoted-number': { pattern: /[BOZ](['"])[A-F0-9]+\1/i, alias: 'number' }, + string: { + pattern: + /(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/, + inside: { comment: { pattern: /(&(?:\r\n?|\n)\s*)!.*/, lookbehind: !0 } }, + }, + comment: { pattern: /!.*/, greedy: !0 }, + boolean: /\.(?:FALSE|TRUE)\.(?:_\w+)?/i, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i, + keyword: [ + /\b(?:CHARACTER|COMPLEX|DOUBLE ?PRECISION|INTEGER|LOGICAL|REAL)\b/i, + /\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i, + /\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i, + /\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEIF|ELSEWHERE|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i, + ], + operator: [ + /\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i, + { pattern: /(^|(?!\().)\/(?!\))/, lookbehind: !0 }, + ], + punctuation: /\(\/|\/\)|[(),;:&]/, +}; diff --git a/public/prism/prism-fsharp.js b/public/prism/prism-fsharp.js new file mode 100644 index 0000000..35dcfaa --- /dev/null +++ b/public/prism/prism-fsharp.js @@ -0,0 +1,79 @@ +Prism.languages.fsharp = Prism.languages.extend('clike', { + comment: [ + { + pattern: /(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/, + lookbehind: true, + greedy: true, + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true, + }, + ], + string: { + pattern: /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?/, + greedy: true, + }, + 'class-name': { + pattern: + /(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/, + lookbehind: true, + inside: { + operator: /->|\*/, + punctuation: /\./, + }, + }, + keyword: + /\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|asr|assert|atomic|base|begin|break|checked|class|component|const|constraint|constructor|continue|default|delegate|do|done|downcast|downto|eager|elif|else|end|event|exception|extern|external|false|finally|fixed|for|fun|function|functor|global|if|in|include|inherit|inline|interface|internal|land|lazy|lor|lsl|lsr|lxor|match|member|method|mixin|mod|module|mutable|namespace|new|not|null|object|of|open|or|override|parallel|private|process|protected|public|pure|rec|sealed|select|sig|static|struct|tailcall|then|to|trait|true|try|type|upcast|val|virtual|void|volatile|when|while|with)\b/, + number: [ + /\b0x[\da-fA-F]+(?:LF|lf|un)?\b/, + /\b0b[01]+(?:uy|y)?\b/, + /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i, + /\b\d+(?:[IlLsy]|UL|u[lsy]?)?\b/, + ], + operator: + /([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/, +}); +Prism.languages.insertBefore('fsharp', 'keyword', { + preprocessor: { + pattern: /(^[\t ]*)#.*/m, + lookbehind: true, + alias: 'property', + inside: { + directive: { + pattern: /(^#)\b(?:else|endif|if|light|line|nowarn)\b/, + lookbehind: true, + alias: 'keyword', + }, + }, + }, +}); +Prism.languages.insertBefore('fsharp', 'punctuation', { + 'computation-expression': { + pattern: /\b[_a-z]\w*(?=\s*\{)/i, + alias: 'keyword', + }, +}); +Prism.languages.insertBefore('fsharp', 'string', { + annotation: { + pattern: /\[<.+?>\]/, + greedy: true, + inside: { + punctuation: /^\[<|>\]$/, + 'class-name': { + pattern: /^\w+$|(^|;\s*)[A-Z]\w*(?=\()/, + lookbehind: true, + }, + 'annotation-content': { + pattern: /[\s\S]+/, + inside: Prism.languages.fsharp, + }, + }, + }, + char: { + pattern: + /'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/, + greedy: true, + }, +}); diff --git a/public/prism/prism-fsharp.min.js b/public/prism/prism-fsharp.min.js new file mode 100644 index 0000000..eb29569 --- /dev/null +++ b/public/prism/prism-fsharp.min.js @@ -0,0 +1,68 @@ +(Prism.languages.fsharp = Prism.languages.extend('clike', { + comment: [ + { pattern: /(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/, lookbehind: !0, greedy: !0 }, + { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }, + ], + string: { + pattern: /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?/, + greedy: !0, + }, + 'class-name': { + pattern: + /(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/, + lookbehind: !0, + inside: { operator: /->|\*/, punctuation: /\./ }, + }, + keyword: + /\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|asr|assert|atomic|base|begin|break|checked|class|component|const|constraint|constructor|continue|default|delegate|do|done|downcast|downto|eager|elif|else|end|event|exception|extern|external|false|finally|fixed|for|fun|function|functor|global|if|in|include|inherit|inline|interface|internal|land|lazy|lor|lsl|lsr|lxor|match|member|method|mixin|mod|module|mutable|namespace|new|not|null|object|of|open|or|override|parallel|private|process|protected|public|pure|rec|sealed|select|sig|static|struct|tailcall|then|to|trait|true|try|type|upcast|val|virtual|void|volatile|when|while|with)\b/, + number: [ + /\b0x[\da-fA-F]+(?:LF|lf|un)?\b/, + /\b0b[01]+(?:uy|y)?\b/, + /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i, + /\b\d+(?:[IlLsy]|UL|u[lsy]?)?\b/, + ], + operator: + /([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/, +})), + Prism.languages.insertBefore('fsharp', 'keyword', { + preprocessor: { + pattern: /(^[\t ]*)#.*/m, + lookbehind: !0, + alias: 'property', + inside: { + directive: { + pattern: /(^#)\b(?:else|endif|if|light|line|nowarn)\b/, + lookbehind: !0, + alias: 'keyword', + }, + }, + }, + }), + Prism.languages.insertBefore('fsharp', 'punctuation', { + 'computation-expression': { + pattern: /\b[_a-z]\w*(?=\s*\{)/i, + alias: 'keyword', + }, + }), + Prism.languages.insertBefore('fsharp', 'string', { + annotation: { + pattern: /\[<.+?>\]/, + greedy: !0, + inside: { + punctuation: /^\[<|>\]$/, + 'class-name': { + pattern: /^\w+$|(^|;\s*)[A-Z]\w*(?=\()/, + lookbehind: !0, + }, + 'annotation-content': { + pattern: /[\s\S]+/, + inside: Prism.languages.fsharp, + }, + }, + }, + char: { + pattern: + /'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/, + greedy: !0, + }, + }); diff --git a/public/prism/prism-ftl.js b/public/prism/prism-ftl.js new file mode 100644 index 0000000..60ed319 --- /dev/null +++ b/public/prism/prism-ftl.js @@ -0,0 +1,123 @@ +(function (Prism) { + // https://freemarker.apache.org/docs/dgui_template_exp.html + + // FTL expression with 4 levels of nesting supported + var FTL_EXPR = + /[^<()"']|\((?:)*\)|<(?!#--)|<#--(?:[^-]|-(?!->))*-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/ + .source; + for (var i = 0; i < 2; i++) { + FTL_EXPR = FTL_EXPR.replace(//g, function () { + return FTL_EXPR; + }); + } + FTL_EXPR = FTL_EXPR.replace(//g, /[^\s\S]/.source); + + var ftl = { + comment: /<#--[\s\S]*?-->/, + string: [ + { + // raw string + pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/, + greedy: true, + }, + { + pattern: RegExp( + /("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:))*\})*\1/.source.replace( + //g, + function () { + return FTL_EXPR; + } + ) + ), + greedy: true, + inside: { + interpolation: { + pattern: RegExp( + /((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:))*\}/.source.replace( + //g, + function () { + return FTL_EXPR; + } + ) + ), + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation', + }, + rest: null, + }, + }, + }, + }, + ], + keyword: /\b(?:as)\b/, + boolean: /\b(?:false|true)\b/, + 'builtin-function': { + pattern: /((?:^|[^?])\?\s*)\w+/, + lookbehind: true, + alias: 'function', + }, + function: /\b\w+(?=\s*\()/, + number: /\b\d+(?:\.\d+)?\b/, + 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]*/, + alias: 'ftl', + inside: ftl, + }, + }, + }, + 'ftl-interpolation': { + pattern: /^\$\{[\s\S]*\}$/, + inside: { + punctuation: /^\$\{|\}$/, + content: { + pattern: /\s*\S[\s\S]*/, + alias: 'ftl', + inside: ftl, + }, + }, + }, + }; + + Prism.hooks.add('before-tokenize', function (env) { + // eslint-disable-next-line regexp/no-useless-lazy + var pattern = RegExp( + /<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:)*?>|\$\{(?:)*?\}/.source.replace( + //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); diff --git a/public/prism/prism-ftl.min.js b/public/prism/prism-ftl.min.js new file mode 100644 index 0000000..2b1df40 --- /dev/null +++ b/public/prism/prism-ftl.min.js @@ -0,0 +1,100 @@ +!(function (n) { + for ( + var i = + '[^<()"\']|\\((?:)*\\)|<(?!#--)|<#--(?:[^-]|-(?!->))*--\x3e|"(?:[^\\\\"]|\\\\.)*"|\'(?:[^\\\\\']|\\\\.)*\'', + e = 0; + e < 2; + e++ + ) + i = i.replace(//g, function () { + return i; + }); + i = i.replace(//g, '[^\\s\\S]'); + var t = { + comment: /<#--[\s\S]*?-->/, + string: [ + { pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/, greedy: !0 }, + { + pattern: RegExp( + '("|\')(?:(?!\\1|\\$\\{)[^\\\\]|\\\\.|\\$\\{(?:(?!\\})(?:))*\\})*\\1'.replace( + //g, + function () { + return i; + } + ) + ), + greedy: !0, + inside: { + interpolation: { + pattern: RegExp( + '((?:^|[^\\\\])(?:\\\\\\\\)*)\\$\\{(?:(?!\\})(?:))*\\}'.replace( + //g, + function () { + return i; + } + ) + ), + lookbehind: !0, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation', + }, + rest: null, + }, + }, + }, + }, + ], + keyword: /\b(?:as)\b/, + boolean: /\b(?:false|true)\b/, + 'builtin-function': { + pattern: /((?:^|[^?])\?\s*)\w+/, + lookbehind: !0, + alias: 'function', + }, + function: /\b\w+(?=\s*\()/, + number: /\b\d+(?:\.\d+)?\b/, + operator: + /\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/, + punctuation: /[,;.:()[\]{}]/, + }; + (t.string[1].inside.interpolation.inside.rest = t), + (n.languages.ftl = { + 'ftl-comment': { pattern: /^<#--[\s\S]*/, alias: 'comment' }, + 'ftl-directive': { + pattern: /^<[\s\S]+>$/, + inside: { + directive: { + pattern: /(^<\/?)[#@][a-z]\w*/i, + lookbehind: !0, + alias: 'keyword', + }, + punctuation: /^<\/?|\/?>$/, + content: { pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: t }, + }, + }, + 'ftl-interpolation': { + pattern: /^\$\{[\s\S]*\}$/, + inside: { + punctuation: /^\$\{|\}$/, + content: { pattern: /\s*\S[\s\S]*/, alias: 'ftl', inside: t }, + }, + }, + }), + n.hooks.add('before-tokenize', function (e) { + var t = RegExp( + '<#--[^]*?--\x3e|)*?>|\\$\\{(?:)*?\\}'.replace( + //g, + function () { + return i; + } + ), + 'gi' + ); + n.languages['markup-templating'].buildPlaceholders(e, 'ftl', t); + }), + n.hooks.add('after-tokenize', function (e) { + n.languages['markup-templating'].tokenizePlaceholders(e, 'ftl'); + }); +})(Prism); diff --git a/public/prism/prism-gap.js b/public/prism/prism-gap.js new file mode 100644 index 0000000..b45e95f --- /dev/null +++ b/public/prism/prism-gap.js @@ -0,0 +1,57 @@ +// https://www.gap-system.org/Manuals/doc/ref/chap4.html +// https://www.gap-system.org/Manuals/doc/ref/chap27.html + +Prism.languages.gap = { + shell: { + pattern: /^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m, + greedy: true, + inside: { + gap: { + pattern: /^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/, + lookbehind: true, + inside: null, // see below + }, + punctuation: /^gap>/, + }, + }, + + comment: { + pattern: /#.*/, + greedy: true, + }, + string: { + pattern: + /(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/, + lookbehind: true, + greedy: true, + inside: { + continuation: { + pattern: /([\r\n])>/, + lookbehind: true, + alias: 'punctuation', + }, + }, + }, + + keyword: + /\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/, + boolean: /\b(?:false|true)\b/, + + function: /\b[a-z_]\w*(?=\s*\()/i, + + number: { + pattern: + /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/, + lookbehind: true, + }, + + continuation: { + pattern: /([\r\n])>/, + lookbehind: true, + alias: 'punctuation', + }, + operator: /->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./, + punctuation: /[()[\]{},;.:]/, +}; + +Prism.languages.gap.shell.inside.gap.inside = Prism.languages.gap; diff --git a/public/prism/prism-gap.min.js b/public/prism/prism-gap.min.js new file mode 100644 index 0000000..3d2cfb5 --- /dev/null +++ b/public/prism/prism-gap.min.js @@ -0,0 +1,41 @@ +(Prism.languages.gap = { + shell: { + pattern: /^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m, + greedy: !0, + inside: { + gap: { + pattern: /^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/, + lookbehind: !0, + inside: null, + }, + punctuation: /^gap>/, + }, + }, + comment: { pattern: /#.*/, greedy: !0 }, + string: { + pattern: + /(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/, + lookbehind: !0, + greedy: !0, + inside: { + continuation: { + pattern: /([\r\n])>/, + lookbehind: !0, + alias: 'punctuation', + }, + }, + }, + keyword: + /\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/, + boolean: /\b(?:false|true)\b/, + function: /\b[a-z_]\w*(?=\s*\()/i, + number: { + pattern: + /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/, + lookbehind: !0, + }, + continuation: { pattern: /([\r\n])>/, lookbehind: !0, alias: 'punctuation' }, + operator: /->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./, + punctuation: /[()[\]{},;.:]/, +}), + (Prism.languages.gap.shell.inside.gap.inside = Prism.languages.gap); diff --git a/public/prism/prism-gcode.js b/public/prism/prism-gcode.js new file mode 100644 index 0000000..a411268 --- /dev/null +++ b/public/prism/prism-gcode.js @@ -0,0 +1,16 @@ +Prism.languages.gcode = { + comment: /;.*|\B\(.*?\)\B/, + string: { + pattern: /"(?:""|[^"])*"/, + greedy: true, + }, + keyword: /\b[GM]\d+(?:\.\d+)?\b/, + property: /\b[A-Z]/, + checksum: { + pattern: /(\*)\d+/, + lookbehind: true, + alias: 'number', + }, + // T0:0:0 + punctuation: /[:*]/, +}; diff --git a/public/prism/prism-gcode.min.js b/public/prism/prism-gcode.min.js new file mode 100644 index 0000000..3cb79a5 --- /dev/null +++ b/public/prism/prism-gcode.min.js @@ -0,0 +1,8 @@ +Prism.languages.gcode = { + comment: /;.*|\B\(.*?\)\B/, + string: { pattern: /"(?:""|[^"])*"/, greedy: !0 }, + keyword: /\b[GM]\d+(?:\.\d+)?\b/, + property: /\b[A-Z]/, + checksum: { pattern: /(\*)\d+/, lookbehind: !0, alias: 'number' }, + punctuation: /[:*]/, +}; diff --git a/public/prism/prism-gdscript.js b/public/prism/prism-gdscript.js new file mode 100644 index 0000000..669b8c6 --- /dev/null +++ b/public/prism/prism-gdscript.js @@ -0,0 +1,30 @@ +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|class_name|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: /\b[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: /[.:,;()[\]{}]/, +}; diff --git a/public/prism/prism-gdscript.min.js b/public/prism/prism-gdscript.min.js new file mode 100644 index 0000000..99ebe3b --- /dev/null +++ b/public/prism/prism-gdscript.min.js @@ -0,0 +1,25 @@ +Prism.languages.gdscript = { + comment: /#.*/, + string: { + pattern: + /@?(?:("|')(?:(?!\1)[^\n\\]|\\[\s\S])*\1(?!"|')|"""(?:[^\\]|\\[\s\S])*?""")/, + greedy: !0, + }, + 'class-name': { + pattern: + /(^(?:class|class_name|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m, + lookbehind: !0, + }, + 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: /\b[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: /[.:,;()[\]{}]/, +}; diff --git a/public/prism/prism-gedcom.js b/public/prism/prism-gedcom.js new file mode 100644 index 0000000..9819c04 --- /dev/null +++ b/public/prism/prism-gedcom.js @@ -0,0 +1,30 @@ +Prism.languages.gedcom = { + 'line-value': { + // Preceded by level, optional pointer, and tag + pattern: + /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m, + lookbehind: true, + inside: { + pointer: { + pattern: /^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/, + alias: 'variable', + }, + }, + }, + tag: { + // Preceded by level and optional pointer + pattern: + /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m, + lookbehind: true, + alias: 'string', + }, + level: { + pattern: /(^[\t ]*)\d+/m, + lookbehind: true, + alias: 'number', + }, + pointer: { + pattern: /@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/, + alias: 'variable', + }, +}; diff --git a/public/prism/prism-gedcom.min.js b/public/prism/prism-gedcom.min.js new file mode 100644 index 0000000..f8d5912 --- /dev/null +++ b/public/prism/prism-gedcom.min.js @@ -0,0 +1,24 @@ +Prism.languages.gedcom = { + 'line-value': { + pattern: + /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m, + lookbehind: !0, + inside: { + pointer: { + pattern: /^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/, + alias: 'variable', + }, + }, + }, + tag: { + pattern: + /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m, + lookbehind: !0, + alias: 'string', + }, + level: { pattern: /(^[\t ]*)\d+/m, lookbehind: !0, alias: 'number' }, + pointer: { + pattern: /@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/, + alias: 'variable', + }, +}; diff --git a/public/prism/prism-gherkin.js b/public/prism/prism-gherkin.js new file mode 100644 index 0000000..939f9e4 --- /dev/null +++ b/public/prism/prism-gherkin.js @@ -0,0 +1,86 @@ +(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|Lastnost|Mak|Mogucnost|laH|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|Potrzeba biznesowa|perbogh|poQbogh malja'|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?\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|EXAMPLZ|Examples|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|Grundlage|Hannergrond|ghantoH|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 chovnatlh|lut|lutmey|Lýsing Atburðarásar|Lýsing Dæma|MISHUN SRSLY|MISHUN|Menggariskan Senario|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 Deskripsyon|Senaryo deskripsyon|Senaryo|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie Uiteensetting|Situasie|Skenario konsep|Skenario|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa hwaer swa|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]+)(?:'a|'ach|'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|Cand|Cando|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|DEN|Dato|De|Den youse gotta|Dengan|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|E|En|Entonces|Epi|É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|Kad|Kada|Kadar|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|Ma|Majd|Maka|Manawa|Mas|Men|Menawa|Mutta|Nalika|Nalikaning|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Och|Og|Oletetaan|Ond|Onda|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|Quan|Quand|Quando|qaSDI'|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|Un|Und|ugeholl|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|Zadan|Zadani|Zadano|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', + }, + }; +})(Prism); diff --git a/public/prism/prism-gherkin.min.js b/public/prism/prism-gherkin.min.js new file mode 100644 index 0000000..14fb884 --- /dev/null +++ b/public/prism/prism-gherkin.min.js @@ -0,0 +1,52 @@ +!(function (a) { + var n = '(?:\r?\n|\r)[ \t]*\\|.+\\|(?:(?!\\|).)*'; + Prism.languages.gherkin = { + pystring: { pattern: /("""|''')[\s\S]+?\1/, alias: 'string' }, + comment: { pattern: /(^[ \t]*)#.*/m, lookbehind: !0 }, + tag: { pattern: /(^[ \t]*)@\S*/m, lookbehind: !0 }, + 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|Lastnost|Mak|Mogucnost|laH|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|Potrzeba biznesowa|perbogh|poQbogh malja'|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?\n|\r|$))*/, + lookbehind: !0, + inside: { + important: { pattern: /(:)[^\r\n]+/, lookbehind: !0 }, + 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|EXAMPLZ|Examples|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|Grundlage|Hannergrond|ghantoH|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 chovnatlh|lut|lutmey|Lýsing Atburðarásar|Lýsing Dæma|MISHUN SRSLY|MISHUN|Menggariskan Senario|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 Deskripsyon|Senaryo deskripsyon|Senaryo|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie Uiteensetting|Situasie|Skenario konsep|Skenario|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa hwaer swa|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: !0, + inside: { + important: { pattern: /(:)[^\r\n]*/, lookbehind: !0 }, + keyword: /[^:\r\n]+:/, + }, + }, + 'table-body': { + pattern: RegExp('(' + n + ')(?:' + n + ')+'), + lookbehind: !0, + inside: { + outline: { pattern: /<[^>]+>/, alias: 'variable' }, + td: { pattern: /\s*[^\s|][^|]*/, alias: 'string' }, + punctuation: /\|/, + }, + }, + 'table-head': { + pattern: RegExp(n), + inside: { + th: { pattern: /\s*[^\s|][^|]*/, alias: 'variable' }, + punctuation: /\|/, + }, + }, + atrule: { + pattern: + /(^[ \t]+)(?:'a|'ach|'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|Cand|Cando|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|DEN|Dato|De|Den youse gotta|Dengan|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|E|En|Entonces|Epi|É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|Kad|Kada|Kadar|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|Ma|Majd|Maka|Manawa|Mas|Men|Menawa|Mutta|Nalika|Nalikaning|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Och|Og|Oletetaan|Ond|Onda|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|Quan|Quand|Quando|qaSDI'|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|Un|Und|ugeholl|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|Zadan|Zadani|Zadano|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m, + lookbehind: !0, + }, + string: { + pattern: /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/, + inside: { outline: { pattern: /<[^>]+>/, alias: 'variable' } }, + }, + outline: { pattern: /<[^>]+>/, alias: 'variable' }, + }; +})(); diff --git a/public/prism/prism-git.js b/public/prism/prism-git.js new file mode 100644 index 0000000..bdcced2 --- /dev/null +++ b/public/prism/prism-git.js @@ -0,0 +1,68 @@ +Prism.languages.git = { + /* + * A simple one line comment like in a git status command + * For instance: + * $ git status + * # On branch infinite-scroll + * # Your branch and 'origin/sharedBranches/frontendTeam/infinite-scroll' have diverged, + * # and have 1 and 2 different commits each, respectively. + * nothing to commit (working directory clean) + */ + comment: /^#.*/m, + + /* + * Regexp to match the changed lines in a git diff output. Check the example below. + */ + deleted: /^[-–].*/m, + inserted: /^\+.*/m, + + /* + * a string (double and simple quote) + */ + string: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + + /* + * a git command. It starts with a random prompt finishing by a $, then "git" then some other parameters + * For instance: + * $ git add file.txt + */ + command: { + pattern: /^.*\$ git .*$/m, + inside: { + /* + * A git command can contain a parameter starting by a single or a double dash followed by a string + * For instance: + * $ git diff --cached + * $ git log -p + */ + parameter: /\s--?\w+/, + }, + }, + + /* + * Coordinates displayed in a git diff command + * For instance: + * $ git diff + * diff --git file.txt file.txt + * index 6214953..1d54a52 100644 + * --- file.txt + * +++ file.txt + * @@ -1 +1,2 @@ + * -Here's my tetx file + * +Here's my text file + * +And this is the second line + */ + coord: /^@@.*@@$/m, + + /* + * Match a "commit [SHA1]" line in a git log output. + * For instance: + * $ git log + * commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09 + * Author: lgiraudel + * Date: Mon Feb 17 11:18:34 2014 +0100 + * + * Add of a new line + */ + 'commit-sha1': /^commit \w{40}$/m, +}; diff --git a/public/prism/prism-git.min.js b/public/prism/prism-git.min.js new file mode 100644 index 0000000..502dd0e --- /dev/null +++ b/public/prism/prism-git.min.js @@ -0,0 +1,9 @@ +Prism.languages.git = { + comment: /^#.*/m, + deleted: /^[-–].*/m, + inserted: /^\+.*/m, + string: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, + command: { pattern: /^.*\$ git .*$/m, inside: { parameter: /\s--?\w+/ } }, + coord: /^@@.*@@$/m, + 'commit-sha1': /^commit \w{40}$/m, +}; diff --git a/public/prism/prism-glsl.js b/public/prism/prism-glsl.js new file mode 100644 index 0000000..1170c60 --- /dev/null +++ b/public/prism/prism-glsl.js @@ -0,0 +1,4 @@ +Prism.languages.glsl = Prism.languages.extend('c', { + keyword: + /\b(?:active|asm|atomic_uint|attribute|[ibdu]?vec[234]|bool|break|buffer|case|cast|centroid|class|coherent|common|const|continue|d?mat[234](?:x[234])?|default|discard|do|double|else|enum|extern|external|false|filter|fixed|flat|float|for|fvec[234]|goto|half|highp|hvec[234]|[iu]?sampler2DMS(?:Array)?|[iu]?sampler2DRect|[iu]?samplerBuffer|[iu]?samplerCube|[iu]?samplerCubeArray|[iu]?sampler[123]D|[iu]?sampler[12]DArray|[iu]?image2DMS(?:Array)?|[iu]?image2DRect|[iu]?imageBuffer|[iu]?imageCube|[iu]?imageCubeArray|[iu]?image[123]D|[iu]?image[12]DArray|if|in|inline|inout|input|int|interface|invariant|layout|long|lowp|mediump|namespace|noinline|noperspective|out|output|partition|patch|precise|precision|public|readonly|resource|restrict|return|sample|sampler[12]DArrayShadow|sampler[12]DShadow|sampler2DRectShadow|sampler3DRect|samplerCubeArrayShadow|samplerCubeShadow|shared|short|sizeof|smooth|static|struct|subroutine|superp|switch|template|this|true|typedef|uint|uniform|union|unsigned|using|varying|void|volatile|while|writeonly)\b/, +}); diff --git a/public/prism/prism-glsl.min.js b/public/prism/prism-glsl.min.js new file mode 100644 index 0000000..1170c60 --- /dev/null +++ b/public/prism/prism-glsl.min.js @@ -0,0 +1,4 @@ +Prism.languages.glsl = Prism.languages.extend('c', { + keyword: + /\b(?:active|asm|atomic_uint|attribute|[ibdu]?vec[234]|bool|break|buffer|case|cast|centroid|class|coherent|common|const|continue|d?mat[234](?:x[234])?|default|discard|do|double|else|enum|extern|external|false|filter|fixed|flat|float|for|fvec[234]|goto|half|highp|hvec[234]|[iu]?sampler2DMS(?:Array)?|[iu]?sampler2DRect|[iu]?samplerBuffer|[iu]?samplerCube|[iu]?samplerCubeArray|[iu]?sampler[123]D|[iu]?sampler[12]DArray|[iu]?image2DMS(?:Array)?|[iu]?image2DRect|[iu]?imageBuffer|[iu]?imageCube|[iu]?imageCubeArray|[iu]?image[123]D|[iu]?image[12]DArray|if|in|inline|inout|input|int|interface|invariant|layout|long|lowp|mediump|namespace|noinline|noperspective|out|output|partition|patch|precise|precision|public|readonly|resource|restrict|return|sample|sampler[12]DArrayShadow|sampler[12]DShadow|sampler2DRectShadow|sampler3DRect|samplerCubeArrayShadow|samplerCubeShadow|shared|short|sizeof|smooth|static|struct|subroutine|superp|switch|template|this|true|typedef|uint|uniform|union|unsigned|using|varying|void|volatile|while|writeonly)\b/, +}); diff --git a/public/prism/prism-gml.js b/public/prism/prism-gml.js new file mode 100644 index 0000000..3bf9be8 --- /dev/null +++ b/public/prism/prism-gml.js @@ -0,0 +1,13 @@ +Prism.languages.gamemakerlanguage = Prism.languages.gml = + Prism.languages.extend('clike', { + keyword: + /\b(?:break|case|continue|default|do|else|enum|exit|for|globalvar|if|repeat|return|switch|until|var|while)\b/, + number: + /(?:\b0x[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ulf]{0,4}/i, + operator: + /--|\+\+|[-+%/=]=?|!=|\*\*?=?|<[<=>]?|>[=>]?|&&?|\^\^?|\|\|?|~|\b(?:and|at|not|or|with|xor)\b/, + constant: + /\b(?:GM_build_date|GM_version|action_(?:continue|restart|reverse|stop)|all|gamespeed_(?:fps|microseconds)|global|local|noone|other|pi|pointer_(?:invalid|null)|self|timezone_(?:local|utc)|undefined|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|post|pre)|keypress|keyrelease|trigger|(?:left|middle|no|right)_button|(?:left|middle|right)_press|(?:left|middle|right)_release|mouse_(?:enter|leave|wheel_down|wheel_up)|global_(?:left|middle|right)_button|global_(?:left|middle|right)_press|global_(?:left|middle|right)_release|joystick(?:1|2)_(?:button1|button2|button3|button4|button5|button6|button7|button8|down|left|right|up)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|gui|gui_begin|gui_end|step_(?:begin|end|normal))|vk_(?:alt|anykey|backspace|control|delete|down|end|enter|escape|home|insert|left|nokey|pagedown|pageup|pause|printscreen|return|right|shift|space|tab|up|f\d|numpad\d|add|decimal|divide|lalt|lcontrol|lshift|multiply|ralt|rcontrol|rshift|subtract)|achievement_(?:filter_(?:all_players|favorites_only|friends_only)|friends_info|info|leaderboard_info|our_info|pic_loaded|show_(?:achievement|bank|friend_picker|leaderboard|profile|purchase_prompt|ui)|type_challenge|type_score_challenge)|asset_(?:font|object|path|room|script|shader|sound|sprite|tiles|timeline|unknown)|audio_(?:3d|falloff_(?:exponent_distance|exponent_distance_clamped|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|none)|mono|new_system|old_system|stereo)|bm_(?:add|complex|dest_alpha|dest_color|dest_colour|inv_dest_alpha|inv_dest_color|inv_dest_colour|inv_src_alpha|inv_src_color|inv_src_colour|max|normal|one|src_alpha|src_alpha_sat|src_color|src_colour|subtract|zero)|browser_(?:chrome|firefox|ie|ie_mobile|not_a_browser|opera|safari|safari_mobile|tizen|unknown|windows_store)|buffer_(?:bool|f16|f32|f64|fast|fixed|generalerror|grow|invalidtype|network|outofbounds|outofspace|s16|s32|s8|seek_end|seek_relative|seek_start|string|text|u16|u32|u64|u8|vbuffer|wrap)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)|cmpfunc_(?:always|equal|greater|greaterequal|less|lessequal|never|notequal)|cr_(?:appstart|arrow|beam|cross|default|drag|handpoint|hourglass|none|size_all|size_nesw|size_ns|size_nwse|size_we|uparrow)|cull_(?:clockwise|counterclockwise|noculling)|device_(?:emulator|tablet)|device_ios_(?:ipad|ipad_retina|iphone|iphone5|iphone6|iphone6plus|iphone_retina|unknown)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|dll_(?:cdecl|cdel|stdcall)|ds_type_(?:grid|list|map|priority|queue|stack)|ef_(?:cloud|ellipse|explosion|firework|flare|rain|ring|smoke|smokeup|snow|spark|star)|fa_(?:archive|bottom|center|directory|hidden|left|middle|readonly|right|sysfile|top|volumeid)|fb_login_(?:default|fallback_to_webview|forcing_safari|forcing_webview|no_fallback_to_webview|use_system_account)|iap_(?:available|canceled|ev_consume|ev_product|ev_purchase|ev_restore|ev_storeload|failed|purchased|refunded|status_available|status_loading|status_processing|status_restoring|status_unavailable|status_uninitialised|storeload_failed|storeload_ok|unavailable)|leaderboard_type_(?:number|time_mins_secs)|lighttype_(?:dir|point)|matrix_(?:projection|view|world)|mb_(?:any|left|middle|none|right)|network_(?:config_(?:connect_timeout|disable_reliable_udp|enable_reliable_udp|use_non_blocking_socket)|socket_(?:bluetooth|tcp|udp)|type_(?:connect|data|disconnect|non_blocking_connect))|of_challenge_(?:lose|tie|win)|os_(?:android|ios|linux|macosx|ps3|ps4|psvita|unknown|uwp|win32|win8native|windows|winphone|xboxone)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|angle|angle_limits|damping_ratio|frequency|length_1|length_2|lower_angle_limit|max_force|max_length|max_motor_force|max_motor_torque|max_torque|motor_force|motor_speed|motor_torque|reaction_force_x|reaction_force_y|reaction_torque|speed|translation|upper_angle_limit)|phy_particle_data_flag_(?:category|color|colour|position|typeflags|velocity)|phy_particle_flag_(?:colormixing|colourmixing|elastic|powder|spring|tensile|viscous|wall|water|zombie)|phy_particle_group_flag_(?:rigid|solid)|pr_(?:linelist|linestrip|pointlist|trianglefan|trianglelist|trianglestrip)|ps_(?:distr|shape)_(?:diamond|ellipse|gaussian|invgaussian|line|linear|rectangle)|pt_shape_(?:circle|cloud|disk|explosion|flare|line|pixel|ring|smoke|snow|spark|sphere|square|star)|ty_(?:real|string)|gp_(?:face\d|axislh|axislv|axisrh|axisrv|padd|padl|padr|padu|select|shoulderl|shoulderlb|shoulderr|shoulderrb|start|stickl|stickr)|lb_disp_(?:none|numeric|time_ms|time_sec)|lb_sort_(?:ascending|descending|none)|ov_(?:achievements|community|friends|gamegroup|players|settings)|ugc_(?:filetype_(?:community|microtrans)|list_(?:Favorited|Followed|Published|Subscribed|UsedOrPlayed|VotedDown|VotedOn|VotedUp|WillVoteLater)|match_(?:AllGuides|Artwork|Collections|ControllerBindings|IntegratedGuides|Items|Items_Mtx|Items_ReadyToUse|Screenshots|UsableInGame|Videos|WebGuides)|query_(?:AcceptedForGameRankedByAcceptanceDate|CreatedByFriendsRankedByPublicationDate|FavoritedByFriendsRankedByPublicationDate|NotYetRated)|query_RankedBy(?:NumTimesReported|PublicationDate|TextSearch|TotalVotesAsc|Trend|Vote|VotesUp)|result_success|sortorder_CreationOrder(?:Asc|Desc)|sortorder_(?:ForModeration|LastUpdatedDesc|SubscriptionDateDesc|TitleAsc|VoteScoreDesc)|visibility_(?:friends_only|private|public))|vertex_usage_(?:binormal|blendindices|blendweight|color|colour|depth|fog|normal|position|psize|sample|tangent|texcoord|textcoord)|vertex_type_(?:float\d|color|colour|ubyte4)|input_type|layerelementtype_(?:background|instance|oldtilemap|particlesystem|sprite|tile|tilemap|undefined)|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|tile_(?:flip|index_mask|mirror|rotate)|(?:obj|rm|scr|spr)\w+)\b/, + variable: + /\b(?:alarm|application_surface|async_load|background_(?:alpha|blend|color|colour|foreground|height|hspeed|htiled|index|showcolor|showcolour|visible|vspeed|vtiled|width|x|xscale|y|yscale)|bbox_(?:bottom|left|right|top)|browser_(?:height|width)|caption_(?:health|lives|score)|current_(?:day|hour|minute|month|second|time|weekday|year)|cursor_sprite|debug_mode|delta_time|direction|display_aa|error_(?:last|occurred)|event_(?:action|number|object|type)|fps|fps_real|friction|game_(?:display|project|save)_(?:id|name)|gamemaker_(?:pro|registered|version)|gravity|gravity_direction|(?:h|v)speed|health|iap_data|id|image_(?:alpha|angle|blend|depth|index|number|speed|xscale|yscale)|instance_(?:count|id)|keyboard_(?:key|lastchar|lastkey|string)|layer|lives|mask_index|mouse_(?:button|lastbutton|x|y)|object_index|os_(?:browser|device|type|version)|path_(?:endaction|index|orientation|position|positionprevious|scale|speed)|persistent|phy_(?:rotation|(?:col_normal|collision|com|linear_velocity|position|speed)_(?:x|y)|angular_(?:damping|velocity)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|pointer_(?:invalid|null)|room|room_(?:caption|first|height|last|persistent|speed|width)|score|secure_mode|show_(?:health|lives|score)|solid|speed|sprite_(?:height|index|width|xoffset|yoffset)|temp_directory|timeline_(?:index|loop|position|running|speed)|transition_(?:color|kind|steps)|undefined|view_(?:angle|current|enabled|(?:h|v)(?:border|speed)|(?:h|w|x|y)port|(?:h|w|x|y)view|object|surface_id|visible)|visible|webgl_enabled|working_directory|(?:x|y)(?:previous|start)|x|y|argument(?:_relitive|_count|\d)|argument|global|local|other|self)\b/, + }); diff --git a/public/prism/prism-gml.min.js b/public/prism/prism-gml.min.js new file mode 100644 index 0000000..3bf9be8 --- /dev/null +++ b/public/prism/prism-gml.min.js @@ -0,0 +1,13 @@ +Prism.languages.gamemakerlanguage = Prism.languages.gml = + Prism.languages.extend('clike', { + keyword: + /\b(?:break|case|continue|default|do|else|enum|exit|for|globalvar|if|repeat|return|switch|until|var|while)\b/, + number: + /(?:\b0x[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ulf]{0,4}/i, + operator: + /--|\+\+|[-+%/=]=?|!=|\*\*?=?|<[<=>]?|>[=>]?|&&?|\^\^?|\|\|?|~|\b(?:and|at|not|or|with|xor)\b/, + constant: + /\b(?:GM_build_date|GM_version|action_(?:continue|restart|reverse|stop)|all|gamespeed_(?:fps|microseconds)|global|local|noone|other|pi|pointer_(?:invalid|null)|self|timezone_(?:local|utc)|undefined|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|post|pre)|keypress|keyrelease|trigger|(?:left|middle|no|right)_button|(?:left|middle|right)_press|(?:left|middle|right)_release|mouse_(?:enter|leave|wheel_down|wheel_up)|global_(?:left|middle|right)_button|global_(?:left|middle|right)_press|global_(?:left|middle|right)_release|joystick(?:1|2)_(?:button1|button2|button3|button4|button5|button6|button7|button8|down|left|right|up)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|gui|gui_begin|gui_end|step_(?:begin|end|normal))|vk_(?:alt|anykey|backspace|control|delete|down|end|enter|escape|home|insert|left|nokey|pagedown|pageup|pause|printscreen|return|right|shift|space|tab|up|f\d|numpad\d|add|decimal|divide|lalt|lcontrol|lshift|multiply|ralt|rcontrol|rshift|subtract)|achievement_(?:filter_(?:all_players|favorites_only|friends_only)|friends_info|info|leaderboard_info|our_info|pic_loaded|show_(?:achievement|bank|friend_picker|leaderboard|profile|purchase_prompt|ui)|type_challenge|type_score_challenge)|asset_(?:font|object|path|room|script|shader|sound|sprite|tiles|timeline|unknown)|audio_(?:3d|falloff_(?:exponent_distance|exponent_distance_clamped|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|none)|mono|new_system|old_system|stereo)|bm_(?:add|complex|dest_alpha|dest_color|dest_colour|inv_dest_alpha|inv_dest_color|inv_dest_colour|inv_src_alpha|inv_src_color|inv_src_colour|max|normal|one|src_alpha|src_alpha_sat|src_color|src_colour|subtract|zero)|browser_(?:chrome|firefox|ie|ie_mobile|not_a_browser|opera|safari|safari_mobile|tizen|unknown|windows_store)|buffer_(?:bool|f16|f32|f64|fast|fixed|generalerror|grow|invalidtype|network|outofbounds|outofspace|s16|s32|s8|seek_end|seek_relative|seek_start|string|text|u16|u32|u64|u8|vbuffer|wrap)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)|cmpfunc_(?:always|equal|greater|greaterequal|less|lessequal|never|notequal)|cr_(?:appstart|arrow|beam|cross|default|drag|handpoint|hourglass|none|size_all|size_nesw|size_ns|size_nwse|size_we|uparrow)|cull_(?:clockwise|counterclockwise|noculling)|device_(?:emulator|tablet)|device_ios_(?:ipad|ipad_retina|iphone|iphone5|iphone6|iphone6plus|iphone_retina|unknown)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|dll_(?:cdecl|cdel|stdcall)|ds_type_(?:grid|list|map|priority|queue|stack)|ef_(?:cloud|ellipse|explosion|firework|flare|rain|ring|smoke|smokeup|snow|spark|star)|fa_(?:archive|bottom|center|directory|hidden|left|middle|readonly|right|sysfile|top|volumeid)|fb_login_(?:default|fallback_to_webview|forcing_safari|forcing_webview|no_fallback_to_webview|use_system_account)|iap_(?:available|canceled|ev_consume|ev_product|ev_purchase|ev_restore|ev_storeload|failed|purchased|refunded|status_available|status_loading|status_processing|status_restoring|status_unavailable|status_uninitialised|storeload_failed|storeload_ok|unavailable)|leaderboard_type_(?:number|time_mins_secs)|lighttype_(?:dir|point)|matrix_(?:projection|view|world)|mb_(?:any|left|middle|none|right)|network_(?:config_(?:connect_timeout|disable_reliable_udp|enable_reliable_udp|use_non_blocking_socket)|socket_(?:bluetooth|tcp|udp)|type_(?:connect|data|disconnect|non_blocking_connect))|of_challenge_(?:lose|tie|win)|os_(?:android|ios|linux|macosx|ps3|ps4|psvita|unknown|uwp|win32|win8native|windows|winphone|xboxone)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|angle|angle_limits|damping_ratio|frequency|length_1|length_2|lower_angle_limit|max_force|max_length|max_motor_force|max_motor_torque|max_torque|motor_force|motor_speed|motor_torque|reaction_force_x|reaction_force_y|reaction_torque|speed|translation|upper_angle_limit)|phy_particle_data_flag_(?:category|color|colour|position|typeflags|velocity)|phy_particle_flag_(?:colormixing|colourmixing|elastic|powder|spring|tensile|viscous|wall|water|zombie)|phy_particle_group_flag_(?:rigid|solid)|pr_(?:linelist|linestrip|pointlist|trianglefan|trianglelist|trianglestrip)|ps_(?:distr|shape)_(?:diamond|ellipse|gaussian|invgaussian|line|linear|rectangle)|pt_shape_(?:circle|cloud|disk|explosion|flare|line|pixel|ring|smoke|snow|spark|sphere|square|star)|ty_(?:real|string)|gp_(?:face\d|axislh|axislv|axisrh|axisrv|padd|padl|padr|padu|select|shoulderl|shoulderlb|shoulderr|shoulderrb|start|stickl|stickr)|lb_disp_(?:none|numeric|time_ms|time_sec)|lb_sort_(?:ascending|descending|none)|ov_(?:achievements|community|friends|gamegroup|players|settings)|ugc_(?:filetype_(?:community|microtrans)|list_(?:Favorited|Followed|Published|Subscribed|UsedOrPlayed|VotedDown|VotedOn|VotedUp|WillVoteLater)|match_(?:AllGuides|Artwork|Collections|ControllerBindings|IntegratedGuides|Items|Items_Mtx|Items_ReadyToUse|Screenshots|UsableInGame|Videos|WebGuides)|query_(?:AcceptedForGameRankedByAcceptanceDate|CreatedByFriendsRankedByPublicationDate|FavoritedByFriendsRankedByPublicationDate|NotYetRated)|query_RankedBy(?:NumTimesReported|PublicationDate|TextSearch|TotalVotesAsc|Trend|Vote|VotesUp)|result_success|sortorder_CreationOrder(?:Asc|Desc)|sortorder_(?:ForModeration|LastUpdatedDesc|SubscriptionDateDesc|TitleAsc|VoteScoreDesc)|visibility_(?:friends_only|private|public))|vertex_usage_(?:binormal|blendindices|blendweight|color|colour|depth|fog|normal|position|psize|sample|tangent|texcoord|textcoord)|vertex_type_(?:float\d|color|colour|ubyte4)|input_type|layerelementtype_(?:background|instance|oldtilemap|particlesystem|sprite|tile|tilemap|undefined)|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|tile_(?:flip|index_mask|mirror|rotate)|(?:obj|rm|scr|spr)\w+)\b/, + variable: + /\b(?:alarm|application_surface|async_load|background_(?:alpha|blend|color|colour|foreground|height|hspeed|htiled|index|showcolor|showcolour|visible|vspeed|vtiled|width|x|xscale|y|yscale)|bbox_(?:bottom|left|right|top)|browser_(?:height|width)|caption_(?:health|lives|score)|current_(?:day|hour|minute|month|second|time|weekday|year)|cursor_sprite|debug_mode|delta_time|direction|display_aa|error_(?:last|occurred)|event_(?:action|number|object|type)|fps|fps_real|friction|game_(?:display|project|save)_(?:id|name)|gamemaker_(?:pro|registered|version)|gravity|gravity_direction|(?:h|v)speed|health|iap_data|id|image_(?:alpha|angle|blend|depth|index|number|speed|xscale|yscale)|instance_(?:count|id)|keyboard_(?:key|lastchar|lastkey|string)|layer|lives|mask_index|mouse_(?:button|lastbutton|x|y)|object_index|os_(?:browser|device|type|version)|path_(?:endaction|index|orientation|position|positionprevious|scale|speed)|persistent|phy_(?:rotation|(?:col_normal|collision|com|linear_velocity|position|speed)_(?:x|y)|angular_(?:damping|velocity)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|pointer_(?:invalid|null)|room|room_(?:caption|first|height|last|persistent|speed|width)|score|secure_mode|show_(?:health|lives|score)|solid|speed|sprite_(?:height|index|width|xoffset|yoffset)|temp_directory|timeline_(?:index|loop|position|running|speed)|transition_(?:color|kind|steps)|undefined|view_(?:angle|current|enabled|(?:h|v)(?:border|speed)|(?:h|w|x|y)port|(?:h|w|x|y)view|object|surface_id|visible)|visible|webgl_enabled|working_directory|(?:x|y)(?:previous|start)|x|y|argument(?:_relitive|_count|\d)|argument|global|local|other|self)\b/, + }); diff --git a/public/prism/prism-gn.js b/public/prism/prism-gn.js new file mode 100644 index 0000000..5c5c3d0 --- /dev/null +++ b/public/prism/prism-gn.js @@ -0,0 +1,56 @@ +// https://gn.googlesource.com/gn/+/refs/heads/main/docs/reference.md#grammar + +Prism.languages.gn = { + comment: { + pattern: /#.*/, + greedy: true, + }, + 'string-literal': { + pattern: /(^|[^\\"])"(?:[^\r\n"\\]|\\.)*"/, + lookbehind: true, + greedy: true, + inside: { + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$(?:\{[\s\S]*?\}|[a-zA-Z_]\w*|0x[a-fA-F0-9]{2})/, + lookbehind: true, + inside: { + number: /^\$0x[\s\S]{2}$/, + variable: /^\$\w+$/, + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation', + }, + expression: { + pattern: /[\s\S]+/, + inside: null, // see below + }, + }, + }, + string: /[\s\S]+/, + }, + }, + + keyword: /\b(?:else|if)\b/, + boolean: /\b(?:false|true)\b/, + 'builtin-function': { + // a few functions get special highlighting to improve readability + 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; 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); diff --git a/public/prism/prism-go-module.js b/public/prism/prism-go-module.js new file mode 100644 index 0000000..b0833d6 --- /dev/null +++ b/public/prism/prism-go-module.js @@ -0,0 +1,24 @@ +// https://go.dev/ref/mod#go-mod-file-module + +Prism.languages['go-mod'] = Prism.languages['go-module'] = { + comment: { + pattern: /\/\/.*/, + greedy: true, + }, + version: { + pattern: /(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/, + lookbehind: true, + alias: 'number', + }, + 'go-version': { + pattern: /((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/, + lookbehind: true, + alias: 'number', + }, + keyword: { + pattern: /^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m, + lookbehind: true, + }, + operator: /=>/, + punctuation: /[()[\],]/, +}; diff --git a/public/prism/prism-go-module.min.js b/public/prism/prism-go-module.min.js new file mode 100644 index 0000000..4bb1d74 --- /dev/null +++ b/public/prism/prism-go-module.min.js @@ -0,0 +1,19 @@ +Prism.languages['go-mod'] = Prism.languages['go-module'] = { + comment: { pattern: /\/\/.*/, greedy: !0 }, + version: { + pattern: /(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/, + lookbehind: !0, + alias: 'number', + }, + 'go-version': { + pattern: /((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/, + lookbehind: !0, + alias: 'number', + }, + keyword: { + pattern: /^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m, + lookbehind: !0, + }, + operator: /=>/, + punctuation: /[()[\],]/, +}; diff --git a/public/prism/prism-go.js b/public/prism/prism-go.js new file mode 100644 index 0000000..213ac7b --- /dev/null +++ b/public/prism/prism-go.js @@ -0,0 +1,31 @@ +Prism.languages.go = Prism.languages.extend('clike', { + string: { + pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/, + lookbehind: true, + greedy: true, + }, + keyword: + /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/, + boolean: /\b(?:_|false|iota|nil|true)\b/, + number: [ + // binary and octal integers + /\b0(?:b[01_]+|o[0-7_]+)i?\b/i, + // hexadecimal integers and floats + /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i, + // decimal integers and floats + /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i, + ], + operator: + /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, + builtin: + /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/, +}); + +Prism.languages.insertBefore('go', 'string', { + char: { + pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/, + greedy: true, + }, +}); + +delete Prism.languages.go['class-name']; diff --git a/public/prism/prism-go.min.js b/public/prism/prism-go.min.js new file mode 100644 index 0000000..5f6a183 --- /dev/null +++ b/public/prism/prism-go.min.js @@ -0,0 +1,23 @@ +(Prism.languages.go = Prism.languages.extend('clike', { + string: { + pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/, + lookbehind: !0, + greedy: !0, + }, + keyword: + /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/, + boolean: /\b(?:_|false|iota|nil|true)\b/, + number: [ + /\b0(?:b[01_]+|o[0-7_]+)i?\b/i, + /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i, + /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i, + ], + operator: + /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, + builtin: + /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/, +})), + Prism.languages.insertBefore('go', 'string', { + char: { pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/, greedy: !0 }, + }), + delete Prism.languages.go['class-name']; diff --git a/public/prism/prism-graphql.js b/public/prism/prism-graphql.js new file mode 100644 index 0000000..93e906d --- /dev/null +++ b/public/prism/prism-graphql.js @@ -0,0 +1,226 @@ +Prism.languages.graphql = { + comment: /#.*/, + description: { + pattern: /(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i, + greedy: true, + alias: 'string', + inside: { + 'language-markdown': { + pattern: /(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/, + lookbehind: true, + inside: Prism.languages.markdown, + }, + }, + }, + string: { + pattern: /"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/, + greedy: true, + }, + number: /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, + boolean: /\b(?:false|true)\b/, + variable: /\$[a-z_]\w*/i, + directive: { + pattern: /@[a-z_]\w*/i, + alias: 'function', + }, + 'attr-name': { + pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i, + greedy: true, + }, + 'atom-input': { + pattern: /\b[A-Z]\w*Input\b/, + alias: 'class-name', + }, + scalar: /\b(?:Boolean|Float|ID|Int|String)\b/, + constant: /\b[A-Z][A-Z_\d]*\b/, + 'class-name': { + pattern: + /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/, + lookbehind: true, + }, + fragment: { + pattern: /(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/, + lookbehind: true, + alias: 'function', + }, + 'definition-mutation': { + pattern: /(\bmutation\s+)[a-zA-Z_]\w*/, + lookbehind: true, + alias: 'function', + }, + 'definition-query': { + pattern: /(\bquery\s+)[a-zA-Z_]\w*/, + lookbehind: true, + alias: 'function', + }, + keyword: + /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/, + operator: /[!=|&]|\.{3}/, + 'property-query': /\w+(?=\s*\()/, + object: /\w+(?=\s*\{)/, + punctuation: /[!(){}\[\]:=,]/, + property: /\w+/, +}; + +Prism.hooks.add('after-tokenize', function afterTokenizeGraphql(env) { + if (env.language !== 'graphql') { + return; + } + + /** + * get the graphql token stream that we want to customize + * + * @typedef {InstanceType} Token + * @type {Token[]} + */ + var validTokens = env.tokens.filter(function (token) { + return ( + typeof token !== 'string' && + token.type !== 'comment' && + token.type !== 'scalar' + ); + }); + + var currentIndex = 0; + + /** + * Returns whether the token relative to the current index has the given type. + * + * @param {number} offset + * @returns {Token | undefined} + */ + function getToken(offset) { + return validTokens[currentIndex + offset]; + } + + /** + * Returns whether the token relative to the current index has the given type. + * + * @param {readonly string[]} types + * @param {number} [offset=0] + * @returns {boolean} + */ + function isTokenType(types, offset) { + offset = offset || 0; + for (var i = 0; i < types.length; i++) { + var token = getToken(i + offset); + if (!token || token.type !== types[i]) { + return false; + } + } + return true; + } + + /** + * Returns the index of the closing bracket to an opening bracket. + * + * It is assumed that `token[currentIndex - 1]` is an opening bracket. + * + * If no closing bracket could be found, `-1` will be returned. + * + * @param {RegExp} open + * @param {RegExp} close + * @returns {number} + */ + function findClosingBracket(open, close) { + var stackHeight = 1; + + for (var i = currentIndex; i < validTokens.length; i++) { + var token = validTokens[i]; + var content = token.content; + + if (token.type === 'punctuation' && typeof content === 'string') { + if (open.test(content)) { + stackHeight++; + } else if (close.test(content)) { + stackHeight--; + + if (stackHeight === 0) { + return i; + } + } + } + } + + return -1; + } + + /** + * Adds an alias to the given token. + * + * @param {Token} token + * @param {string} alias + * @returns {void} + */ + function addAlias(token, alias) { + var aliases = token.alias; + if (!aliases) { + token.alias = aliases = []; + } else if (!Array.isArray(aliases)) { + token.alias = aliases = [aliases]; + } + aliases.push(alias); + } + + for (; currentIndex < validTokens.length; ) { + var startToken = validTokens[currentIndex++]; + + // add special aliases for mutation tokens + if (startToken.type === 'keyword' && startToken.content === 'mutation') { + // any array of the names of all input variables (if any) + var inputVariables = []; + + if ( + isTokenType(['definition-mutation', 'punctuation']) && + getToken(1).content === '(' + ) { + // definition + + currentIndex += 2; // skip 'definition-mutation' and 'punctuation' + + var definitionEnd = findClosingBracket(/^\($/, /^\)$/); + if (definitionEnd === -1) { + continue; + } + + // find all input variables + for (; currentIndex < definitionEnd; currentIndex++) { + var t = getToken(0); + if (t.type === 'variable') { + addAlias(t, 'variable-input'); + inputVariables.push(t.content); + } + } + + currentIndex = definitionEnd + 1; + } + + if ( + isTokenType(['punctuation', 'property-query']) && + getToken(0).content === '{' + ) { + currentIndex++; // skip opening bracket + + addAlias(getToken(0), 'property-mutation'); + + if (inputVariables.length > 0) { + var mutationEnd = findClosingBracket(/^\{$/, /^\}$/); + if (mutationEnd === -1) { + continue; + } + + // give references to input variables a special alias + for (var i = currentIndex; i < mutationEnd; i++) { + var varToken = validTokens[i]; + if ( + varToken.type === 'variable' && + inputVariables.indexOf(varToken.content) >= 0 + ) { + addAlias(varToken, 'variable-input'); + } + } + } + } + } + } +}); diff --git a/public/prism/prism-graphql.min.js b/public/prism/prism-graphql.min.js new file mode 100644 index 0000000..be11b77 --- /dev/null +++ b/public/prism/prism-graphql.min.js @@ -0,0 +1,131 @@ +(Prism.languages.graphql = { + comment: /#.*/, + description: { + pattern: /(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i, + greedy: !0, + alias: 'string', + inside: { + 'language-markdown': { + pattern: /(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/, + lookbehind: !0, + inside: Prism.languages.markdown, + }, + }, + }, + string: { + pattern: /"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/, + greedy: !0, + }, + number: /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, + boolean: /\b(?:false|true)\b/, + variable: /\$[a-z_]\w*/i, + directive: { pattern: /@[a-z_]\w*/i, alias: 'function' }, + 'attr-name': { + pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i, + greedy: !0, + }, + 'atom-input': { pattern: /\b[A-Z]\w*Input\b/, alias: 'class-name' }, + scalar: /\b(?:Boolean|Float|ID|Int|String)\b/, + constant: /\b[A-Z][A-Z_\d]*\b/, + 'class-name': { + pattern: + /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/, + lookbehind: !0, + }, + fragment: { + pattern: /(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/, + lookbehind: !0, + alias: 'function', + }, + 'definition-mutation': { + pattern: /(\bmutation\s+)[a-zA-Z_]\w*/, + lookbehind: !0, + alias: 'function', + }, + 'definition-query': { + pattern: /(\bquery\s+)[a-zA-Z_]\w*/, + lookbehind: !0, + alias: 'function', + }, + keyword: + /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/, + operator: /[!=|&]|\.{3}/, + 'property-query': /\w+(?=\s*\()/, + object: /\w+(?=\s*\{)/, + punctuation: /[!(){}\[\]:=,]/, + property: /\w+/, +}), + Prism.hooks.add('after-tokenize', function (n) { + if ('graphql' === n.language) + for ( + var o = n.tokens.filter(function (n) { + return ( + 'string' != typeof n && + 'comment' !== n.type && + 'scalar' !== n.type + ); + }), + s = 0; + s < o.length; + + ) { + var t = o[s++]; + if ('keyword' === t.type && 'mutation' === t.content) { + var e = []; + if ( + c(['definition-mutation', 'punctuation']) && + '(' === l(1).content + ) { + s += 2; + var a = f(/^\($/, /^\)$/); + if (-1 === a) continue; + for (; s < a; s++) { + var r = l(0); + 'variable' === r.type && + (b(r, 'variable-input'), e.push(r.content)); + } + s = a + 1; + } + if ( + c(['punctuation', 'property-query']) && + '{' === l(0).content && + (s++, b(l(0), 'property-mutation'), 0 < e.length) + ) { + var i = f(/^\{$/, /^\}$/); + if (-1 === i) continue; + for (var u = s; u < i; u++) { + var p = o[u]; + 'variable' === p.type && + 0 <= e.indexOf(p.content) && + b(p, 'variable-input'); + } + } + } + } + function l(n) { + return o[s + n]; + } + function c(n, t) { + t = t || 0; + for (var e = 0; e < n.length; e++) { + var a = l(e + t); + if (!a || a.type !== n[e]) return !1; + } + return !0; + } + function f(n, t) { + for (var e = 1, a = s; a < o.length; a++) { + var r = o[a], + i = r.content; + if ('punctuation' === r.type && 'string' == typeof i) + if (n.test(i)) e++; + else if (t.test(i) && 0 === --e) return a; + } + return -1; + } + function b(n, t) { + var e = n.alias; + e ? Array.isArray(e) || (n.alias = e = [e]) : (n.alias = e = []), + e.push(t); + } + }); diff --git a/public/prism/prism-groovy.js b/public/prism/prism-groovy.js new file mode 100644 index 0000000..c6d1bbc --- /dev/null +++ b/public/prism/prism-groovy.js @@ -0,0 +1,72 @@ +Prism.languages.groovy = Prism.languages.extend('clike', { + string: [ + { + // https://groovy-lang.org/syntax.html#_dollar_slashy_string + pattern: + /("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, + greedy: true, + }, + { + // 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(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|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: + /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, + lookbehind: true, + }, + punctuation: /\.+|[{}[\];(),:$]/, +}); + +Prism.languages.insertBefore('groovy', 'string', { + shebang: { + pattern: /#!.+/, + alias: 'comment', + }, +}); + +Prism.languages.insertBefore('groovy', 'punctuation', { + 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, +}); + +Prism.languages.insertBefore('groovy', 'function', { + annotation: { + pattern: /(^|[^.])@\w+/, + lookbehind: true, + alias: 'punctuation', + }, +}); + +// Handle string interpolation +Prism.hooks.add('wrap', function (env) { + if (env.language === 'groovy' && env.type === 'string') { + var delimiter = env.content[0]; + + if (delimiter != "'") { + var pattern = /([^\\])(?:\$(?:\{.*?\}|[\w.]+))/; + if (delimiter === '$') { + pattern = /([^\$])(?:\$(?:\{.*?\}|[\w.]+))/; + } + + // To prevent double HTML-encoding we have to decode env.content first + env.content = env.content.replace(/</g, '<').replace(/&/g, '&'); + + env.content = Prism.highlight(env.content, { + expression: { + pattern: pattern, + lookbehind: true, + inside: Prism.languages.groovy, + }, + }); + + env.classes.push(delimiter === '/' ? 'regex' : 'gstring'); + } + } +}); diff --git a/public/prism/prism-groovy.min.js b/public/prism/prism-groovy.min.js new file mode 100644 index 0000000..a32d5d2 --- /dev/null +++ b/public/prism/prism-groovy.min.js @@ -0,0 +1,51 @@ +(Prism.languages.groovy = Prism.languages.extend('clike', { + string: [ + { + pattern: + /("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, + greedy: !0, + }, + { pattern: /(["'/])(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, + ], + keyword: + /\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|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: + /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, + lookbehind: !0, + }, + punctuation: /\.+|[{}[\];(),:$]/, +})), + Prism.languages.insertBefore('groovy', 'string', { + shebang: { pattern: /#!.+/, alias: 'comment' }, + }), + Prism.languages.insertBefore('groovy', 'punctuation', { + 'spock-block': /\b(?:and|cleanup|expect|given|setup|then|when|where):/, + }), + Prism.languages.insertBefore('groovy', 'function', { + annotation: { + pattern: /(^|[^.])@\w+/, + lookbehind: !0, + alias: 'punctuation', + }, + }), + Prism.hooks.add('wrap', function (e) { + if ('groovy' === e.language && 'string' === e.type) { + var t = e.content[0]; + if ("'" != t) { + var n = /([^\\])(?:\$(?:\{.*?\}|[\w.]+))/; + '$' === t && (n = /([^\$])(?:\$(?:\{.*?\}|[\w.]+))/), + (e.content = e.content.replace(/</g, '<').replace(/&/g, '&')), + (e.content = Prism.highlight(e.content, { + expression: { + pattern: n, + lookbehind: !0, + inside: Prism.languages.groovy, + }, + })), + e.classes.push('/' === t ? 'regex' : 'gstring'); + } + } + }); diff --git a/public/prism/prism-haml.js b/public/prism/prism-haml.js new file mode 100644 index 0000000..759f4ea --- /dev/null +++ b/public/prism/prism-haml.js @@ -0,0 +1,159 @@ +/* TODO + Handle multiline code after tag + %foo= some | + multiline | + code | +*/ + +(function (Prism) { + Prism.languages.haml = { + // Multiline stuff should appear before the rest + + 'multiline-comment': { + pattern: /((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ].+)*/, + lookbehind: true, + alias: 'comment', + }, + + 'multiline-code': [ + { + pattern: + /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ].*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ].+)/, + lookbehind: true, + inside: Prism.languages.ruby, + }, + { + pattern: + /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ].*\|[\t ]*)*/, + lookbehind: true, + inside: Prism.languages.ruby, + }, + ], + + // See at the end of the file for known filters + filter: { + pattern: + /((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/, + lookbehind: true, + inside: { + 'filter-name': { + pattern: /^:[\w-]+/, + alias: 'symbol', + }, + }, + }, + + markup: { + pattern: /((?:^|\r?\n|\r)[\t ]*)<.+/, + lookbehind: true, + inside: Prism.languages.markup, + }, + doctype: { + pattern: /((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/, + lookbehind: true, + }, + tag: { + // Allows for one nested group of braces + pattern: + /((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^{}])+\}|\[[^\]]+\])*[\/<>]*/, + lookbehind: true, + inside: { + attributes: [ + { + // Lookbehind tries to prevent interpolations from breaking it all + // Allows for one nested group of braces + pattern: /(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/, + lookbehind: true, + inside: Prism.languages.ruby, + }, + { + pattern: /\([^)]+\)/, + inside: { + 'attr-value': { + pattern: /(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/, + lookbehind: true, + }, + 'attr-name': /[\w:-]+(?=\s*!?=|\s*[,)])/, + punctuation: /[=(),]/, + }, + }, + { + pattern: /\[[^\]]+\]/, + inside: Prism.languages.ruby, + }, + ], + punctuation: /[<>]/, + }, + }, + code: { + pattern: /((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/, + lookbehind: true, + inside: Prism.languages.ruby, + }, + // Interpolations in plain text + interpolation: { + pattern: /#\{[^}]+\}/, + inside: { + delimiter: { + pattern: /^#\{|\}$/, + alias: 'punctuation', + }, + ruby: { + pattern: /[\s\S]+/, + inside: Prism.languages.ruby, + }, + }, + }, + punctuation: { + pattern: /((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/, + lookbehind: true, + }, + }; + + var filter_pattern = + '((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ].+|\\s*?(?=\\r?\\n|\\r)))+'; + + // Non exhaustive list of available filters and associated languages + var filters = [ + 'css', + { filter: 'coffee', language: 'coffeescript' }, + 'erb', + 'javascript', + 'less', + 'markdown', + 'ruby', + 'scss', + 'textile', + ]; + var all_filters = {}; + for (var i = 0, l = filters.length; i < l; i++) { + var filter = filters[i]; + 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}}', function () { + return filter.filter; + }) + ), + lookbehind: true, + inside: { + 'filter-name': { + pattern: /^:[\w-]+/, + alias: 'symbol', + }, + text: { + pattern: /[\s\S]+/, + alias: [filter.language, 'language-' + filter.language], + inside: Prism.languages[filter.language], + }, + }, + }; + } + } + + Prism.languages.insertBefore('haml', 'filter', all_filters); +})(Prism); diff --git a/public/prism/prism-haml.min.js b/public/prism/prism-haml.min.js new file mode 100644 index 0000000..45954d8 --- /dev/null +++ b/public/prism/prism-haml.min.js @@ -0,0 +1,117 @@ +!(function (n) { + n.languages.haml = { + 'multiline-comment': { + pattern: /((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ].+)*/, + lookbehind: !0, + alias: 'comment', + }, + 'multiline-code': [ + { + pattern: + /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ].*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ].+)/, + lookbehind: !0, + inside: n.languages.ruby, + }, + { + pattern: + /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ].*\|[\t ]*)*/, + lookbehind: !0, + inside: n.languages.ruby, + }, + ], + filter: { + pattern: + /((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/, + lookbehind: !0, + inside: { 'filter-name': { pattern: /^:[\w-]+/, alias: 'symbol' } }, + }, + markup: { + pattern: /((?:^|\r?\n|\r)[\t ]*)<.+/, + lookbehind: !0, + inside: n.languages.markup, + }, + doctype: { pattern: /((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/, lookbehind: !0 }, + tag: { + pattern: + /((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^{}])+\}|\[[^\]]+\])*[\/<>]*/, + lookbehind: !0, + inside: { + attributes: [ + { + pattern: /(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/, + lookbehind: !0, + inside: n.languages.ruby, + }, + { + pattern: /\([^)]+\)/, + inside: { + 'attr-value': { + pattern: /(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/, + lookbehind: !0, + }, + 'attr-name': /[\w:-]+(?=\s*!?=|\s*[,)])/, + punctuation: /[=(),]/, + }, + }, + { pattern: /\[[^\]]+\]/, inside: n.languages.ruby }, + ], + punctuation: /[<>]/, + }, + }, + code: { + pattern: /((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/, + lookbehind: !0, + inside: n.languages.ruby, + }, + interpolation: { + pattern: /#\{[^}]+\}/, + inside: { + delimiter: { pattern: /^#\{|\}$/, alias: 'punctuation' }, + ruby: { pattern: /[\s\S]+/, inside: n.languages.ruby }, + }, + }, + punctuation: { pattern: /((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/, lookbehind: !0 }, + }; + for ( + var e = [ + 'css', + { filter: 'coffee', language: 'coffeescript' }, + 'erb', + 'javascript', + 'less', + 'markdown', + 'ruby', + 'scss', + 'textile', + ], + t = {}, + r = 0, + a = e.length; + r < a; + r++ + ) { + var i = e[r]; + (i = 'string' == typeof i ? { filter: i, language: i } : i), + n.languages[i.language] && + (t['filter-' + i.filter] = { + pattern: RegExp( + '((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ].+|\\s*?(?=\\r?\\n|\\r)))+'.replace( + '{{filter_name}}', + function () { + return i.filter; + } + ) + ), + lookbehind: !0, + inside: { + 'filter-name': { pattern: /^:[\w-]+/, alias: 'symbol' }, + text: { + pattern: /[\s\S]+/, + alias: [i.language, 'language-' + i.language], + inside: n.languages[i.language], + }, + }, + }); + } + n.languages.insertBefore('haml', 'filter', t); +})(Prism); diff --git a/public/prism/prism-handlebars.js b/public/prism/prism-handlebars.js new file mode 100644 index 0000000..e7591fb --- /dev/null +++ b/public/prism/prism-handlebars.js @@ -0,0 +1,44 @@ +(function (Prism) { + Prism.languages.handlebars = { + comment: /\{\{![\s\S]*?\}\}/, + delimiter: { + pattern: /^\{\{\{?|\}\}\}?$/, + alias: 'punctuation', + }, + string: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/, + number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/, + boolean: /\b(?:false|true)\b/, + block: { + pattern: /^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/, + lookbehind: true, + alias: 'keyword', + }, + brackets: { + pattern: /\[[^\]]+\]/, + inside: { + punctuation: /\[|\]/, + variable: /[\s\S]+/, + }, + }, + punctuation: /[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/, + variable: /[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/, + }; + + Prism.hooks.add('before-tokenize', function (env) { + var handlebarsPattern = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g; + Prism.languages['markup-templating'].buildPlaceholders( + env, + 'handlebars', + handlebarsPattern + ); + }); + + Prism.hooks.add('after-tokenize', function (env) { + Prism.languages['markup-templating'].tokenizePlaceholders( + env, + 'handlebars' + ); + }); + + Prism.languages.hbs = Prism.languages.handlebars; +})(Prism); diff --git a/public/prism/prism-handlebars.min.js b/public/prism/prism-handlebars.min.js new file mode 100644 index 0000000..8be0206 --- /dev/null +++ b/public/prism/prism-handlebars.min.js @@ -0,0 +1,31 @@ +!(function (e) { + (e.languages.handlebars = { + comment: /\{\{![\s\S]*?\}\}/, + delimiter: { pattern: /^\{\{\{?|\}\}\}?$/, alias: 'punctuation' }, + string: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/, + number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/, + boolean: /\b(?:false|true)\b/, + block: { + pattern: /^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/, + lookbehind: !0, + alias: 'keyword', + }, + brackets: { + pattern: /\[[^\]]+\]/, + inside: { punctuation: /\[|\]/, variable: /[\s\S]+/ }, + }, + punctuation: /[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/, + variable: /[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/, + }), + e.hooks.add('before-tokenize', function (a) { + e.languages['markup-templating'].buildPlaceholders( + a, + 'handlebars', + /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g + ); + }), + e.hooks.add('after-tokenize', function (a) { + e.languages['markup-templating'].tokenizePlaceholders(a, 'handlebars'); + }), + (e.languages.hbs = e.languages.handlebars); +})(Prism); diff --git a/public/prism/prism-haskell.js b/public/prism/prism-haskell.js new file mode 100644 index 0000000..f2f1a98 --- /dev/null +++ b/public/prism/prism-haskell.js @@ -0,0 +1,71 @@ +Prism.languages.haskell = { + comment: { + pattern: + /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--(?:(?=.)[^-!#$%*+=?&@|~.:<>^\\\/].*|$)|\{-[\s\S]*?-\})/m, + lookbehind: true, + }, + char: { + pattern: + /'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|ACK|BEL|BS|CAN|CR|DC1|DC2|DC3|DC4|DEL|DLE|EM|ENQ|EOT|ESC|ETB|ETX|FF|FS|GS|HT|LF|NAK|NUL|RS|SI|SO|SOH|SP|STX|SUB|SYN|US|VT|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, + alias: 'string', + }, + string: { + pattern: /"(?:[^\\"]|\\(?:\S|\s+\\))*"/, + greedy: true, + }, + keyword: + /\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/, + 'import-statement': { + // The imported or hidden names are not included in this import + // statement. This is because we want to highlight those exactly like + // we do for the names in the program. + pattern: + /(^[\t ]*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m, + lookbehind: true, + inside: { + keyword: /\b(?:as|hiding|import|qualified)\b/, + punctuation: /\./, + }, + }, + // These are builtin variables only. Constructors are highlighted later as a constant. + builtin: + /\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/, + // decimal integers and floating point numbers | octal integers | hexadecimal integers + number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i, + operator: [ + { + // infix operator + pattern: /`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/, + greedy: true, + }, + { + // function composition + pattern: /(\s)\.(?=\s)/, + lookbehind: true, + }, + // Most of this is needed because of the meaning of a single '.'. + // If it stands alone freely, it is the function composition. + // 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. + // + // This regex means: /[-!#$%*+=?&@|~.:<>^\\\/]+/ without /\./. + /[-!#$%*+=?&@|~:<>^\\\/][-!#$%*+=?&@|~.:<>^\\\/]*|\.[-!#$%*+=?&@|~.:<>^\\\/]+/, + ], + // In Haskell, nearly everything is a variable, do not highlight these. + hvariable: { + pattern: /\b(?:[A-Z][\w']*\.)*[_a-z][\w']*/, + inside: { + punctuation: /\./, + }, + }, + constant: { + pattern: /\b(?:[A-Z][\w']*\.)*[A-Z][\w']*/, + inside: { + punctuation: /\./, + }, + }, + punctuation: /[{}[\];(),.:]/, +}; + +Prism.languages.hs = Prism.languages.haskell; diff --git a/public/prism/prism-haskell.min.js b/public/prism/prism-haskell.min.js new file mode 100644 index 0000000..5834b23 --- /dev/null +++ b/public/prism/prism-haskell.min.js @@ -0,0 +1,42 @@ +(Prism.languages.haskell = { + comment: { + pattern: + /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--(?:(?=.)[^-!#$%*+=?&@|~.:<>^\\\/].*|$)|\{-[\s\S]*?-\})/m, + lookbehind: !0, + }, + char: { + pattern: + /'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|ACK|BEL|BS|CAN|CR|DC1|DC2|DC3|DC4|DEL|DLE|EM|ENQ|EOT|ESC|ETB|ETX|FF|FS|GS|HT|LF|NAK|NUL|RS|SI|SO|SOH|SP|STX|SUB|SYN|US|VT|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, + alias: 'string', + }, + string: { pattern: /"(?:[^\\"]|\\(?:\S|\s+\\))*"/, greedy: !0 }, + keyword: + /\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/, + 'import-statement': { + pattern: + /(^[\t ]*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m, + lookbehind: !0, + inside: { + keyword: /\b(?:as|hiding|import|qualified)\b/, + punctuation: /\./, + }, + }, + builtin: + /\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/, + number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i, + operator: [ + { pattern: /`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/, greedy: !0 }, + { pattern: /(\s)\.(?=\s)/, lookbehind: !0 }, + /[-!#$%*+=?&@|~:<>^\\\/][-!#$%*+=?&@|~.:<>^\\\/]*|\.[-!#$%*+=?&@|~.:<>^\\\/]+/, + ], + hvariable: { + pattern: /\b(?:[A-Z][\w']*\.)*[_a-z][\w']*/, + inside: { punctuation: /\./ }, + }, + constant: { + pattern: /\b(?:[A-Z][\w']*\.)*[A-Z][\w']*/, + inside: { punctuation: /\./ }, + }, + punctuation: /[{}[\];(),.:]/, +}), + (Prism.languages.hs = Prism.languages.haskell); diff --git a/public/prism/prism-haxe.js b/public/prism/prism-haxe.js new file mode 100644 index 0000000..028459f --- /dev/null +++ b/public/prism/prism-haxe.js @@ -0,0 +1,80 @@ +Prism.languages.haxe = Prism.languages.extend('clike', { + string: { + // Strings can be multi-line + pattern: /"(?:[^"\\]|\\[\s\S])*"/, + greedy: true, + }, + 'class-name': [ + { + pattern: + /(\b(?:abstract|class|enum|extends|implements|interface|new|typedef)\s+)[A-Z_]\w*/, + lookbehind: true, + }, + // based on naming convention + /\b[A-Z]\w*/, + ], + // The final look-ahead prevents highlighting of keywords if expressions such as "haxe.macro.Expr" + keyword: + /\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|final|for|from|function|if|implements|import|in|inline|interface|macro|new|null|operator|overload|override|package|private|public|return|static|super|switch|throw|to|try|typedef|untyped|using|var|while)(?!\.)\b/, + function: { + pattern: /\b[a-z_]\w*(?=\s*(?:<[^<>]*>\s*)?\()/i, + greedy: true, + }, + operator: /\.{3}|\+\+|--|&&|\|\||->|=>|(?:<{1,3}|[-+*/%!=&|^])=?|[?:~]/, +}); + +Prism.languages.insertBefore('haxe', 'string', { + 'string-interpolation': { + pattern: /'(?:[^'\\]|\\[\s\S])*'/, + greedy: true, + inside: { + interpolation: { + pattern: /(^|[^\\])\$(?:\w+|\{[^{}]+\})/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + expression: { + pattern: /[\s\S]+/, + inside: Prism.languages.haxe, + }, + }, + }, + string: /[\s\S]+/, + }, + }, +}); + +Prism.languages.insertBefore('haxe', 'class-name', { + regex: { + pattern: /~\/(?:[^\/\\\r\n]|\\.)+\/[a-z]*/, + greedy: true, + inside: { + 'regex-flags': /\b[a-z]+$/, + 'regex-source': { + pattern: /^(~\/)[\s\S]+(?=\/$)/, + lookbehind: true, + alias: 'language-regex', + inside: Prism.languages.regex, + }, + 'regex-delimiter': /^~\/|\/$/, + }, + }, +}); + +Prism.languages.insertBefore('haxe', 'keyword', { + preprocessor: { + pattern: /#(?:else|elseif|end|if)\b.*/, + alias: 'property', + }, + metadata: { + pattern: /@:?[\w.]+/, + alias: 'symbol', + }, + reification: { + pattern: /\$(?:\w+|(?=\{))/, + alias: 'important', + }, +}); diff --git a/public/prism/prism-haxe.min.js b/public/prism/prism-haxe.min.js new file mode 100644 index 0000000..22c57c8 --- /dev/null +++ b/public/prism/prism-haxe.min.js @@ -0,0 +1,56 @@ +(Prism.languages.haxe = Prism.languages.extend('clike', { + string: { pattern: /"(?:[^"\\]|\\[\s\S])*"/, greedy: !0 }, + 'class-name': [ + { + pattern: + /(\b(?:abstract|class|enum|extends|implements|interface|new|typedef)\s+)[A-Z_]\w*/, + lookbehind: !0, + }, + /\b[A-Z]\w*/, + ], + keyword: + /\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|final|for|from|function|if|implements|import|in|inline|interface|macro|new|null|operator|overload|override|package|private|public|return|static|super|switch|throw|to|try|typedef|untyped|using|var|while)(?!\.)\b/, + function: { pattern: /\b[a-z_]\w*(?=\s*(?:<[^<>]*>\s*)?\()/i, greedy: !0 }, + operator: /\.{3}|\+\+|--|&&|\|\||->|=>|(?:<{1,3}|[-+*/%!=&|^])=?|[?:~]/, +})), + Prism.languages.insertBefore('haxe', 'string', { + 'string-interpolation': { + pattern: /'(?:[^'\\]|\\[\s\S])*'/, + greedy: !0, + inside: { + interpolation: { + pattern: /(^|[^\\])\$(?:\w+|\{[^{}]+\})/, + lookbehind: !0, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + expression: { pattern: /[\s\S]+/, inside: Prism.languages.haxe }, + }, + }, + string: /[\s\S]+/, + }, + }, + }), + Prism.languages.insertBefore('haxe', 'class-name', { + regex: { + pattern: /~\/(?:[^\/\\\r\n]|\\.)+\/[a-z]*/, + greedy: !0, + inside: { + 'regex-flags': /\b[a-z]+$/, + 'regex-source': { + pattern: /^(~\/)[\s\S]+(?=\/$)/, + lookbehind: !0, + alias: 'language-regex', + inside: Prism.languages.regex, + }, + 'regex-delimiter': /^~\/|\/$/, + }, + }, + }), + Prism.languages.insertBefore('haxe', 'keyword', { + preprocessor: { pattern: /#(?:else|elseif|end|if)\b.*/, alias: 'property' }, + metadata: { pattern: /@:?[\w.]+/, alias: 'symbol' }, + reification: { pattern: /\$(?:\w+|(?=\{))/, alias: 'important' }, + }); diff --git a/public/prism/prism-hcl.js b/public/prism/prism-hcl.js new file mode 100644 index 0000000..b60f768 --- /dev/null +++ b/public/prism/prism-hcl.js @@ -0,0 +1,65 @@ +Prism.languages.hcl = { + comment: /(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/, + heredoc: { + pattern: /<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m, + greedy: true, + alias: 'string', + }, + keyword: [ + { + pattern: + /(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i, + inside: { + type: { + pattern: /(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i, + lookbehind: true, + alias: 'variable', + }, + }, + }, + { + pattern: + /(?:backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i, + inside: { + type: { + pattern: + /(backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i, + lookbehind: true, + alias: 'variable', + }, + }, + }, + /[\w-]+(?=\s+\{)/, + ], + property: [/[-\w\.]+(?=\s*=(?!=))/, /"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/], + string: { + pattern: + /"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/, + greedy: true, + inside: { + interpolation: { + pattern: /(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/, + lookbehind: true, + inside: { + type: { + pattern: + /(\b(?:count|data|local|module|path|self|terraform|var)\b\.)[\w\*]+/i, + lookbehind: true, + alias: 'variable', + }, + keyword: /\b(?:count|data|local|module|path|self|terraform|var)\b/i, + function: /\w+(?=\()/, + string: { + pattern: /"(?:\\[\s\S]|[^\\"])*"/, + greedy: true, + }, + number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i, + punctuation: /[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/, + }, + }, + }, + }, + number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i, + boolean: /\b(?:false|true)\b/i, + punctuation: /[=\[\]{}]/, +}; diff --git a/public/prism/prism-hcl.min.js b/public/prism/prism-hcl.min.js new file mode 100644 index 0000000..9b7a97c --- /dev/null +++ b/public/prism/prism-hcl.min.js @@ -0,0 +1,62 @@ +Prism.languages.hcl = { + comment: /(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/, + heredoc: { + pattern: /<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m, + greedy: !0, + alias: 'string', + }, + keyword: [ + { + pattern: + /(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i, + inside: { + type: { + pattern: /(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i, + lookbehind: !0, + alias: 'variable', + }, + }, + }, + { + pattern: + /(?:backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i, + inside: { + type: { + pattern: + /(backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i, + lookbehind: !0, + alias: 'variable', + }, + }, + }, + /[\w-]+(?=\s+\{)/, + ], + property: [/[-\w\.]+(?=\s*=(?!=))/, /"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/], + string: { + pattern: + /"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/, + greedy: !0, + inside: { + interpolation: { + pattern: /(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/, + lookbehind: !0, + inside: { + type: { + pattern: + /(\b(?:count|data|local|module|path|self|terraform|var)\b\.)[\w\*]+/i, + lookbehind: !0, + alias: 'variable', + }, + keyword: /\b(?:count|data|local|module|path|self|terraform|var)\b/i, + function: /\w+(?=\()/, + string: { pattern: /"(?:\\[\s\S]|[^\\"])*"/, greedy: !0 }, + number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i, + punctuation: /[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/, + }, + }, + }, + }, + number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i, + boolean: /\b(?:false|true)\b/i, + punctuation: /[=\[\]{}]/, +}; diff --git a/public/prism/prism-hlsl.js b/public/prism/prism-hlsl.js new file mode 100644 index 0000000..b281aa2 --- /dev/null +++ b/public/prism/prism-hlsl.js @@ -0,0 +1,20 @@ +Prism.languages.hlsl = Prism.languages.extend('c', { + // Regarding keywords and class names: + // The list of all keywords was split into 'keyword' and 'class-name' tokens based on whether they are capitalized. + // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-keywords + // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-reserved-words + 'class-name': [ + Prism.languages.c['class-name'], + /\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|RasterizerState|RenderTargetView|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/, + ], + keyword: [ + // HLSL keyword + /\b(?:asm|asm_fragment|auto|break|case|catch|cbuffer|centroid|char|class|column_major|compile|compile_fragment|const|const_cast|continue|default|delete|discard|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|fxgroup|goto|groupshared|if|in|inline|inout|interface|line|lineadj|linear|long|matrix|mutable|namespace|new|nointerpolation|noperspective|operator|out|packoffset|pass|pixelfragment|point|precise|private|protected|public|register|reinterpret_cast|return|row_major|sample|sampler|shared|short|signed|sizeof|snorm|stateblock|stateblock_state|static|static_cast|string|struct|switch|tbuffer|technique|technique10|technique11|template|texture|this|throw|triangle|triangleadj|try|typedef|typename|uniform|union|unorm|unsigned|using|vector|vertexfragment|virtual|void|volatile|while)\b/, + // scalar, vector, and matrix types + /\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/, + ], + // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-grammar#floating-point-numbers + number: + /(?:(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/, + boolean: /\b(?:false|true)\b/, +}); diff --git a/public/prism/prism-hlsl.min.js b/public/prism/prism-hlsl.min.js new file mode 100644 index 0000000..29c6e0b --- /dev/null +++ b/public/prism/prism-hlsl.min.js @@ -0,0 +1,13 @@ +Prism.languages.hlsl = Prism.languages.extend('c', { + 'class-name': [ + Prism.languages.c['class-name'], + /\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|RasterizerState|RenderTargetView|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/, + ], + keyword: [ + /\b(?:asm|asm_fragment|auto|break|case|catch|cbuffer|centroid|char|class|column_major|compile|compile_fragment|const|const_cast|continue|default|delete|discard|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|fxgroup|goto|groupshared|if|in|inline|inout|interface|line|lineadj|linear|long|matrix|mutable|namespace|new|nointerpolation|noperspective|operator|out|packoffset|pass|pixelfragment|point|precise|private|protected|public|register|reinterpret_cast|return|row_major|sample|sampler|shared|short|signed|sizeof|snorm|stateblock|stateblock_state|static|static_cast|string|struct|switch|tbuffer|technique|technique10|technique11|template|texture|this|throw|triangle|triangleadj|try|typedef|typename|uniform|union|unorm|unsigned|using|vector|vertexfragment|virtual|void|volatile|while)\b/, + /\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/, + ], + number: + /(?:(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/, + boolean: /\b(?:false|true)\b/, +}); diff --git a/public/prism/prism-hoon.js b/public/prism/prism-hoon.js new file mode 100644 index 0000000..70601b7 --- /dev/null +++ b/public/prism/prism-hoon.js @@ -0,0 +1,15 @@ +Prism.languages.hoon = { + comment: { + pattern: /::.*/, + greedy: true, + }, + string: { + pattern: /"[^"]*"|'[^']*'/, + greedy: true, + }, + constant: /%(?:\.[ny]|[\w-]+)/, + 'class-name': /@(?:[a-z0-9-]*[a-z0-9])?|\*/i, + function: /(?:\+[-+] {2})?(?:[a-z](?:[a-z0-9-]*[a-z0-9])?)/, + keyword: + /\.[\^\+\*=\?]|![><:\.=\?!]|=[>|:,\.\-\^<+;/~\*\?]|\?[>|:\.\-\^<\+&~=@!]|\|[\$_%:\.\-\^~\*=@\?]|\+[|\$\+\*]|:[_\-\^\+~\*]|%[_:\.\-\^\+~\*=]|\^[|:\.\-\+&~\*=\?]|\$[|_%:<>\-\^&~@=\?]|;[:<\+;\/~\*=]|~[>|\$_%<\+\/&=\?!]|--|==/, +}; diff --git a/public/prism/prism-hoon.min.js b/public/prism/prism-hoon.min.js new file mode 100644 index 0000000..7da8ca3 --- /dev/null +++ b/public/prism/prism-hoon.min.js @@ -0,0 +1,9 @@ +Prism.languages.hoon = { + comment: { pattern: /::.*/, greedy: !0 }, + string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, + constant: /%(?:\.[ny]|[\w-]+)/, + 'class-name': /@(?:[a-z0-9-]*[a-z0-9])?|\*/i, + function: /(?:\+[-+] {2})?(?:[a-z](?:[a-z0-9-]*[a-z0-9])?)/, + keyword: + /\.[\^\+\*=\?]|![><:\.=\?!]|=[>|:,\.\-\^<+;/~\*\?]|\?[>|:\.\-\^<\+&~=@!]|\|[\$_%:\.\-\^~\*=@\?]|\+[|\$\+\*]|:[_\-\^\+~\*]|%[_:\.\-\^\+~\*=]|\^[|:\.\-\+&~\*=\?]|\$[|_%:<>\-\^&~@=\?]|;[:<\+;\/~\*=]|~[>|\$_%<\+\/&=\?!]|--|==/, +}; diff --git a/public/prism/prism-hpkp.js b/public/prism/prism-hpkp.js new file mode 100644 index 0000000..f151764 --- /dev/null +++ b/public/prism/prism-hpkp.js @@ -0,0 +1,15 @@ +/** + * Original by Scott Helme. + * + * Reference: https://scotthelme.co.uk/hpkp-cheat-sheet/ + */ + +Prism.languages.hpkp = { + directive: { + pattern: + /\b(?:includeSubDomains|max-age|pin-sha256|preload|report-to|report-uri|strict)(?=[\s;=]|$)/i, + alias: 'property', + }, + operator: /=/, + punctuation: /;/, +}; diff --git a/public/prism/prism-hpkp.min.js b/public/prism/prism-hpkp.min.js new file mode 100644 index 0000000..93bfe10 --- /dev/null +++ b/public/prism/prism-hpkp.min.js @@ -0,0 +1,9 @@ +Prism.languages.hpkp = { + directive: { + pattern: + /\b(?:includeSubDomains|max-age|pin-sha256|preload|report-to|report-uri|strict)(?=[\s;=]|$)/i, + alias: 'property', + }, + operator: /=/, + punctuation: /;/, +}; diff --git a/public/prism/prism-hsts.js b/public/prism/prism-hsts.js new file mode 100644 index 0000000..322ea26 --- /dev/null +++ b/public/prism/prism-hsts.js @@ -0,0 +1,14 @@ +/** + * Original by Scott Helme. + * + * Reference: https://scotthelme.co.uk/hsts-cheat-sheet/ + */ + +Prism.languages.hsts = { + directive: { + pattern: /\b(?:includeSubDomains|max-age|preload)(?=[\s;=]|$)/i, + alias: 'property', + }, + operator: /=/, + punctuation: /;/, +}; diff --git a/public/prism/prism-hsts.min.js b/public/prism/prism-hsts.min.js new file mode 100644 index 0000000..2e0a09b --- /dev/null +++ b/public/prism/prism-hsts.min.js @@ -0,0 +1,8 @@ +Prism.languages.hsts = { + directive: { + pattern: /\b(?:includeSubDomains|max-age|preload)(?=[\s;=]|$)/i, + alias: 'property', + }, + operator: /=/, + punctuation: /;/, +}; diff --git a/public/prism/prism-http.js b/public/prism/prism-http.js new file mode 100644 index 0000000..eed14b0 --- /dev/null +++ b/public/prism/prism-http.js @@ -0,0 +1,156 @@ +(function (Prism) { + /** + * @param {string} name + * @returns {RegExp} + */ + function headerValueOf(name) { + return RegExp('(^(?:' + name + '):[ \t]*(?![ \t]))[^]+', 'i'); + } + + Prism.languages.http = { + 'request-line': { + pattern: + /^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m, + inside: { + // HTTP Method + method: { + pattern: /^[A-Z]+\b/, + alias: 'property', + }, + // Request Target e.g. http://example.com, /path/to/file + 'request-target': { + pattern: /^(\s)(?:https?:\/\/|\/)\S*(?=\s)/, + lookbehind: true, + alias: 'url', + inside: Prism.languages.uri, + }, + // HTTP Version + 'http-version': { + pattern: /^(\s)HTTP\/[\d.]+/, + lookbehind: true, + alias: 'property', + }, + }, + }, + 'response-status': { + pattern: /^HTTP\/[\d.]+ \d+ .+/m, + inside: { + // HTTP Version + 'http-version': { + pattern: /^HTTP\/[\d.]+/, + alias: 'property', + }, + // Status Code + 'status-code': { + pattern: /^(\s)\d+(?=\s)/, + lookbehind: true, + alias: 'number', + }, + // Reason Phrase + 'reason-phrase': { + pattern: /^(\s).+/, + lookbehind: true, + alias: 'string', + }, + }, + }, + header: { + pattern: /^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m, + inside: { + 'header-value': [ + { + pattern: headerValueOf(/Content-Security-Policy/.source), + lookbehind: true, + alias: ['csp', 'languages-csp'], + inside: Prism.languages.csp, + }, + { + pattern: headerValueOf(/Public-Key-Pins(?:-Report-Only)?/.source), + lookbehind: true, + alias: ['hpkp', 'languages-hpkp'], + inside: Prism.languages.hpkp, + }, + { + pattern: headerValueOf(/Strict-Transport-Security/.source), + lookbehind: true, + alias: ['hsts', 'languages-hsts'], + inside: Prism.languages.hsts, + }, + { + pattern: headerValueOf(/[^:]+/.source), + lookbehind: true, + }, + ], + 'header-name': { + pattern: /^[^:]+/, + alias: 'keyword', + }, + punctuation: /^:/, + }, + }, + }; + + // Create a mapping of Content-Type headers to language definitions + var langs = Prism.languages; + var httpLanguages = { + 'application/javascript': langs.javascript, + 'application/json': langs.json || langs.javascript, + 'application/xml': langs.xml, + 'text/xml': langs.xml, + 'text/html': langs.html, + 'text/css': langs.css, + 'text/plain': langs.plain, + }; + + // Declare which types can also be suffixes + var suffixTypes = { + 'application/json': true, + 'application/xml': true, + }; + + /** + * Returns a pattern for the given content type which matches it and any type which has it as a suffix. + * + * @param {string} contentType + * @returns {string} + */ + function getSuffixPattern(contentType) { + var suffix = contentType.replace(/^[a-z]+\//, ''); + var suffixPattern = '\\w+/(?:[\\w.-]+\\+)+' + suffix + '(?![+\\w.-])'; + return '(?:' + contentType + '|' + suffixPattern + ')'; + } + + // Insert each content type parser that has its associated language + // currently loaded. + var options; + for (var contentType in httpLanguages) { + if (httpLanguages[contentType]) { + options = options || {}; + + var pattern = suffixTypes[contentType] + ? getSuffixPattern(contentType) + : contentType; + options[contentType.replace(/\//g, '-')] = { + pattern: RegExp( + '(' + + /content-type:\s*/.source + + pattern + + /(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source + + ')' + + // This is a little interesting: + // The HTTP format spec required 1 empty line before the body to make everything unambiguous. + // However, when writing code by hand (e.g. to display on a website) people can forget about this, + // so we want to be liberal here. We will allow the empty line to be omitted if the first line of + // the body does not start with a [\w-] character (as headers do). + /[^ \t\w-][\s\S]*/.source, + 'i' + ), + lookbehind: true, + inside: httpLanguages[contentType], + }; + } + } + if (options) { + Prism.languages.insertBefore('http', 'header', options); + } +})(Prism); diff --git a/public/prism/prism-http.min.js b/public/prism/prism-http.min.js new file mode 100644 index 0000000..12c5e3a --- /dev/null +++ b/public/prism/prism-http.min.js @@ -0,0 +1,103 @@ +!(function (t) { + function a(t) { + return RegExp('(^(?:' + t + '):[ \t]*(?![ \t]))[^]+', 'i'); + } + t.languages.http = { + 'request-line': { + pattern: + /^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m, + inside: { + method: { pattern: /^[A-Z]+\b/, alias: 'property' }, + 'request-target': { + pattern: /^(\s)(?:https?:\/\/|\/)\S*(?=\s)/, + lookbehind: !0, + alias: 'url', + inside: t.languages.uri, + }, + 'http-version': { + pattern: /^(\s)HTTP\/[\d.]+/, + lookbehind: !0, + alias: 'property', + }, + }, + }, + 'response-status': { + pattern: /^HTTP\/[\d.]+ \d+ .+/m, + inside: { + 'http-version': { pattern: /^HTTP\/[\d.]+/, alias: 'property' }, + 'status-code': { + pattern: /^(\s)\d+(?=\s)/, + lookbehind: !0, + alias: 'number', + }, + 'reason-phrase': { + pattern: /^(\s).+/, + lookbehind: !0, + alias: 'string', + }, + }, + }, + header: { + pattern: /^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m, + inside: { + 'header-value': [ + { + pattern: a('Content-Security-Policy'), + lookbehind: !0, + alias: ['csp', 'languages-csp'], + inside: t.languages.csp, + }, + { + pattern: a('Public-Key-Pins(?:-Report-Only)?'), + lookbehind: !0, + alias: ['hpkp', 'languages-hpkp'], + inside: t.languages.hpkp, + }, + { + pattern: a('Strict-Transport-Security'), + lookbehind: !0, + alias: ['hsts', 'languages-hsts'], + inside: t.languages.hsts, + }, + { pattern: a('[^:]+'), lookbehind: !0 }, + ], + 'header-name': { pattern: /^[^:]+/, alias: 'keyword' }, + punctuation: /^:/, + }, + }, + }; + var e, + n, + s, + i = t.languages, + p = { + 'application/javascript': i.javascript, + 'application/json': i.json || i.javascript, + 'application/xml': i.xml, + 'text/xml': i.xml, + 'text/html': i.html, + 'text/css': i.css, + 'text/plain': i.plain, + }, + r = { 'application/json': !0, 'application/xml': !0 }; + for (var l in p) + if (p[l]) { + e = e || {}; + var o = r[l] + ? (void 0, + (s = (n = l).replace(/^[a-z]+\//, '')), + '(?:' + n + '|\\w+/(?:[\\w.-]+\\+)+' + s + '(?![+\\w.-]))') + : l; + e[l.replace(/\//g, '-')] = { + pattern: RegExp( + '(content-type:\\s*' + + o + + '(?:(?:\r\n?|\n)[\\w-].*)*(?:\r(?:\n|(?!\n))|\n))[^ \t\\w-][^]*', + 'i' + ), + lookbehind: !0, + inside: p[l], + }; + } + e && t.languages.insertBefore('http', 'header', e); +})(Prism); diff --git a/public/prism/prism-ichigojam.js b/public/prism/prism-ichigojam.js new file mode 100644 index 0000000..2ab971e --- /dev/null +++ b/public/prism/prism-ichigojam.js @@ -0,0 +1,17 @@ +// according to the offical reference (EN) +// https://ichigojam.net/IchigoJam-en.html +Prism.languages.ichigojam = { + comment: /(?:\B'|REM)(?:[^\n\r]*)/i, + string: { + pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/, + greedy: true, + }, + number: /\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + keyword: + /\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GOTO|GSB|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RIGHT|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i, + function: + /\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i, + label: /(?:\B@\S+)/, + operator: /<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i, + punctuation: /[\[,;:()\]]/, +}; diff --git a/public/prism/prism-ichigojam.min.js b/public/prism/prism-ichigojam.min.js new file mode 100644 index 0000000..5b669bc --- /dev/null +++ b/public/prism/prism-ichigojam.min.js @@ -0,0 +1,12 @@ +Prism.languages.ichigojam = { + comment: /(?:\B'|REM)(?:[^\n\r]*)/i, + string: { pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/, greedy: !0 }, + number: /\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, + keyword: + /\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GOTO|GSB|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RIGHT|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i, + function: + /\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i, + label: /(?:\B@\S+)/, + operator: /<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i, + punctuation: /[\[,;:()\]]/, +}; diff --git a/public/prism/prism-icon.js b/public/prism/prism-icon.js new file mode 100644 index 0000000..01ee42d --- /dev/null +++ b/public/prism/prism-icon.js @@ -0,0 +1,23 @@ +Prism.languages.icon = { + comment: /#.*/, + string: { + pattern: /(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/, + greedy: true, + }, + number: /\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i, + 'builtin-keyword': { + pattern: + /&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/, + alias: 'variable', + }, + directive: { + pattern: /\$\w+/, + alias: 'builtin', + }, + keyword: + /\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/, + function: /\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/, + operator: + /[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/, + punctuation: /[\[\](){},;]/, +}; diff --git a/public/prism/prism-icon.min.js b/public/prism/prism-icon.min.js new file mode 100644 index 0000000..3ab8230 --- /dev/null +++ b/public/prism/prism-icon.min.js @@ -0,0 +1,20 @@ +Prism.languages.icon = { + comment: /#.*/, + string: { + pattern: /(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/, + greedy: !0, + }, + number: /\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i, + 'builtin-keyword': { + pattern: + /&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/, + alias: 'variable', + }, + directive: { pattern: /\$\w+/, alias: 'builtin' }, + keyword: + /\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/, + function: /\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/, + operator: + /[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/, + punctuation: /[\[\](){},;]/, +}; diff --git a/public/prism/prism-icu-message-format.js b/public/prism/prism-icu-message-format.js new file mode 100644 index 0000000..b12ee2c --- /dev/null +++ b/public/prism/prism-icu-message-format.js @@ -0,0 +1,160 @@ +// https://unicode-org.github.io/icu/userguide/format_parse/messages/ +// https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/MessageFormat.html + +(function (Prism) { + /** + * @param {string} source + * @param {number} level + * @returns {string} + */ + function nested(source, level) { + if (level <= 0) { + return /[]/.source; + } else { + return source.replace(//g, function () { + return nested(source, level - 1); + }); + } + } + + var stringPattern = /'[{}:=,](?:[^']|'')*'(?!')/; + + var escape = { + pattern: /''/, + greedy: true, + alias: 'operator', + }; + var string = { + pattern: stringPattern, + greedy: true, + inside: { + escape: escape, + }, + }; + + var argumentSource = nested( + /\{(?:[^{}']|'(?![{},'])|''||)*\}/.source.replace( + //g, + function () { + return stringPattern.source; + } + ), + 8 + ); + + var nestedMessage = { + pattern: RegExp(argumentSource), + inside: { + message: { + pattern: /^(\{)[\s\S]+(?=\}$)/, + lookbehind: true, + inside: null, // see below + }, + 'message-delimiter': { + pattern: /./, + alias: 'punctuation', + }, + }, + }; + + Prism.languages['icu-message-format'] = { + argument: { + pattern: RegExp(argumentSource), + greedy: true, + inside: { + content: { + pattern: /^(\{)[\s\S]+(?=\}$)/, + lookbehind: true, + inside: { + 'argument-name': { + pattern: /^(\s*)[^{}:=,\s]+/, + lookbehind: true, + }, + 'choice-style': { + // https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1ChoiceFormat.html#details + pattern: /^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: true, + inside: { + punctuation: /\|/, + range: { + pattern: /^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/, + lookbehind: true, + inside: { + operator: /[<#\u2264]/, + number: /\S+/, + }, + }, + rest: null, // see below + }, + }, + 'plural-style': { + // https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/PluralFormat.html#:~:text=Patterns%20and%20Their%20Interpretation + pattern: + /^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: true, + inside: { + offset: /^offset:\s*\d+/, + 'nested-message': nestedMessage, + selector: { + pattern: /=\d+|[^{}:=,\s]+/, + inside: { + keyword: /^(?:few|many|one|other|two|zero)$/, + }, + }, + }, + }, + 'select-style': { + // https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/SelectFormat.html#:~:text=Patterns%20and%20Their%20Interpretation + pattern: /^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: true, + inside: { + 'nested-message': nestedMessage, + selector: { + pattern: /[^{}:=,\s]+/, + inside: { + keyword: /^other$/, + }, + }, + }, + }, + keyword: /\b(?:choice|plural|select|selectordinal)\b/, + 'arg-type': { + pattern: /\b(?:date|duration|number|ordinal|spellout|time)\b/, + alias: 'keyword', + }, + 'arg-skeleton': { + pattern: /(,\s*)::[^{}:=,\s]+/, + lookbehind: true, + }, + 'arg-style': { + pattern: + /(,\s*)(?:currency|full|integer|long|medium|percent|short)(?=\s*$)/, + lookbehind: true, + }, + 'arg-style-text': { + pattern: RegExp( + /(^\s*,\s*(?=\S))/.source + + nested(/(?:[^{}']|'[^']*'|\{(?:)?\})+/.source, 8) + + '$' + ), + lookbehind: true, + alias: 'string', + }, + punctuation: /,/, + }, + }, + 'argument-delimiter': { + pattern: /./, + alias: 'operator', + }, + }, + }, + escape: escape, + string: string, + }; + + nestedMessage.inside.message.inside = Prism.languages['icu-message-format']; + Prism.languages['icu-message-format'].argument.inside.content.inside[ + 'choice-style' + ].inside.rest = Prism.languages['icu-message-format']; +})(Prism); diff --git a/public/prism/prism-icu-message-format.min.js b/public/prism/prism-icu-message-format.min.js new file mode 100644 index 0000000..f6aa19c --- /dev/null +++ b/public/prism/prism-icu-message-format.min.js @@ -0,0 +1,112 @@ +!(function (e) { + function s(e, t) { + return t <= 0 + ? '[]' + : e.replace(//g, function () { + return s(e, t - 1); + }); + } + var t = /'[{}:=,](?:[^']|'')*'(?!')/, + n = { pattern: /''/, greedy: !0, alias: 'operator' }, + r = { pattern: t, greedy: !0, inside: { escape: n } }, + a = s( + "\\{(?:[^{}']|'(?![{},'])|''||)*\\}".replace( + //g, + function () { + return t.source; + } + ), + 8 + ), + i = { + pattern: RegExp(a), + inside: { + message: { + pattern: /^(\{)[\s\S]+(?=\}$)/, + lookbehind: !0, + inside: null, + }, + 'message-delimiter': { pattern: /./, alias: 'punctuation' }, + }, + }; + (e.languages['icu-message-format'] = { + argument: { + pattern: RegExp(a), + greedy: !0, + inside: { + content: { + pattern: /^(\{)[\s\S]+(?=\}$)/, + lookbehind: !0, + inside: { + 'argument-name': { pattern: /^(\s*)[^{}:=,\s]+/, lookbehind: !0 }, + 'choice-style': { + pattern: /^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: !0, + inside: { + punctuation: /\|/, + range: { + pattern: /^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/, + lookbehind: !0, + inside: { operator: /[<#\u2264]/, number: /\S+/ }, + }, + rest: null, + }, + }, + 'plural-style': { + pattern: + /^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: !0, + inside: { + offset: /^offset:\s*\d+/, + 'nested-message': i, + selector: { + pattern: /=\d+|[^{}:=,\s]+/, + inside: { keyword: /^(?:few|many|one|other|two|zero)$/ }, + }, + }, + }, + 'select-style': { + pattern: /^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/, + lookbehind: !0, + inside: { + 'nested-message': i, + selector: { + pattern: /[^{}:=,\s]+/, + inside: { keyword: /^other$/ }, + }, + }, + }, + keyword: /\b(?:choice|plural|select|selectordinal)\b/, + 'arg-type': { + pattern: /\b(?:date|duration|number|ordinal|spellout|time)\b/, + alias: 'keyword', + }, + 'arg-skeleton': { pattern: /(,\s*)::[^{}:=,\s]+/, lookbehind: !0 }, + 'arg-style': { + pattern: + /(,\s*)(?:currency|full|integer|long|medium|percent|short)(?=\s*$)/, + lookbehind: !0, + }, + 'arg-style-text': { + pattern: RegExp( + '(^\\s*,\\s*(?=\\S))' + + s("(?:[^{}']|'[^']*'|\\{(?:)?\\})+", 8) + + '$' + ), + lookbehind: !0, + alias: 'string', + }, + punctuation: /,/, + }, + }, + 'argument-delimiter': { pattern: /./, alias: 'operator' }, + }, + }, + escape: n, + string: r, + }), + (i.inside.message.inside = e.languages['icu-message-format']), + (e.languages['icu-message-format'].argument.inside.content.inside[ + 'choice-style' + ].inside.rest = e.languages['icu-message-format']); +})(Prism); diff --git a/public/prism/prism-idris.js b/public/prism/prism-idris.js new file mode 100644 index 0000000..bbe7806 --- /dev/null +++ b/public/prism/prism-idris.js @@ -0,0 +1,20 @@ +Prism.languages.idris = Prism.languages.extend('haskell', { + comment: { + pattern: /(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m, + }, + keyword: + /\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/, + builtin: undefined, +}); + +Prism.languages.insertBefore('idris', 'keyword', { + 'import-statement': { + pattern: /(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m, + lookbehind: true, + inside: { + punctuation: /\./, + }, + }, +}); + +Prism.languages.idr = Prism.languages.idris; diff --git a/public/prism/prism-idris.min.js b/public/prism/prism-idris.min.js new file mode 100644 index 0000000..98bac8e --- /dev/null +++ b/public/prism/prism-idris.min.js @@ -0,0 +1,14 @@ +(Prism.languages.idris = Prism.languages.extend('haskell', { + comment: { pattern: /(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m }, + keyword: + /\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/, + builtin: void 0, +})), + Prism.languages.insertBefore('idris', 'keyword', { + 'import-statement': { + pattern: /(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m, + lookbehind: !0, + inside: { punctuation: /\./ }, + }, + }), + (Prism.languages.idr = Prism.languages.idris); diff --git a/public/prism/prism-iecst.js b/public/prism/prism-iecst.js new file mode 100644 index 0000000..49ca959 --- /dev/null +++ b/public/prism/prism-iecst.js @@ -0,0 +1,36 @@ +Prism.languages.iecst = { + comment: [ + { + pattern: + /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/, + lookbehind: true, + greedy: true, + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true, + }, + ], + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + keyword: [ + /\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:ACCESS|CONFIG|EXTERNAL|GLOBAL|INPUT|IN_OUT|OUTPUT|TEMP)|VAR|METHOD|PROPERTY)\b/i, + /\b(?:AT|BY|(?:END_)?(?:CASE|FOR|IF|REPEAT|WHILE)|CONSTANT|CONTINUE|DO|ELSE|ELSIF|EXIT|EXTENDS|FROM|GET|GOTO|IMPLEMENTS|JMP|NON_RETAIN|OF|PRIVATE|PROTECTED|PUBLIC|RETAIN|RETURN|SET|TASK|THEN|TO|UNTIL|USING|WITH|__CATCH|__ENDTRY|__FINALLY|__TRY)\b/, + ], + 'class-name': + /\b(?:ANY|ARRAY|BOOL|BYTE|U?(?:D|L|S)?INT|(?:D|L)?WORD|DATE(?:_AND_TIME)?|DT|L?REAL|POINTER|STRING|TIME(?:_OF_DAY)?|TOD)\b/, + address: { + pattern: /%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/, + alias: 'symbol', + }, + number: + /\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:D|DT|T|TOD)#[\d_shmd:]*|\b[A-Z]*#[\d.,_]*|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + boolean: /\b(?:FALSE|NULL|TRUE)\b/, + operator: + /S?R?:?=>?|&&?|\*\*?|<[=>]?|>=?|[-:^/+#]|\b(?:AND|EQ|EXPT|GE|GT|LE|LT|MOD|NE|NOT|OR|XOR)\b/, + function: /\b[a-z_]\w*(?=\s*\()/i, + punctuation: /[()[\].,;]/, +}; diff --git a/public/prism/prism-iecst.min.js b/public/prism/prism-iecst.min.js new file mode 100644 index 0000000..9056846 --- /dev/null +++ b/public/prism/prism-iecst.min.js @@ -0,0 +1,29 @@ +Prism.languages.iecst = { + comment: [ + { + pattern: + /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/, + lookbehind: !0, + greedy: !0, + }, + { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }, + ], + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: !0, + }, + keyword: [ + /\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:ACCESS|CONFIG|EXTERNAL|GLOBAL|INPUT|IN_OUT|OUTPUT|TEMP)|VAR|METHOD|PROPERTY)\b/i, + /\b(?:AT|BY|(?:END_)?(?:CASE|FOR|IF|REPEAT|WHILE)|CONSTANT|CONTINUE|DO|ELSE|ELSIF|EXIT|EXTENDS|FROM|GET|GOTO|IMPLEMENTS|JMP|NON_RETAIN|OF|PRIVATE|PROTECTED|PUBLIC|RETAIN|RETURN|SET|TASK|THEN|TO|UNTIL|USING|WITH|__CATCH|__ENDTRY|__FINALLY|__TRY)\b/, + ], + 'class-name': + /\b(?:ANY|ARRAY|BOOL|BYTE|U?(?:D|L|S)?INT|(?:D|L)?WORD|DATE(?:_AND_TIME)?|DT|L?REAL|POINTER|STRING|TIME(?:_OF_DAY)?|TOD)\b/, + address: { pattern: /%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/, alias: 'symbol' }, + number: + /\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:D|DT|T|TOD)#[\d_shmd:]*|\b[A-Z]*#[\d.,_]*|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + boolean: /\b(?:FALSE|NULL|TRUE)\b/, + operator: + /S?R?:?=>?|&&?|\*\*?|<[=>]?|>=?|[-:^/+#]|\b(?:AND|EQ|EXPT|GE|GT|LE|LT|MOD|NE|NOT|OR|XOR)\b/, + function: /\b[a-z_]\w*(?=\s*\()/i, + punctuation: /[()[\].,;]/, +}; diff --git a/public/prism/prism-ignore.js b/public/prism/prism-ignore.js new file mode 100644 index 0000000..f67e246 --- /dev/null +++ b/public/prism/prism-ignore.js @@ -0,0 +1,22 @@ +(function (Prism) { + Prism.languages.ignore = { + // https://git-scm.com/docs/gitignore + comment: /^#.*/m, + entry: { + pattern: /\S(?:.*(?:(?:\\ )|\S))?/, + alias: 'string', + inside: { + operator: /^!|\*\*?|\?/, + regex: { + pattern: /(^|[^\\])\[[^\[\]]*\]/, + lookbehind: true, + }, + punctuation: /\//, + }, + }, + }; + + Prism.languages.gitignore = Prism.languages.ignore; + Prism.languages.hgignore = Prism.languages.ignore; + Prism.languages.npmignore = Prism.languages.ignore; +})(Prism); diff --git a/public/prism/prism-ignore.min.js b/public/prism/prism-ignore.min.js new file mode 100644 index 0000000..04c981a --- /dev/null +++ b/public/prism/prism-ignore.min.js @@ -0,0 +1,17 @@ +!(function (n) { + (n.languages.ignore = { + comment: /^#.*/m, + entry: { + pattern: /\S(?:.*(?:(?:\\ )|\S))?/, + alias: 'string', + inside: { + operator: /^!|\*\*?|\?/, + regex: { pattern: /(^|[^\\])\[[^\[\]]*\]/, lookbehind: !0 }, + punctuation: /\//, + }, + }, + }), + (n.languages.gitignore = n.languages.ignore), + (n.languages.hgignore = n.languages.ignore), + (n.languages.npmignore = n.languages.ignore); +})(Prism); diff --git a/public/prism/prism-inform7.js b/public/prism/prism-inform7.js new file mode 100644 index 0000000..f0fe7e1 --- /dev/null +++ b/public/prism/prism-inform7.js @@ -0,0 +1,68 @@ +Prism.languages.inform7 = { + string: { + pattern: /"[^"]*"/, + inside: { + substitution: { + pattern: /\[[^\[\]]+\]/, + inside: { + delimiter: { + pattern: /\[|\]/, + alias: 'punctuation', + }, + // See rest below + }, + }, + }, + }, + comment: { + pattern: /\[[^\[\]]+\]/, + greedy: true, + }, + title: { + pattern: /^[ \t]*(?:book|chapter|part(?! of)|section|table|volume)\b.+/im, + alias: 'important', + }, + number: { + pattern: + /(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:eight|eleven|five|four|nine|one|seven|six|ten|three|twelve|two))\b(?!-)/i, + lookbehind: true, + }, + verb: { + pattern: + /(^|[^-])\b(?:answering|applying to|are|asking|attacking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:ing|s)?|consulting|contain(?:ing|s)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:s|ve|ving)|hold(?:ing|s)?|impl(?:ies|y)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:ing|s)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:ing|s)?|setting|showing|singing|sleeping|smelling|squeezing|support(?:ing|s)?|swearing|switching|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:ing|s)?|var(?:ies|y|ying)|waiting|waking|waving|wear(?:ing|s)?)\b(?!-)/i, + lookbehind: true, + alias: 'operator', + }, + keyword: { + pattern: + /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|the story|unless)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i, + lookbehind: true, + }, + property: { + pattern: + /(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: off| on)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i, + lookbehind: true, + alias: 'symbol', + }, + position: { + pattern: + /(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i, + lookbehind: true, + alias: 'keyword', + }, + type: { + pattern: + /(^|[^-])\b(?:actions?|activit(?:ies|y)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i, + lookbehind: true, + alias: 'variable', + }, + punctuation: /[.,:;(){}]/, +}; + +Prism.languages.inform7['string'].inside['substitution'].inside.rest = + Prism.languages.inform7; +// We don't want the remaining text in the substitution to be highlighted as the string. +Prism.languages.inform7['string'].inside['substitution'].inside.rest.text = { + pattern: /\S(?:\s*\S)*/, + alias: 'comment', +}; diff --git a/public/prism/prism-inform7.min.js b/public/prism/prism-inform7.min.js new file mode 100644 index 0000000..3e5e2a2 --- /dev/null +++ b/public/prism/prism-inform7.min.js @@ -0,0 +1,57 @@ +(Prism.languages.inform7 = { + string: { + pattern: /"[^"]*"/, + inside: { + substitution: { + pattern: /\[[^\[\]]+\]/, + inside: { delimiter: { pattern: /\[|\]/, alias: 'punctuation' } }, + }, + }, + }, + comment: { pattern: /\[[^\[\]]+\]/, greedy: !0 }, + title: { + pattern: /^[ \t]*(?:book|chapter|part(?! of)|section|table|volume)\b.+/im, + alias: 'important', + }, + number: { + pattern: + /(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:eight|eleven|five|four|nine|one|seven|six|ten|three|twelve|two))\b(?!-)/i, + lookbehind: !0, + }, + verb: { + pattern: + /(^|[^-])\b(?:answering|applying to|are|asking|attacking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:ing|s)?|consulting|contain(?:ing|s)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:s|ve|ving)|hold(?:ing|s)?|impl(?:ies|y)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:ing|s)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:ing|s)?|setting|showing|singing|sleeping|smelling|squeezing|support(?:ing|s)?|swearing|switching|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:ing|s)?|var(?:ies|y|ying)|waiting|waking|waving|wear(?:ing|s)?)\b(?!-)/i, + lookbehind: !0, + alias: 'operator', + }, + keyword: { + pattern: + /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|the story|unless)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i, + lookbehind: !0, + }, + property: { + pattern: + /(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: off| on)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i, + lookbehind: !0, + alias: 'symbol', + }, + position: { + pattern: + /(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i, + lookbehind: !0, + alias: 'keyword', + }, + type: { + pattern: + /(^|[^-])\b(?:actions?|activit(?:ies|y)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i, + lookbehind: !0, + alias: 'variable', + }, + punctuation: /[.,:;(){}]/, +}), + (Prism.languages.inform7.string.inside.substitution.inside.rest = + Prism.languages.inform7), + (Prism.languages.inform7.string.inside.substitution.inside.rest.text = { + pattern: /\S(?:\s*\S)*/, + alias: 'comment', + }); diff --git a/public/prism/prism-ini.js b/public/prism/prism-ini.js new file mode 100644 index 0000000..96254f8 --- /dev/null +++ b/public/prism/prism-ini.js @@ -0,0 +1,42 @@ +Prism.languages.ini = { + /** + * The component mimics the behavior of the Win32 API parser. + * + * @see {@link https://github.com/PrismJS/prism/issues/2775#issuecomment-787477723} + */ + + comment: { + pattern: /(^[ \f\t\v]*)[#;][^\n\r]*/m, + lookbehind: true, + }, + header: { + pattern: /(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m, + lookbehind: true, + inside: { + 'section-name': { + pattern: /(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/, + lookbehind: true, + alias: 'selector', + }, + punctuation: /\[|\]/, + }, + }, + key: { + pattern: + /(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m, + lookbehind: true, + alias: 'attr-name', + }, + value: { + pattern: /(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/, + lookbehind: true, + alias: 'attr-value', + inside: { + 'inner-value': { + pattern: /^("|').+(?=\1$)/, + lookbehind: true, + }, + }, + }, + punctuation: /=/, +}; diff --git a/public/prism/prism-ini.min.js b/public/prism/prism-ini.min.js new file mode 100644 index 0000000..ad79628 --- /dev/null +++ b/public/prism/prism-ini.min.js @@ -0,0 +1,28 @@ +Prism.languages.ini = { + comment: { pattern: /(^[ \f\t\v]*)[#;][^\n\r]*/m, lookbehind: !0 }, + header: { + pattern: /(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m, + lookbehind: !0, + inside: { + 'section-name': { + pattern: /(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/, + lookbehind: !0, + alias: 'selector', + }, + punctuation: /\[|\]/, + }, + }, + key: { + pattern: + /(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m, + lookbehind: !0, + alias: 'attr-name', + }, + value: { + pattern: /(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/, + lookbehind: !0, + alias: 'attr-value', + inside: { 'inner-value': { pattern: /^("|').+(?=\1$)/, lookbehind: !0 } }, + }, + punctuation: /=/, +}; diff --git a/public/prism/prism-io.js b/public/prism/prism-io.js new file mode 100644 index 0000000..3323d52 --- /dev/null +++ b/public/prism/prism-io.js @@ -0,0 +1,25 @@ +Prism.languages.io = { + comment: { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*|#.*)/, + lookbehind: true, + greedy: true, + }, + 'triple-quoted-string': { + pattern: /"""(?:\\[\s\S]|(?!""")[^\\])*"""/, + greedy: true, + alias: 'string', + }, + string: { + pattern: /"(?:\\.|[^\\\r\n"])*"/, + greedy: true, + }, + keyword: + /\b(?:activate|activeCoroCount|asString|block|break|call|catch|clone|collectGarbage|compileString|continue|do|doFile|doMessage|doString|else|elseif|exit|for|foreach|forward|getEnvironmentVariable|getSlot|hasSlot|if|ifFalse|ifNil|ifNilEval|ifTrue|isActive|isNil|isResumable|list|message|method|parent|pass|pause|perform|performWithArgList|print|println|proto|raise|raiseResumable|removeSlot|resend|resume|schedulerSleepSeconds|self|sender|setSchedulerSleepSeconds|setSlot|shallowCopy|slotNames|super|system|then|thisBlock|thisContext|try|type|uniqueId|updateSlot|wait|while|write|yield)\b/, + builtin: + /\b(?:Array|AudioDevice|AudioMixer|BigNum|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|Random|Regex|SGML|SGMLElement|SGMLParser|SQLite|Sequence|Server|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink)\b/, + boolean: /\b(?:false|nil|true)\b/, + number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?/i, + operator: + /[=!*/%+\-^&|]=|>>?=?|<>?=?|<+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/, + alias: 'keyword', + }, + number: + /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/, + adverb: { + pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/, + alias: 'builtin', + }, + operator: /[=a][.:]|_\./, + conjunction: { + pattern: /&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/, + alias: 'variable', + }, + punctuation: /[()]/, +}; diff --git a/public/prism/prism-j.min.js b/public/prism/prism-j.min.js new file mode 100644 index 0000000..7dea1bc --- /dev/null +++ b/public/prism/prism-j.min.js @@ -0,0 +1,20 @@ +Prism.languages.j = { + comment: { pattern: /\bNB\..*/, greedy: !0 }, + string: { pattern: /'(?:''|[^'\r\n])*'/, greedy: !0 }, + keyword: + /\b(?:(?:CR|LF|adverb|conjunction|def|define|dyad|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/, + verb: { + pattern: + /(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/, + alias: 'keyword', + }, + number: + /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/, + adverb: { pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/, alias: 'builtin' }, + operator: /[=a][.:]|_\./, + conjunction: { + pattern: /&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/, + alias: 'variable', + }, + punctuation: /[()]/, +}; diff --git a/public/prism/prism-java.js b/public/prism/prism-java.js new file mode 100644 index 0000000..083f63a --- /dev/null +++ b/public/prism/prism-java.js @@ -0,0 +1,103 @@ +(function (Prism) { + 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|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; + + // full package (optional) + parent classes (optional) + var classNamePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/ + .source; + + // based on the java naming conventions + var className = { + pattern: RegExp(classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source), + lookbehind: true, + inside: { + namespace: { + pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, + inside: { + punctuation: /\./, + }, + }, + punctuation: /\./, + }, + }; + + Prism.languages.java = Prism.languages.extend('clike', { + string: { + pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/, + lookbehind: true, + greedy: true, + }, + 'class-name': [ + className, + { + // variables and parameters + // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods) + pattern: RegExp( + classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source + ), + lookbehind: true, + inside: className.inside, + }, + ], + keyword: keywords, + function: [ + Prism.languages.clike.function, + { + pattern: /(::\s*)[a-z_]\w*/, + lookbehind: true, + }, + ], + number: + /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, + operator: { + 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', + }, + char: { + pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/, + greedy: true, + }, + }); + + Prism.languages.insertBefore('java', 'class-name', { + annotation: { + pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/, + lookbehind: true, + alias: 'punctuation', + }, + generics: { + pattern: + /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/, + inside: { + 'class-name': className, + keyword: keywords, + punctuation: /[<>(),.:]/, + operator: /[?&|]/, + }, + }, + namespace: { + pattern: RegExp( + /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace( + //g, + function () { + return keywords.source; + } + ) + ), + lookbehind: true, + inside: { + punctuation: /\./, + }, + }, + }); +})(Prism); diff --git a/public/prism/prism-java.min.js b/public/prism/prism-java.min.js new file mode 100644 index 0000000..98c645c --- /dev/null +++ b/public/prism/prism-java.min.js @@ -0,0 +1,80 @@ +!(function (e) { + var t = + /\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|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, + n = '(^|[^\\w.])(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*', + a = { + pattern: RegExp(n + '[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b'), + lookbehind: !0, + inside: { + namespace: { + pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, + inside: { punctuation: /\./ }, + }, + punctuation: /\./, + }, + }; + (e.languages.java = e.languages.extend('clike', { + string: { + pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/, + lookbehind: !0, + greedy: !0, + }, + 'class-name': [ + a, + { + pattern: RegExp(n + '[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()])'), + lookbehind: !0, + inside: a.inside, + }, + ], + keyword: t, + function: [ + e.languages.clike.function, + { pattern: /(::\s*)[a-z_]\w*/, lookbehind: !0 }, + ], + number: + /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, + operator: { + pattern: + /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, + lookbehind: !0, + }, + })), + e.languages.insertBefore('java', 'string', { + 'triple-quoted-string': { + pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, + greedy: !0, + alias: 'string', + }, + char: { pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/, greedy: !0 }, + }), + e.languages.insertBefore('java', 'class-name', { + annotation: { + pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/, + lookbehind: !0, + alias: 'punctuation', + }, + generics: { + pattern: + /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/, + inside: { + 'class-name': a, + keyword: t, + punctuation: /[<>(),.:]/, + operator: /[?&|]/, + }, + }, + namespace: { + pattern: RegExp( + '(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?'.replace( + //g, + function () { + return t.source; + } + ) + ), + lookbehind: !0, + inside: { punctuation: /\./ }, + }, + }); +})(Prism); diff --git a/public/prism/prism-javadoc.js b/public/prism/prism-javadoc.js new file mode 100644 index 0000000..f43025c --- /dev/null +++ b/public/prism/prism-javadoc.js @@ -0,0 +1,93 @@ +(function (Prism) { + var codeLinePattern = /(^(?:[\t ]*(?:\*\s*)*))[^*\s].*$/m; + + var memberReference = /#\s*\w+(?:\s*\([^()]*\))?/.source; + var reference = + /(?:\b[a-zA-Z]\w+\s*\.\s*)*\b[A-Z]\w*(?:\s*)?|/.source.replace( + //g, + function () { + return memberReference; + } + ); + + Prism.languages.javadoc = Prism.languages.extend('javadoclike', {}); + Prism.languages.insertBefore('javadoc', 'keyword', { + reference: { + pattern: RegExp( + /(@(?:exception|link|linkplain|see|throws|value)\s+(?:\*\s*)?)/.source + + '(?:' + + reference + + ')' + ), + lookbehind: true, + inside: { + function: { + pattern: /(#\s*)\w+(?=\s*\()/, + lookbehind: true, + }, + field: { + pattern: /(#\s*)\w+/, + lookbehind: true, + }, + namespace: { + pattern: /\b(?:[a-z]\w*\s*\.\s*)+/, + inside: { + punctuation: /\./, + }, + }, + 'class-name': /\b[A-Z]\w*/, + keyword: Prism.languages.java.keyword, + punctuation: /[#()[\],.]/, + }, + }, + 'class-name': { + // @param the first generic type parameter + pattern: /(@param\s+)<[A-Z]\w*>/, + lookbehind: true, + inside: { + punctuation: /[.<>]/, + }, + }, + 'code-section': [ + { + pattern: + /(\{@code\s+(?!\s))(?:[^\s{}]|\s+(?![\s}])|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+(?=\s*\})/, + lookbehind: true, + inside: { + code: { + // there can't be any HTML inside of {@code} tags + pattern: codeLinePattern, + lookbehind: true, + inside: Prism.languages.java, + alias: 'language-java', + }, + }, + }, + { + pattern: /(<(code|pre|tt)>(?!)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/, + lookbehind: true, + inside: { + line: { + pattern: codeLinePattern, + lookbehind: true, + inside: { + // highlight HTML tags and entities + tag: Prism.languages.markup.tag, + entity: Prism.languages.markup.entity, + code: { + // everything else is Java code + pattern: /.+/, + inside: Prism.languages.java, + alias: 'language-java', + }, + }, + }, + }, + }, + ], + tag: Prism.languages.markup.tag, + entity: Prism.languages.markup.entity, + }); + + Prism.languages.javadoclike.addSupport('java', Prism.languages.javadoc); +})(Prism); diff --git a/public/prism/prism-javadoc.min.js b/public/prism/prism-javadoc.min.js new file mode 100644 index 0000000..00aab61 --- /dev/null +++ b/public/prism/prism-javadoc.min.js @@ -0,0 +1,75 @@ +!(function (a) { + var e = /(^(?:[\t ]*(?:\*\s*)*))[^*\s].*$/m, + n = + '(?:\\b[a-zA-Z]\\w+\\s*\\.\\s*)*\\b[A-Z]\\w*(?:\\s*)?|'.replace( + //g, + function () { + return '#\\s*\\w+(?:\\s*\\([^()]*\\))?'; + } + ); + (a.languages.javadoc = a.languages.extend('javadoclike', {})), + a.languages.insertBefore('javadoc', 'keyword', { + reference: { + pattern: RegExp( + '(@(?:exception|link|linkplain|see|throws|value)\\s+(?:\\*\\s*)?)(?:' + + n + + ')' + ), + lookbehind: !0, + inside: { + function: { pattern: /(#\s*)\w+(?=\s*\()/, lookbehind: !0 }, + field: { pattern: /(#\s*)\w+/, lookbehind: !0 }, + namespace: { + pattern: /\b(?:[a-z]\w*\s*\.\s*)+/, + inside: { punctuation: /\./ }, + }, + 'class-name': /\b[A-Z]\w*/, + keyword: a.languages.java.keyword, + punctuation: /[#()[\],.]/, + }, + }, + 'class-name': { + pattern: /(@param\s+)<[A-Z]\w*>/, + lookbehind: !0, + inside: { punctuation: /[.<>]/ }, + }, + 'code-section': [ + { + pattern: + /(\{@code\s+(?!\s))(?:[^\s{}]|\s+(?![\s}])|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+(?=\s*\})/, + lookbehind: !0, + inside: { + code: { + pattern: e, + lookbehind: !0, + inside: a.languages.java, + alias: 'language-java', + }, + }, + }, + { + pattern: + /(<(code|pre|tt)>(?!)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/, + lookbehind: !0, + inside: { + line: { + pattern: e, + lookbehind: !0, + inside: { + tag: a.languages.markup.tag, + entity: a.languages.markup.entity, + code: { + pattern: /.+/, + inside: a.languages.java, + alias: 'language-java', + }, + }, + }, + }, + }, + ], + tag: a.languages.markup.tag, + entity: a.languages.markup.entity, + }), + a.languages.javadoclike.addSupport('java', a.languages.javadoc); +})(Prism); diff --git a/public/prism/prism-javadoclike.js b/public/prism/prism-javadoclike.js new file mode 100644 index 0000000..e427427 --- /dev/null +++ b/public/prism/prism-javadoclike.js @@ -0,0 +1,85 @@ +(function (Prism) { + var javaDocLike = (Prism.languages.javadoclike = { + parameter: { + pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m, + lookbehind: true, + }, + keyword: { + // keywords are the first word in a line preceded be an `@` or surrounded by curly braces. + // @word, {@word} + pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m, + lookbehind: true, + }, + punctuation: /[{}]/, + }); + + /** + * Adds doc comment support to the given language and calls a given callback on each doc comment pattern. + * + * @param {string} lang the language add doc comment support to. + * @param {(pattern: {inside: {rest: undefined}}) => void} callback the function called with each doc comment pattern as argument. + */ + function docCommentSupport(lang, callback) { + var tokenName = 'doc-comment'; + + var grammar = Prism.languages[lang]; + if (!grammar) { + return; + } + var token = grammar[tokenName]; + + if (!token) { + // add doc comment: /** */ + var definition = {}; + definition[tokenName] = { + pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/, + lookbehind: true, + alias: 'comment', + }; + + grammar = Prism.languages.insertBefore(lang, 'comment', definition); + token = grammar[tokenName]; + } + + if (token instanceof RegExp) { + // convert regex to object + token = grammar[tokenName] = { pattern: token }; + } + + if (Array.isArray(token)) { + for (var i = 0, l = token.length; i < l; i++) { + if (token[i] instanceof RegExp) { + token[i] = { pattern: token[i] }; + } + callback(token[i]); + } + } else { + callback(token); + } + } + + /** + * Adds doc-comment support to the given languages for the given documentation language. + * + * @param {string[]|string} languages + * @param {Object} docLanguage + */ + function addSupport(languages, docLanguage) { + if (typeof languages === 'string') { + languages = [languages]; + } + + languages.forEach(function (lang) { + docCommentSupport(lang, function (pattern) { + if (!pattern.inside) { + pattern.inside = {}; + } + pattern.inside.rest = docLanguage; + }); + }); + } + + Object.defineProperty(javaDocLike, 'addSupport', { value: addSupport }); + + javaDocLike.addSupport(['java', 'javascript', 'php'], javaDocLike); +})(Prism); diff --git a/public/prism/prism-javadoclike.min.js b/public/prism/prism-javadoclike.min.js new file mode 100644 index 0000000..782f3f1 --- /dev/null +++ b/public/prism/prism-javadoclike.min.js @@ -0,0 +1,47 @@ +!(function (p) { + var a = (p.languages.javadoclike = { + parameter: { + pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m, + lookbehind: !0, + }, + keyword: { + pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m, + lookbehind: !0, + }, + punctuation: /[{}]/, + }); + Object.defineProperty(a, 'addSupport', { + value: function (a, e) { + 'string' == typeof a && (a = [a]), + a.forEach(function (a) { + !(function (a, e) { + var n = 'doc-comment', + t = p.languages[a]; + if (t) { + var r = t[n]; + if (!r) { + var o = { + 'doc-comment': { + pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/, + lookbehind: !0, + alias: 'comment', + }, + }; + r = (t = p.languages.insertBefore(a, 'comment', o))[n]; + } + if ( + (r instanceof RegExp && (r = t[n] = { pattern: r }), + Array.isArray(r)) + ) + for (var i = 0, s = r.length; i < s; i++) + r[i] instanceof RegExp && (r[i] = { pattern: r[i] }), e(r[i]); + else e(r); + } + })(a, function (a) { + a.inside || (a.inside = {}), (a.inside.rest = e); + }); + }); + }, + }), + a.addSupport(['java', 'javascript', 'php'], a); +})(Prism); diff --git a/public/prism/prism-javascript.js b/public/prism/prism-javascript.js new file mode 100644 index 0000000..9d679c2 --- /dev/null +++ b/public/prism/prism-javascript.js @@ -0,0 +1,171 @@ +Prism.languages.javascript = Prism.languages.extend('clike', { + 'class-name': [ + Prism.languages.clike['class-name'], + { + pattern: + /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, + lookbehind: true, + }, + ], + keyword: [ + { + pattern: /((?:^|\})\s*)catch\b/, + lookbehind: true, + }, + { + pattern: + /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, + lookbehind: true, + }, + ], + // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) + function: + /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, + number: { + pattern: RegExp( + /(^|[^\w$])/.source + + '(?:' + + // constant + (/NaN|Infinity/.source + + '|' + + // binary integer + /0[bB][01]+(?:_[01]+)*n?/.source + + '|' + + // octal integer + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + + '|' + + // hexadecimal integer + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + + '|' + + // decimal bigint + /\d+(?:_\d+)*n/.source + + '|' + + // decimal number (integer or float) but no bigint + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/ + .source) + + ')' + + /(?![\w$])/.source + ), + lookbehind: true, + }, + operator: + /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/, +}); + +Prism.languages.javascript['class-name'][0].pattern = + /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/; + +Prism.languages.insertBefore('javascript', 'keyword', { + regex: { + // eslint-disable-next-line regexp/no-dupe-characters-character-class + pattern: + /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, + lookbehind: true, + greedy: true, + inside: { + 'regex-source': { + pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, + lookbehind: true, + alias: 'language-regex', + inside: Prism.languages.regex, + }, + 'regex-delimiter': /^\/|\/$/, + 'regex-flags': /^[a-z]+$/, + }, + }, + // This must be declared before keyword because we use "function" inside the look-forward + 'function-variable': { + pattern: + /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, + alias: 'function', + }, + parameter: [ + { + pattern: + /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, + lookbehind: true, + inside: Prism.languages.javascript, + }, + { + pattern: + /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, + lookbehind: true, + inside: Prism.languages.javascript, + }, + { + pattern: + /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, + lookbehind: true, + inside: Prism.languages.javascript, + }, + { + pattern: + /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, + lookbehind: true, + inside: Prism.languages.javascript, + }, + ], + constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/, +}); + +Prism.languages.insertBefore('javascript', 'string', { + hashbang: { + pattern: /^#!.*/, + greedy: true, + alias: 'comment', + }, + 'template-string': { + pattern: + /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, + greedy: true, + inside: { + 'template-punctuation': { + pattern: /^`|`$/, + alias: 'string', + }, + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation', + }, + rest: Prism.languages.javascript, + }, + }, + string: /[\s\S]+/, + }, + }, + 'string-property': { + pattern: + /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, + lookbehind: true, + greedy: true, + alias: 'property', + }, +}); + +Prism.languages.insertBefore('javascript', 'operator', { + 'literal-property': { + pattern: + /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, + lookbehind: true, + alias: 'property', + }, +}); + +if (Prism.languages.markup) { + Prism.languages.markup.tag.addInlined('script', 'javascript'); + + // add attribute support for all DOM events. + // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events + Prism.languages.markup.tag.addAttribute( + /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/ + .source, + 'javascript' + ); +} + +Prism.languages.js = Prism.languages.javascript; diff --git a/public/prism/prism-javascript.min.js b/public/prism/prism-javascript.min.js new file mode 100644 index 0000000..330bb66 --- /dev/null +++ b/public/prism/prism-javascript.min.js @@ -0,0 +1,126 @@ +(Prism.languages.javascript = Prism.languages.extend('clike', { + 'class-name': [ + Prism.languages.clike['class-name'], + { + pattern: + /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, + lookbehind: !0, + }, + ], + keyword: [ + { pattern: /((?:^|\})\s*)catch\b/, lookbehind: !0 }, + { + pattern: + /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, + lookbehind: !0, + }, + ], + function: + /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, + number: { + pattern: RegExp( + '(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])' + ), + lookbehind: !0, + }, + operator: + /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/, +})), + (Prism.languages.javascript['class-name'][0].pattern = + /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/), + Prism.languages.insertBefore('javascript', 'keyword', { + regex: { + pattern: + /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, + lookbehind: !0, + greedy: !0, + inside: { + 'regex-source': { + pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, + lookbehind: !0, + alias: 'language-regex', + inside: Prism.languages.regex, + }, + 'regex-delimiter': /^\/|\/$/, + 'regex-flags': /^[a-z]+$/, + }, + }, + 'function-variable': { + pattern: + /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, + alias: 'function', + }, + parameter: [ + { + pattern: + /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, + lookbehind: !0, + inside: Prism.languages.javascript, + }, + { + pattern: + /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, + lookbehind: !0, + inside: Prism.languages.javascript, + }, + { + pattern: + /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, + lookbehind: !0, + inside: Prism.languages.javascript, + }, + { + pattern: + /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, + lookbehind: !0, + inside: Prism.languages.javascript, + }, + ], + constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/, + }), + Prism.languages.insertBefore('javascript', 'string', { + hashbang: { pattern: /^#!.*/, greedy: !0, alias: 'comment' }, + 'template-string': { + pattern: + /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, + greedy: !0, + inside: { + 'template-punctuation': { pattern: /^`|`$/, alias: 'string' }, + interpolation: { + pattern: + /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: !0, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation', + }, + rest: Prism.languages.javascript, + }, + }, + string: /[\s\S]+/, + }, + }, + 'string-property': { + pattern: + /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, + lookbehind: !0, + greedy: !0, + alias: 'property', + }, + }), + Prism.languages.insertBefore('javascript', 'operator', { + 'literal-property': { + pattern: + /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, + lookbehind: !0, + alias: 'property', + }, + }), + Prism.languages.markup && + (Prism.languages.markup.tag.addInlined('script', 'javascript'), + Prism.languages.markup.tag.addAttribute( + 'on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)', + 'javascript' + )), + (Prism.languages.js = Prism.languages.javascript); diff --git a/public/prism/prism-javastacktrace.js b/public/prism/prism-javastacktrace.js new file mode 100644 index 0000000..b6ebacd --- /dev/null +++ b/public/prism/prism-javastacktrace.js @@ -0,0 +1,142 @@ +// Specification: +// https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/Throwable.html#printStackTrace() + +Prism.languages.javastacktrace = { + // java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...] + // Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...] + // Caused by: com.example.myproject.MyProjectServletException + // Caused by: MidLevelException: LowLevelException + // Suppressed: Resource$CloseFailException: Resource ID = 0 + summary: { + pattern: + /^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m, + lookbehind: true, + inside: { + keyword: { + pattern: + /^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m, + lookbehind: true, + }, + + // the current thread if the summary starts with 'Exception in thread' + string: { + pattern: /^(\s*)"[^"]*"/, + lookbehind: true, + }, + exceptions: { + pattern: /^(:?\s*)[\w$.]+(?=:|$)/, + lookbehind: true, + inside: { + 'class-name': /[\w$]+$/, + namespace: /\b[a-z]\w*\b/, + punctuation: /\./, + }, + }, + message: { + pattern: /(:\s*)\S.*/, + lookbehind: true, + alias: 'string', + }, + punctuation: /:/, + }, + }, + + // at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) + // at org.hsqldb.jdbc.Util.throwError(Unknown Source) here could be some notes + // at java.base/java.lang.Class.forName0(Native Method) + // at Util.(Unknown Source) + // at com.foo.loader/foo@9.0/com.foo.Main.run(Main.java:101) + // at com.foo.loader//com.foo.bar.App.run(App.java:12) + // at acme@2.1/org.acme.Lib.test(Lib.java:80) + // at MyClass.mash(MyClass.java:9) + // + // More information: + // https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/StackTraceElement.html#toString() + // + // A valid Java module name is defined as: + // "A module name consists of one or more Java identifiers (§3.8) separated by "." tokens." + // https://docs.oracle.com/javase/specs/jls/se9/html/jls-6.html#jls-ModuleName + // + // A Java module version is defined by this class: + // https://docs.oracle.com/javase/9/docs/api/java/lang/module/ModuleDescriptor.Version.html + // This is the implementation of the `parse` method in JDK13: + // https://github.com/matcdac/jdk/blob/2305df71d1b7710266ae0956d73927a225132c0f/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java#L1108 + // However, to keep this simple, a version will be matched by the pattern /@[\w$.+-]*/. + 'stack-frame': { + pattern: /^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:)?\([^()]*\)/m, + lookbehind: true, + inside: { + keyword: { + pattern: /^(\s*)at(?= )/, + lookbehind: true, + }, + source: [ + // (Main.java:15) + // (Main.scala:15) + { + pattern: /(\()\w+\.\w+:\d+(?=\))/, + lookbehind: true, + inside: { + file: /^\w+\.\w+/, + punctuation: /:/, + 'line-number': { + pattern: /\b\d+\b/, + alias: 'number', + }, + }, + }, + // (Unknown Source) + // (Native Method) + // (...something...) + { + pattern: /(\()[^()]*(?=\))/, + lookbehind: true, + inside: { + keyword: /^(?:Native Method|Unknown Source)$/, + }, + }, + ], + 'class-name': /[\w$]+(?=\.(?:|[\w$]+)\()/, + function: /(?:|[\w$]+)(?=\()/, + 'class-loader': { + pattern: /(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/, + lookbehind: true, + alias: 'namespace', + inside: { + punctuation: /\./, + }, + }, + module: { + pattern: /([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/, + lookbehind: true, + inside: { + version: { + pattern: /(@)[\s\S]+/, + lookbehind: true, + alias: 'number', + }, + punctuation: /[@.]/, + }, + }, + namespace: { + pattern: /(?:\b[a-z]\w*\.)+/, + inside: { + punctuation: /\./, + }, + }, + punctuation: /[()/.]/, + }, + }, + + // ... 32 more + // ... 32 common frames omitted + more: { + pattern: /^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m, + lookbehind: true, + inside: { + punctuation: /\.{3}/, + number: /\d+/, + keyword: /\b[a-z]+(?: [a-z]+)*\b/, + }, + }, +}; diff --git a/public/prism/prism-javastacktrace.min.js b/public/prism/prism-javastacktrace.min.js new file mode 100644 index 0000000..0464e23 --- /dev/null +++ b/public/prism/prism-javastacktrace.min.js @@ -0,0 +1,79 @@ +Prism.languages.javastacktrace = { + summary: { + pattern: + /^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m, + lookbehind: !0, + inside: { + keyword: { + pattern: + /^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m, + lookbehind: !0, + }, + string: { pattern: /^(\s*)"[^"]*"/, lookbehind: !0 }, + exceptions: { + pattern: /^(:?\s*)[\w$.]+(?=:|$)/, + lookbehind: !0, + inside: { + 'class-name': /[\w$]+$/, + namespace: /\b[a-z]\w*\b/, + punctuation: /\./, + }, + }, + message: { pattern: /(:\s*)\S.*/, lookbehind: !0, alias: 'string' }, + punctuation: /:/, + }, + }, + 'stack-frame': { + pattern: /^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:)?\([^()]*\)/m, + lookbehind: !0, + inside: { + keyword: { pattern: /^(\s*)at(?= )/, lookbehind: !0 }, + source: [ + { + pattern: /(\()\w+\.\w+:\d+(?=\))/, + lookbehind: !0, + inside: { + file: /^\w+\.\w+/, + punctuation: /:/, + 'line-number': { pattern: /\b\d+\b/, alias: 'number' }, + }, + }, + { + pattern: /(\()[^()]*(?=\))/, + lookbehind: !0, + inside: { keyword: /^(?:Native Method|Unknown Source)$/ }, + }, + ], + 'class-name': /[\w$]+(?=\.(?:|[\w$]+)\()/, + function: /(?:|[\w$]+)(?=\()/, + 'class-loader': { + pattern: /(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/, + lookbehind: !0, + alias: 'namespace', + inside: { punctuation: /\./ }, + }, + module: { + pattern: /([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/, + lookbehind: !0, + inside: { + version: { pattern: /(@)[\s\S]+/, lookbehind: !0, alias: 'number' }, + punctuation: /[@.]/, + }, + }, + namespace: { + pattern: /(?:\b[a-z]\w*\.)+/, + inside: { punctuation: /\./ }, + }, + punctuation: /[()/.]/, + }, + }, + more: { + pattern: /^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m, + lookbehind: !0, + inside: { + punctuation: /\.{3}/, + number: /\d+/, + keyword: /\b[a-z]+(?: [a-z]+)*\b/, + }, + }, +}; diff --git a/public/prism/prism-jexl.js b/public/prism/prism-jexl.js new file mode 100644 index 0000000..3782104 --- /dev/null +++ b/public/prism/prism-jexl.js @@ -0,0 +1,16 @@ +Prism.languages.jexl = { + string: /(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/, + transform: { + pattern: + /(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/, + alias: 'function', + lookbehind: true, + }, + function: + /[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/, + number: /\b\d+(?:\.\d+)?\b|\B\.\d+\b/, + operator: /[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/, + boolean: /\b(?:false|true)\b/, + keyword: /\bin\b/, + punctuation: /[{}[\](),.]/, +}; diff --git a/public/prism/prism-jexl.min.js b/public/prism/prism-jexl.min.js new file mode 100644 index 0000000..6740b7c --- /dev/null +++ b/public/prism/prism-jexl.min.js @@ -0,0 +1,16 @@ +Prism.languages.jexl = { + string: /(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/, + transform: { + pattern: + /(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/, + alias: 'function', + lookbehind: !0, + }, + function: + /[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/, + number: /\b\d+(?:\.\d+)?\b|\B\.\d+\b/, + operator: /[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/, + boolean: /\b(?:false|true)\b/, + keyword: /\bin\b/, + punctuation: /[{}[\](),.]/, +}; diff --git a/public/prism/prism-jolie.js b/public/prism/prism-jolie.js new file mode 100644 index 0000000..0ad9706 --- /dev/null +++ b/public/prism/prism-jolie.js @@ -0,0 +1,46 @@ +Prism.languages.jolie = Prism.languages.extend('clike', { + string: { + pattern: /(^|[^\\])"(?:\\[\s\S]|[^"\\])*"/, + lookbehind: true, + greedy: true, + }, + 'class-name': { + pattern: + /((?:\b(?:as|courier|embed|in|inputPort|outputPort|service)\b|@)[ \t]*)\w+/, + lookbehind: true, + }, + keyword: + /\b(?:as|cH|comp|concurrent|constants|courier|cset|csets|default|define|else|embed|embedded|execution|exit|extender|for|foreach|forward|from|global|if|import|in|include|init|inputPort|install|instanceof|interface|is_defined|linkIn|linkOut|main|new|nullProcess|outputPort|over|private|provide|public|scope|sequential|service|single|spawn|synchronized|this|throw|throws|type|undef|until|while|with)\b/, + function: /\b[a-z_]\w*(?=[ \t]*[@(])/i, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i, + operator: /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[?\/%^@|]/, + punctuation: /[()[\]{},;.:]/, + builtin: + /\b(?:Byte|any|bool|char|double|enum|float|int|length|long|ranges|regex|string|undefined|void)\b/, +}); + +Prism.languages.insertBefore('jolie', 'keyword', { + aggregates: { + pattern: + /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/, + lookbehind: true, + inside: { + keyword: /\bwith\b/, + 'class-name': /\w+/, + punctuation: /,/, + }, + }, + redirects: { + pattern: /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/, + lookbehind: true, + inside: { + punctuation: /,/, + 'class-name': /\w+/, + operator: /=>/, + }, + }, + property: { + pattern: + /\b(?:Aggregates|[Ii]nterfaces|Java|Javascript|Jolie|[Ll]ocation|OneWay|[Pp]rotocol|Redirects|RequestResponse)\b(?=[ \t]*:)/, + }, +}); diff --git a/public/prism/prism-jolie.min.js b/public/prism/prism-jolie.min.js new file mode 100644 index 0000000..db41ce5 --- /dev/null +++ b/public/prism/prism-jolie.min.js @@ -0,0 +1,38 @@ +(Prism.languages.jolie = Prism.languages.extend('clike', { + string: { + pattern: /(^|[^\\])"(?:\\[\s\S]|[^"\\])*"/, + lookbehind: !0, + greedy: !0, + }, + 'class-name': { + pattern: + /((?:\b(?:as|courier|embed|in|inputPort|outputPort|service)\b|@)[ \t]*)\w+/, + lookbehind: !0, + }, + keyword: + /\b(?:as|cH|comp|concurrent|constants|courier|cset|csets|default|define|else|embed|embedded|execution|exit|extender|for|foreach|forward|from|global|if|import|in|include|init|inputPort|install|instanceof|interface|is_defined|linkIn|linkOut|main|new|nullProcess|outputPort|over|private|provide|public|scope|sequential|service|single|spawn|synchronized|this|throw|throws|type|undef|until|while|with)\b/, + function: /\b[a-z_]\w*(?=[ \t]*[@(])/i, + number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i, + operator: /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[?\/%^@|]/, + punctuation: /[()[\]{},;.:]/, + builtin: + /\b(?:Byte|any|bool|char|double|enum|float|int|length|long|ranges|regex|string|undefined|void)\b/, +})), + Prism.languages.insertBefore('jolie', 'keyword', { + aggregates: { + pattern: + /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/, + lookbehind: !0, + inside: { keyword: /\bwith\b/, 'class-name': /\w+/, punctuation: /,/ }, + }, + redirects: { + pattern: + /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/, + lookbehind: !0, + inside: { punctuation: /,/, 'class-name': /\w+/, operator: /=>/ }, + }, + property: { + pattern: + /\b(?:Aggregates|[Ii]nterfaces|Java|Javascript|Jolie|[Ll]ocation|OneWay|[Pp]rotocol|Redirects|RequestResponse)\b(?=[ \t]*:)/, + }, + }); diff --git a/public/prism/prism-jq.js b/public/prism/prism-jq.js new file mode 100644 index 0000000..a020ed1 --- /dev/null +++ b/public/prism/prism-jq.js @@ -0,0 +1,75 @@ +(function (Prism) { + var interpolation = /\\\((?:[^()]|\([^()]*\))*\)/.source; + var string = RegExp( + /(^|[^\\])"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace( + /__/g, + function () { + return interpolation; + } + ) + ); + var stringInterpolation = { + interpolation: { + pattern: RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + interpolation), + lookbehind: true, + inside: { + content: { + pattern: /^(\\\()[\s\S]+(?=\)$)/, + lookbehind: true, + inside: null, // see below + }, + punctuation: /^\\\(|\)$/, + }, + }, + }; + + var jq = (Prism.languages.jq = { + comment: /#.*/, + property: { + pattern: RegExp(string.source + /(?=\s*:(?!:))/.source), + lookbehind: true, + greedy: true, + inside: stringInterpolation, + }, + string: { + pattern: string, + lookbehind: true, + greedy: true, + inside: stringInterpolation, + }, + + function: { + pattern: /(\bdef\s+)[a-z_]\w+/i, + lookbehind: true, + }, + + variable: /\B\$\w+/, + 'property-literal': { + pattern: /\b[a-z_]\w*(?=\s*:(?!:))/i, + alias: 'property', + }, + keyword: + /\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/, + boolean: /\b(?:false|true)\b/, + number: /(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/, + + operator: [ + { + pattern: /\|=?/, + alias: 'pipe', + }, + /\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|not|or)\b/, + ], + 'c-style-function': { + pattern: /\b[a-z_]\w*(?=\s*\()/i, + alias: 'function', + }, + punctuation: /::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/, + dot: { + pattern: /\./, + alias: 'important', + }, + }); + + stringInterpolation.interpolation.inside.content.inside = jq; +})(Prism); diff --git a/public/prism/prism-jq.min.js b/public/prism/prism-jq.min.js new file mode 100644 index 0000000..3c6a527 --- /dev/null +++ b/public/prism/prism-jq.min.js @@ -0,0 +1,56 @@ +!(function (e) { + var n = '\\\\\\((?:[^()]|\\([^()]*\\))*\\)', + t = RegExp( + '(^|[^\\\\])"(?:[^"\r\n\\\\]|\\\\[^\r\n(]|__)*"'.replace( + /__/g, + function () { + return n; + } + ) + ), + i = { + interpolation: { + pattern: RegExp('((?:^|[^\\\\])(?:\\\\{2})*)' + n), + lookbehind: !0, + inside: { + content: { + pattern: /^(\\\()[\s\S]+(?=\)$)/, + lookbehind: !0, + inside: null, + }, + punctuation: /^\\\(|\)$/, + }, + }, + }, + a = (e.languages.jq = { + comment: /#.*/, + property: { + pattern: RegExp(t.source + '(?=\\s*:(?!:))'), + lookbehind: !0, + greedy: !0, + inside: i, + }, + string: { pattern: t, lookbehind: !0, greedy: !0, inside: i }, + function: { pattern: /(\bdef\s+)[a-z_]\w+/i, lookbehind: !0 }, + variable: /\B\$\w+/, + 'property-literal': { + pattern: /\b[a-z_]\w*(?=\s*:(?!:))/i, + alias: 'property', + }, + keyword: + /\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/, + boolean: /\b(?:false|true)\b/, + number: /(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/, + operator: [ + { pattern: /\|=?/, alias: 'pipe' }, + /\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|not|or)\b/, + ], + 'c-style-function': { + pattern: /\b[a-z_]\w*(?=\s*\()/i, + alias: 'function', + }, + punctuation: /::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/, + dot: { pattern: /\./, alias: 'important' }, + }); + i.interpolation.inside.content.inside = a; +})(Prism); diff --git a/public/prism/prism-js-extras.js b/public/prism/prism-js-extras.js new file mode 100644 index 0000000..48ade6d --- /dev/null +++ b/public/prism/prism-js-extras.js @@ -0,0 +1,155 @@ +(function (Prism) { + Prism.languages.insertBefore('javascript', 'function-variable', { + 'method-variable': { + pattern: RegExp( + '(\\.\\s*)' + + Prism.languages.javascript['function-variable'].pattern.source + ), + lookbehind: true, + alias: ['function-variable', 'method', 'function', 'property-access'], + }, + }); + + Prism.languages.insertBefore('javascript', 'function', { + method: { + pattern: RegExp( + '(\\.\\s*)' + Prism.languages.javascript['function'].source + ), + lookbehind: true, + alias: ['function', 'property-access'], + }, + }); + + Prism.languages.insertBefore('javascript', 'constant', { + 'known-class-name': [ + { + // standard built-ins + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects + pattern: + /\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/, + alias: 'class-name', + }, + { + // errors + pattern: /\b(?:[A-Z]\w*)Error\b/, + alias: 'class-name', + }, + ], + }); + + /** + * Replaces the `` placeholder in the given pattern with a pattern for general JS identifiers. + * + * @param {string} source + * @param {string} [flags] + * @returns {RegExp} + */ + function withId(source, flags) { + return RegExp( + source.replace(//g, function () { + return /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source; + }), + flags + ); + } + Prism.languages.insertBefore('javascript', 'keyword', { + imports: { + // https://tc39.es/ecma262/#sec-imports + pattern: withId( + /(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/ + .source + ), + lookbehind: true, + inside: Prism.languages.javascript, + }, + exports: { + // https://tc39.es/ecma262/#sec-exports + pattern: withId( + /(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/ + .source + ), + lookbehind: true, + inside: Prism.languages.javascript, + }, + }); + + Prism.languages.javascript['keyword'].unshift( + { + pattern: /\b(?:as|default|export|from|import)\b/, + alias: 'module', + }, + { + pattern: + /\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/, + alias: 'control-flow', + }, + { + pattern: /\bnull\b/, + alias: ['null', 'nil'], + }, + { + pattern: /\bundefined\b/, + alias: 'nil', + } + ); + + Prism.languages.insertBefore('javascript', 'operator', { + spread: { + pattern: /\.{3}/, + alias: 'operator', + }, + arrow: { + pattern: /=>/, + alias: 'operator', + }, + }); + + Prism.languages.insertBefore('javascript', 'punctuation', { + 'property-access': { + pattern: withId(/(\.\s*)#?/.source), + lookbehind: true, + }, + 'maybe-class-name': { + pattern: /(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/, + lookbehind: true, + }, + dom: { + // this contains only a few commonly used DOM variables + pattern: + /\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/, + alias: 'variable', + }, + console: { + pattern: /\bconsole(?=\s*\.)/, + alias: 'class-name', + }, + }); + + // add 'maybe-class-name' to tokens which might be a class name + var maybeClassNameTokens = [ + 'function', + 'function-variable', + 'method', + 'method-variable', + 'property-access', + ]; + + for (var i = 0; i < maybeClassNameTokens.length; i++) { + var token = maybeClassNameTokens[i]; + var value = Prism.languages.javascript[token]; + + // convert regex to object + if (Prism.util.type(value) === 'RegExp') { + value = Prism.languages.javascript[token] = { + pattern: value, + }; + } + + // keep in mind that we don't support arrays + + var inside = value.inside || {}; + value.inside = inside; + + inside['maybe-class-name'] = /^[A-Z][\s\S]*/; + } +})(Prism); diff --git a/public/prism/prism-js-extras.min.js b/public/prism/prism-js-extras.min.js new file mode 100644 index 0000000..26d73f2 --- /dev/null +++ b/public/prism/prism-js-extras.min.js @@ -0,0 +1,98 @@ +!(function (a) { + function e(a, e) { + return RegExp( + a.replace(//g, function () { + return '(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*'; + }), + e + ); + } + a.languages.insertBefore('javascript', 'function-variable', { + 'method-variable': { + pattern: RegExp( + '(\\.\\s*)' + a.languages.javascript['function-variable'].pattern.source + ), + lookbehind: !0, + alias: ['function-variable', 'method', 'function', 'property-access'], + }, + }), + a.languages.insertBefore('javascript', 'function', { + method: { + pattern: RegExp('(\\.\\s*)' + a.languages.javascript.function.source), + lookbehind: !0, + alias: ['function', 'property-access'], + }, + }), + a.languages.insertBefore('javascript', 'constant', { + 'known-class-name': [ + { + pattern: + /\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/, + alias: 'class-name', + }, + { pattern: /\b(?:[A-Z]\w*)Error\b/, alias: 'class-name' }, + ], + }), + a.languages.insertBefore('javascript', 'keyword', { + imports: { + pattern: e( + '(\\bimport\\b\\s*)(?:(?:\\s*,\\s*(?:\\*\\s*as\\s+|\\{[^{}]*\\}))?|\\*\\s*as\\s+|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)' + ), + lookbehind: !0, + inside: a.languages.javascript, + }, + exports: { + pattern: e( + '(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})' + ), + lookbehind: !0, + inside: a.languages.javascript, + }, + }), + a.languages.javascript.keyword.unshift( + { pattern: /\b(?:as|default|export|from|import)\b/, alias: 'module' }, + { + pattern: + /\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/, + alias: 'control-flow', + }, + { pattern: /\bnull\b/, alias: ['null', 'nil'] }, + { pattern: /\bundefined\b/, alias: 'nil' } + ), + a.languages.insertBefore('javascript', 'operator', { + spread: { pattern: /\.{3}/, alias: 'operator' }, + arrow: { pattern: /=>/, alias: 'operator' }, + }), + a.languages.insertBefore('javascript', 'punctuation', { + 'property-access': { pattern: e('(\\.\\s*)#?'), lookbehind: !0 }, + 'maybe-class-name': { + pattern: /(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/, + lookbehind: !0, + }, + dom: { + pattern: + /\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/, + alias: 'variable', + }, + console: { pattern: /\bconsole(?=\s*\.)/, alias: 'class-name' }, + }); + for ( + var t = [ + 'function', + 'function-variable', + 'method', + 'method-variable', + 'property-access', + ], + r = 0; + r < t.length; + r++ + ) { + var n = t[r], + s = a.languages.javascript[n]; + 'RegExp' === a.util.type(s) && + (s = a.languages.javascript[n] = { pattern: s }); + var o = s.inside || {}; + (s.inside = o)['maybe-class-name'] = /^[A-Z][\s\S]*/; + } +})(Prism); diff --git a/public/prism/prism-js-templates.js b/public/prism/prism-js-templates.js new file mode 100644 index 0000000..1c819d2 --- /dev/null +++ b/public/prism/prism-js-templates.js @@ -0,0 +1,379 @@ +(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`

` + // div.innerHTML = `

` + createTemplate('html', /\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source), + + // svg`` + createTemplate('svg', /\bsvg/.source), + + // md`# h1`, markdown`## h2` + createTemplate('markdown', /\b(?:markdown|md)/.source), + + // gql`...`, graphql`...`, graphql.experimental`...` + createTemplate( + 'graphql', + /\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source + ), + + // sql`...` + createTemplate('sql', /\bsql/.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} */ + 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 + ) { + /* noop */ + } + 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); diff --git a/public/prism/prism-js-templates.min.js b/public/prism/prism-js-templates.min.js new file mode 100644 index 0000000..c3171c1 --- /dev/null +++ b/public/prism/prism-js-templates.min.js @@ -0,0 +1,146 @@ +!(function (u) { + var e = u.languages.javascript['template-string'], + n = e.pattern.source, + a = e.inside.interpolation, + i = a.inside['interpolation-punctuation'], + r = a.pattern.source; + function t(e, t) { + if (u.languages[e]) + return { + pattern: RegExp('((?:' + t + ')\\s*)' + n), + lookbehind: !0, + greedy: !0, + inside: { + 'template-punctuation': { pattern: /^`|`$/, alias: 'string' }, + 'embedded-code': { pattern: /[\s\S]+/, alias: e }, + }, + }; + } + function s(e, t, n) { + var r = { code: e, grammar: t, language: n }; + return ( + u.hooks.run('before-tokenize', r), + (r.tokens = u.tokenize(r.code, r.grammar)), + u.hooks.run('after-tokenize', r), + r.tokens + ); + } + function d(e) { + var t = {}; + t['interpolation-punctuation'] = i; + var n = u.tokenize(e, t); + if (3 === n.length) { + var r = [1, 1]; + r.push.apply(r, s(n[1], u.languages.javascript, 'javascript')), + n.splice.apply(n, r); + } + return new u.Token('interpolation', n, a.alias, e); + } + function c(a, e, i) { + var t = u.tokenize(a, { + interpolation: { pattern: RegExp(r), lookbehind: !0 }, + }), + f = 0, + y = {}, + n = s( + t + .map(function (e) { + if ('string' == typeof e) return e; + for ( + var t, n = e.content; + -1 !== + a.indexOf( + ((r = f++), (t = '___' + i.toUpperCase() + '_' + r + '___')) + ); + + ); + return (y[t] = n), t; + var r; + }) + .join(''), + e, + i + ), + v = Object.keys(y); + return ( + (f = 0), + (function e(t) { + for (var n = 0; n < t.length; n++) { + if (f >= v.length) return; + var r = t[n]; + if ('string' == typeof r || 'string' == typeof r.content) { + var a = v[f], + i = 'string' == typeof r ? r : r.content, + s = i.indexOf(a); + if (-1 !== s) { + ++f; + var o = i.substring(0, s), + p = d(y[a]), + l = i.substring(s + a.length), + g = []; + if ((o && g.push(o), g.push(p), l)) { + var u = [l]; + e(u), g.push.apply(g, u); + } + 'string' == typeof r + ? (t.splice.apply(t, [n, 1].concat(g)), (n += g.length - 1)) + : (r.content = g); + } + } else { + var c = r.content; + Array.isArray(c) ? e(c) : e([c]); + } + } + })(n), + new u.Token(i, n, 'language-' + i, a) + ); + } + u.languages.javascript['template-string'] = [ + t( + 'css', + '\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)' + ), + t('html', '\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?='), + t('svg', '\\bsvg'), + t('markdown', '\\b(?:markdown|md)'), + t('graphql', '\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)'), + t('sql', '\\bsql'), + e, + ].filter(Boolean); + var o = { javascript: !0, js: !0, typescript: !0, ts: !0, jsx: !0, tsx: !0 }; + function f(e) { + return 'string' == typeof e + ? e + : Array.isArray(e) + ? e.map(f).join('') + : f(e.content); + } + u.hooks.add('after-tokenize', function (e) { + e.language in o && + !(function e(t) { + for (var n = 0, r = t.length; n < r; n++) { + var a = t[n]; + if ('string' != typeof a) { + var i = a.content; + if (Array.isArray(i)) + if ('template-string' === a.type) { + var s = i[1]; + if ( + 3 === i.length && + 'string' != typeof s && + 'embedded-code' === s.type + ) { + var o = f(s), + p = s.alias, + l = Array.isArray(p) ? p[0] : p, + g = u.languages[l]; + if (!g) continue; + i[1] = c(o, g, l); + } + } else e(i); + else 'string' != typeof i && e([i]); + } + } + })(e.tokens); + }); +})(Prism); diff --git a/public/prism/prism-jsdoc.js b/public/prism/prism-jsdoc.js new file mode 100644 index 0000000..fee0bc0 --- /dev/null +++ b/public/prism/prism-jsdoc.js @@ -0,0 +1,90 @@ +(function (Prism) { + var javascript = Prism.languages.javascript; + + var type = /\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source; + var parameterPrefix = + '(@(?:arg|argument|param|property)\\s+(?:' + type + '\\s+)?)'; + + Prism.languages.jsdoc = Prism.languages.extend('javadoclike', { + parameter: { + // @param {string} foo - foo bar + pattern: RegExp( + parameterPrefix + /(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source + ), + lookbehind: true, + inside: { + punctuation: /\./, + }, + }, + }); + + Prism.languages.insertBefore('jsdoc', 'keyword', { + 'optional-parameter': { + // @param {string} [baz.foo="bar"] foo bar + pattern: RegExp( + parameterPrefix + + /\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source + ), + lookbehind: true, + inside: { + parameter: { + pattern: /(^\[)[$\w\xA0-\uFFFF\.]+/, + lookbehind: true, + inside: { + punctuation: /\./, + }, + }, + code: { + pattern: /(=)[\s\S]*(?=\]$)/, + lookbehind: true, + inside: javascript, + alias: 'language-javascript', + }, + punctuation: /[=[\]]/, + }, + }, + 'class-name': [ + { + pattern: RegExp( + /(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace( + //g, + function () { + return type; + } + ) + ), + lookbehind: true, + inside: { + punctuation: /\./, + }, + }, + { + pattern: RegExp('(@[a-z]+\\s+)' + type), + lookbehind: true, + inside: { + string: javascript.string, + number: javascript.number, + boolean: javascript.boolean, + keyword: Prism.languages.typescript.keyword, + operator: /=>|\.\.\.|[&|?:*]/, + punctuation: /[.,;=<>{}()[\]]/, + }, + }, + ], + example: { + pattern: + /(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/, + lookbehind: true, + inside: { + code: { + pattern: /^([\t ]*(?:\*\s*)?)\S.*$/m, + lookbehind: true, + inside: javascript, + alias: 'language-javascript', + }, + }, + }, + }); + + Prism.languages.javadoclike.addSupport('javascript', Prism.languages.jsdoc); +})(Prism); diff --git a/public/prism/prism-jsdoc.min.js b/public/prism/prism-jsdoc.min.js new file mode 100644 index 0000000..85566dc --- /dev/null +++ b/public/prism/prism-jsdoc.min.js @@ -0,0 +1,74 @@ +!(function (e) { + var a = e.languages.javascript, + n = '\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})+\\}', + t = '(@(?:arg|argument|param|property)\\s+(?:' + n + '\\s+)?)'; + (e.languages.jsdoc = e.languages.extend('javadoclike', { + parameter: { + pattern: RegExp(t + '(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?=\\s|$)'), + lookbehind: !0, + inside: { punctuation: /\./ }, + }, + })), + e.languages.insertBefore('jsdoc', 'keyword', { + 'optional-parameter': { + pattern: RegExp( + t + '\\[(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?:=[^[\\]]+)?\\](?=\\s|$)' + ), + lookbehind: !0, + inside: { + parameter: { + pattern: /(^\[)[$\w\xA0-\uFFFF\.]+/, + lookbehind: !0, + inside: { punctuation: /\./ }, + }, + code: { + pattern: /(=)[\s\S]*(?=\]$)/, + lookbehind: !0, + inside: a, + alias: 'language-javascript', + }, + punctuation: /[=[\]]/, + }, + }, + 'class-name': [ + { + pattern: RegExp( + '(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\\s+(?:\\s+)?)[A-Z]\\w*(?:\\.[A-Z]\\w*)*'.replace( + //g, + function () { + return n; + } + ) + ), + lookbehind: !0, + inside: { punctuation: /\./ }, + }, + { + pattern: RegExp('(@[a-z]+\\s+)' + n), + lookbehind: !0, + inside: { + string: a.string, + number: a.number, + boolean: a.boolean, + keyword: e.languages.typescript.keyword, + operator: /=>|\.\.\.|[&|?:*]/, + punctuation: /[.,;=<>{}()[\]]/, + }, + }, + ], + example: { + pattern: + /(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/, + lookbehind: !0, + inside: { + code: { + pattern: /^([\t ]*(?:\*\s*)?)\S.*$/m, + lookbehind: !0, + inside: a, + alias: 'language-javascript', + }, + }, + }, + }), + e.languages.javadoclike.addSupport('javascript', e.languages.jsdoc); +})(Prism); diff --git a/public/prism/prism-json.js b/public/prism/prism-json.js new file mode 100644 index 0000000..aa20c47 --- /dev/null +++ b/public/prism/prism-json.js @@ -0,0 +1,27 @@ +// https://www.json.org/json-en.html +Prism.languages.json = { + property: { + pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, + lookbehind: true, + greedy: true, + }, + string: { + pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, + lookbehind: true, + greedy: true, + }, + comment: { + pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: true, + }, + number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, + punctuation: /[{}[\],]/, + operator: /:/, + boolean: /\b(?:false|true)\b/, + null: { + pattern: /\bnull\b/, + alias: 'keyword', + }, +}; + +Prism.languages.webmanifest = Prism.languages.json; diff --git a/public/prism/prism-json.min.js b/public/prism/prism-json.min.js new file mode 100644 index 0000000..3e5a0a0 --- /dev/null +++ b/public/prism/prism-json.min.js @@ -0,0 +1,19 @@ +(Prism.languages.json = { + property: { + pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, + lookbehind: !0, + greedy: !0, + }, + string: { + pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, + lookbehind: !0, + greedy: !0, + }, + comment: { pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, + number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, + punctuation: /[{}[\],]/, + operator: /:/, + boolean: /\b(?:false|true)\b/, + null: { pattern: /\bnull\b/, alias: 'keyword' }, +}), + (Prism.languages.webmanifest = Prism.languages.json); diff --git a/public/prism/prism-json5.js b/public/prism/prism-json5.js new file mode 100644 index 0000000..6f0eab8 --- /dev/null +++ b/public/prism/prism-json5.js @@ -0,0 +1,23 @@ +(function (Prism) { + var string = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/; + + Prism.languages.json5 = Prism.languages.extend('json', { + property: [ + { + pattern: RegExp(string.source + '(?=\\s*:)'), + greedy: true, + }, + { + pattern: + /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/, + alias: 'unquoted', + }, + ], + string: { + pattern: string, + greedy: true, + }, + number: + /[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/, + }); +})(Prism); diff --git a/public/prism/prism-json5.min.js b/public/prism/prism-json5.min.js new file mode 100644 index 0000000..0e19ea9 --- /dev/null +++ b/public/prism/prism-json5.min.js @@ -0,0 +1,16 @@ +!(function (n) { + var e = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/; + n.languages.json5 = n.languages.extend('json', { + property: [ + { pattern: RegExp(e.source + '(?=\\s*:)'), greedy: !0 }, + { + pattern: + /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/, + alias: 'unquoted', + }, + ], + string: { pattern: e, greedy: !0 }, + number: + /[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/, + }); +})(Prism); diff --git a/public/prism/prism-jsonp.js b/public/prism/prism-jsonp.js new file mode 100644 index 0000000..3c45e9d --- /dev/null +++ b/public/prism/prism-jsonp.js @@ -0,0 +1,7 @@ +Prism.languages.jsonp = Prism.languages.extend('json', { + punctuation: /[{}[\]();,.]/, +}); + +Prism.languages.insertBefore('jsonp', 'punctuation', { + function: /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/, +}); diff --git a/public/prism/prism-jsonp.min.js b/public/prism/prism-jsonp.min.js new file mode 100644 index 0000000..edb2c95 --- /dev/null +++ b/public/prism/prism-jsonp.min.js @@ -0,0 +1,6 @@ +(Prism.languages.jsonp = Prism.languages.extend('json', { + punctuation: /[{}[\]();,.]/, +})), + Prism.languages.insertBefore('jsonp', 'punctuation', { + function: /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/, + }); diff --git a/public/prism/prism-jsstacktrace.js b/public/prism/prism-jsstacktrace.js new file mode 100644 index 0000000..e7fe02c --- /dev/null +++ b/public/prism/prism-jsstacktrace.js @@ -0,0 +1,50 @@ +Prism.languages.jsstacktrace = { + 'error-message': { + pattern: /^\S.*/m, + alias: 'string', + }, + + 'stack-frame': { + pattern: /(^[ \t]+)at[ \t].*/m, + lookbehind: true, + inside: { + 'not-my-code': { + pattern: + /^at[ \t]+(?!\s)(?:node\.js||.*(?:node_modules|\(\)|\(|$|\(internal\/|\(node\.js)).*/m, + alias: 'comment', + }, + + filename: { + pattern: /(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/, + lookbehind: true, + alias: 'url', + }, + + function: { + pattern: + /(\bat\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/, + lookbehind: true, + inside: { + punctuation: /\./, + }, + }, + + punctuation: /[()]/, + + keyword: /\b(?:at|new)\b/, + + alias: { + pattern: /\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/, + alias: 'variable', + }, + + 'line-number': { + pattern: /:\d+(?::\d+)?\b/, + alias: 'number', + inside: { + punctuation: /:/, + }, + }, + }, + }, +}; diff --git a/public/prism/prism-jsstacktrace.min.js b/public/prism/prism-jsstacktrace.min.js new file mode 100644 index 0000000..19bf6a7 --- /dev/null +++ b/public/prism/prism-jsstacktrace.min.js @@ -0,0 +1,36 @@ +Prism.languages.jsstacktrace = { + 'error-message': { pattern: /^\S.*/m, alias: 'string' }, + 'stack-frame': { + pattern: /(^[ \t]+)at[ \t].*/m, + lookbehind: !0, + inside: { + 'not-my-code': { + pattern: + /^at[ \t]+(?!\s)(?:node\.js||.*(?:node_modules|\(\)|\(|$|\(internal\/|\(node\.js)).*/m, + alias: 'comment', + }, + filename: { + pattern: /(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/, + lookbehind: !0, + alias: 'url', + }, + function: { + pattern: + /(\bat\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/, + lookbehind: !0, + inside: { punctuation: /\./ }, + }, + punctuation: /[()]/, + keyword: /\b(?:at|new)\b/, + alias: { + pattern: /\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/, + alias: 'variable', + }, + 'line-number': { + pattern: /:\d+(?::\d+)?\b/, + alias: 'number', + inside: { punctuation: /:/ }, + }, + }, + }, +}; diff --git a/public/prism/prism-jsx.js b/public/prism/prism-jsx.js new file mode 100644 index 0000000..7a0e922 --- /dev/null +++ b/public/prism/prism-jsx.js @@ -0,0 +1,185 @@ +(function (Prism) { + var javascript = Prism.util.clone(Prism.languages.javascript); + + var space = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source; + var braces = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source; + var spread = /(?:\{*\.{3}(?:[^{}]|)*\})/.source; + + /** + * @param {string} source + * @param {string} [flags] + */ + function re(source, flags) { + source = source + .replace(//g, function () { + return space; + }) + .replace(//g, function () { + return braces; + }) + .replace(//g, function () { + return spread; + }); + return RegExp(source, flags); + } + + spread = re(spread).source; + + Prism.languages.jsx = Prism.languages.extend('markup', javascript); + Prism.languages.jsx.tag.pattern = re( + /<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/ + .source + ); + + Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/; + Prism.languages.jsx.tag.inside['attr-value'].pattern = + /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/; + Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = + /^[A-Z]\w*(?:\.[A-Z]\w*)*$/; + Prism.languages.jsx.tag.inside['comment'] = javascript['comment']; + + Prism.languages.insertBefore( + 'inside', + 'attr-name', + { + spread: { + pattern: re(//.source), + inside: Prism.languages.jsx, + }, + }, + Prism.languages.jsx.tag + ); + + Prism.languages.insertBefore( + 'inside', + 'special-attr', + { + script: { + // Allow for two levels of nesting + pattern: re(/=/.source), + alias: 'language-javascript', + inside: { + 'script-punctuation': { + pattern: /^=(?=\{)/, + alias: 'punctuation', + }, + rest: Prism.languages.jsx, + }, + }, + }, + Prism.languages.jsx.tag + ); + + // The following will handle plain text inside tags + var stringifyToken = function (token) { + if (!token) { + return ''; + } + if (typeof token === 'string') { + return token; + } + if (typeof token.content === 'string') { + return token.content; + } + return token.content.map(stringifyToken).join(''); + }; + + var walkTokens = function (tokens) { + var openedTags = []; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + var notTagNorBrace = false; + + if (typeof token !== 'string') { + if ( + token.type === 'tag' && + token.content[0] && + token.content[0].type === 'tag' + ) { + // We found a tag, now find its kind + + if (token.content[0].content[0].content === ' 0 && + openedTags[openedTags.length - 1].tagName === + stringifyToken(token.content[0].content[1]) + ) { + // Pop matching opening tag + openedTags.pop(); + } + } else { + if (token.content[token.content.length - 1].content === '/>') { + // Autoclosed tag, ignore + } else { + // Opening tag + openedTags.push({ + tagName: stringifyToken(token.content[0].content[1]), + openedBraces: 0, + }); + } + } + } else if ( + openedTags.length > 0 && + token.type === 'punctuation' && + token.content === '{' + ) { + // Here we might have entered a JSX context inside a tag + openedTags[openedTags.length - 1].openedBraces++; + } else if ( + openedTags.length > 0 && + openedTags[openedTags.length - 1].openedBraces > 0 && + token.type === 'punctuation' && + token.content === '}' + ) { + // Here we might have left a JSX context inside a tag + openedTags[openedTags.length - 1].openedBraces--; + } else { + notTagNorBrace = true; + } + } + if (notTagNorBrace || typeof token === 'string') { + if ( + openedTags.length > 0 && + openedTags[openedTags.length - 1].openedBraces === 0 + ) { + // Here we are inside a tag, and not inside a JSX context. + // That's plain text: drop any tokens matched. + var plainText = stringifyToken(token); + + // And merge text with adjacent text + if ( + i < tokens.length - 1 && + (typeof tokens[i + 1] === 'string' || + tokens[i + 1].type === 'plain-text') + ) { + plainText += stringifyToken(tokens[i + 1]); + tokens.splice(i + 1, 1); + } + if ( + i > 0 && + (typeof tokens[i - 1] === 'string' || + tokens[i - 1].type === 'plain-text') + ) { + plainText = stringifyToken(tokens[i - 1]) + plainText; + tokens.splice(i - 1, 1); + i--; + } + + tokens[i] = new Prism.Token('plain-text', plainText, null, plainText); + } + } + + if (token.content && typeof token.content !== 'string') { + walkTokens(token.content); + } + } + }; + + Prism.hooks.add('after-tokenize', function (env) { + if (env.language !== 'jsx' && env.language !== 'tsx') { + return; + } + walkTokens(env.tokens); + }); +})(Prism); diff --git a/public/prism/prism-jsx.min.js b/public/prism/prism-jsx.min.js new file mode 100644 index 0000000..121a56f --- /dev/null +++ b/public/prism/prism-jsx.min.js @@ -0,0 +1,103 @@ +!(function (o) { + var t = o.util.clone(o.languages.javascript), + e = '(?:\\{*\\.{3}(?:[^{}]|)*\\})'; + function n(t, n) { + return ( + (t = t + .replace(//g, function () { + return '(?:\\s|//.*(?!.)|/\\*(?:[^*]|\\*(?!/))\\*/)'; + }) + .replace(//g, function () { + return '(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})'; + }) + .replace(//g, function () { + return e; + })), + RegExp(t, n) + ); + } + (e = n(e).source), + (o.languages.jsx = o.languages.extend('markup', t)), + (o.languages.jsx.tag.pattern = n( + '+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[^]|[^\\\\"])*"|\'(?:\\\\[^]|[^\\\\\'])*\'|[^\\s{\'"/>=]+|))?|))**/?)?>' + )), + (o.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/), + (o.languages.jsx.tag.inside['attr-value'].pattern = + /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/), + (o.languages.jsx.tag.inside.tag.inside['class-name'] = + /^[A-Z]\w*(?:\.[A-Z]\w*)*$/), + (o.languages.jsx.tag.inside.comment = t.comment), + o.languages.insertBefore( + 'inside', + 'attr-name', + { spread: { pattern: n(''), inside: o.languages.jsx } }, + o.languages.jsx.tag + ), + o.languages.insertBefore( + 'inside', + 'special-attr', + { + script: { + pattern: n('='), + alias: 'language-javascript', + inside: { + 'script-punctuation': { pattern: /^=(?=\{)/, alias: 'punctuation' }, + rest: o.languages.jsx, + }, + }, + }, + o.languages.jsx.tag + ); + var i = function (t) { + return t + ? 'string' == typeof t + ? t + : 'string' == typeof t.content + ? t.content + : t.content.map(i).join('') + : ''; + }, + r = function (t) { + for (var n = [], e = 0; e < t.length; e++) { + var a = t[e], + s = !1; + if ( + ('string' != typeof a && + ('tag' === a.type && a.content[0] && 'tag' === a.content[0].type + ? '' === a.content[a.content.length - 1].content || + n.push({ + tagName: i(a.content[0].content[1]), + openedBraces: 0, + }) + : 0 < n.length && 'punctuation' === a.type && '{' === a.content + ? n[n.length - 1].openedBraces++ + : 0 < n.length && + 0 < n[n.length - 1].openedBraces && + 'punctuation' === a.type && + '}' === a.content + ? n[n.length - 1].openedBraces-- + : (s = !0)), + (s || 'string' == typeof a) && + 0 < n.length && + 0 === n[n.length - 1].openedBraces) + ) { + var g = i(a); + e < t.length - 1 && + ('string' == typeof t[e + 1] || 'plain-text' === t[e + 1].type) && + ((g += i(t[e + 1])), t.splice(e + 1, 1)), + 0 < e && + ('string' == typeof t[e - 1] || 'plain-text' === t[e - 1].type) && + ((g = i(t[e - 1]) + g), t.splice(e - 1, 1), e--), + (t[e] = new o.Token('plain-text', g, null, g)); + } + a.content && 'string' != typeof a.content && r(a.content); + } + }; + o.hooks.add('after-tokenize', function (t) { + ('jsx' !== t.language && 'tsx' !== t.language) || r(t.tokens); + }); +})(Prism); diff --git a/public/prism/prism-julia.js b/public/prism/prism-julia.js new file mode 100644 index 0000000..ff339ae --- /dev/null +++ b/public/prism/prism-julia.js @@ -0,0 +1,40 @@ +Prism.languages.julia = { + comment: { + // support one level of nested comments + // https://github.com/JuliaLang/julia/pull/6128 + pattern: + /(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/, + lookbehind: true, + }, + regex: { + // https://docs.julialang.org/en/v1/manual/strings/#Regular-Expressions-1 + pattern: /r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/, + greedy: true, + }, + string: { + // https://docs.julialang.org/en/v1/manual/strings/#String-Basics-1 + // https://docs.julialang.org/en/v1/manual/strings/#non-standard-string-literals-1 + // https://docs.julialang.org/en/v1/manual/running-external-programs/#Running-External-Programs-1 + pattern: + /"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|`(?:[^\\`\r\n]|\\.)*`/, + greedy: true, + }, + char: { + // https://docs.julialang.org/en/v1/manual/strings/#man-characters-1 + pattern: /(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'/, + lookbehind: true, + greedy: true, + }, + keyword: + /\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/, + boolean: /\b(?:false|true)\b/, + number: + /(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i, + // https://docs.julialang.org/en/v1/manual/mathematical-operations/ + // https://docs.julialang.org/en/v1/manual/mathematical-operations/#Operator-Precedence-and-Associativity-1 + operator: + /&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/, + punctuation: /::?|[{}[\]();,.?]/, + // https://docs.julialang.org/en/v1/base/numbers/#Base.im + constant: /\b(?:(?:Inf|NaN)(?:16|32|64)?|im|pi)\b|[πℯ]/, +}; diff --git a/public/prism/prism-julia.min.js b/public/prism/prism-julia.min.js new file mode 100644 index 0000000..35e50ed --- /dev/null +++ b/public/prism/prism-julia.min.js @@ -0,0 +1,27 @@ +Prism.languages.julia = { + comment: { + pattern: + /(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/, + lookbehind: !0, + }, + regex: { pattern: /r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/, greedy: !0 }, + string: { + pattern: + /"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|`(?:[^\\`\r\n]|\\.)*`/, + greedy: !0, + }, + char: { + pattern: /(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'/, + lookbehind: !0, + greedy: !0, + }, + keyword: + /\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/, + boolean: /\b(?:false|true)\b/, + number: + /(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i, + operator: + /&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/, + punctuation: /::?|[{}[\]();,.?]/, + constant: /\b(?:(?:Inf|NaN)(?:16|32|64)?|im|pi)\b|[πℯ]/, +}; diff --git a/public/prism/prism-keepalived.js b/public/prism/prism-keepalived.js new file mode 100644 index 0000000..543374a --- /dev/null +++ b/public/prism/prism-keepalived.js @@ -0,0 +1,60 @@ +Prism.languages.keepalived = { + comment: { + pattern: /[#!].*/, + greedy: true, + }, + string: { + pattern: + /(^|[^\\])(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/, + lookbehind: true, + greedy: true, + }, + + // support IPv4, IPv6, subnet mask + ip: { + pattern: RegExp( + /\b(?:(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){5}:(?:[\da-f]{1,4}:)?[\da-f]{1,4}|(?:[\da-f]{1,4}:){4}:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4}|(?:[\da-f]{1,4}:){3}:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4}|(?:[\da-f]{1,4}:){2}:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}|(?:[\da-f]{1,4}:){0,5}:|::(?:[\da-f]{1,4}:){0,5}|[\da-f]{1,4}::(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4}|::(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:)(?:\/\d{1,3})?|(?:\/\d{1,2})?)\b/.source.replace( + //g, + function () { + return /(?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d))/ + .source; + } + ), + 'i' + ), + alias: 'number', + }, + + // support *nix / Windows, directory / file + path: { + pattern: + /(\s)\/(?:[^\/\s]+\/)*[^\/\s]*|\b[a-zA-Z]:\\(?:[^\\\s]+\\)*[^\\\s]*/, + lookbehind: true, + alias: 'string', + }, + variable: /\$\{?\w+\}?/, + email: { + pattern: /[\w-]+@[\w-]+(?:\.[\w-]{2,3}){1,2}/, + alias: 'string', + }, + 'conditional-configuration': { + pattern: /@\^?[\w-]+/, + alias: 'variable', + }, + operator: /=/, + + property: + /\b(?:BFD_CHECK|DNS_CHECK|FILE_CHECK|HTTP_GET|MISC_CHECK|NAME|PING_CHECK|SCRIPTS|SMTP_CHECK|SSL|SSL_GET|TCP_CHECK|UDP_CHECK|accept|advert_int|alpha|auth_pass|auth_type|authentication|bfd_cpu_affinity|bfd_instance|bfd_no_swap|bfd_priority|bfd_process_name|bfd_rlimit_rttime|bfd_rt_priority|bind_if|bind_port|bindto|ca|certificate|check_unicast_src|checker|checker_cpu_affinity|checker_log_all_failures|checker_no_swap|checker_priority|checker_rlimit_rttime|checker_rt_priority|child_wait_time|connect_ip|connect_port|connect_timeout|dbus_service_name|debug|default_interface|delay|delay_before_retry|delay_loop|digest|dont_track_primary|dynamic|dynamic_interfaces|enable_(?:dbus|script_security|sni|snmp_checker|snmp_rfc|snmp_rfcv2|snmp_rfcv3|snmp_vrrp|traps)|end|fall|fast_recovery|file|flag-[123]|fork_delay|full_command|fwmark|garp_group|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|global_defs|global_tracking|gna_interval|group|ha_suspend|hashed|helo_name|higher_prio_send_advert|hoplimit|http_protocol|hysteresis|idle_tx|include|inhibit_on_failure|init_fail|init_file|instance|interface|interfaces|interval|ip_family|ipvs_process_name|keepalived.conf|kernel_rx_buf_size|key|linkbeat_interfaces|linkbeat_use_polling|log_all_failures|log_unknown_vrids|lower_prio_no_advert|lthreshold|lvs_flush|lvs_flush_onstop|lvs_method|lvs_netlink_cmd_rcv_bufs|lvs_netlink_cmd_rcv_bufs_force|lvs_netlink_monitor_rcv_bufs|lvs_netlink_monitor_rcv_bufs_force|lvs_notify_fifo|lvs_notify_fifo_script|lvs_sched|lvs_sync_daemon|max_auto_priority|max_hops|mcast_src_ip|mh-fallback|mh-port|min_auto_priority_delay|min_rx|min_tx|misc_dynamic|misc_path|misc_timeout|multiplier|name|namespace_with_ipsets|native_ipv6|neighbor_ip|net_namespace|net_namespace_ipvs|nftables|nftables_counters|nftables_ifindex|nftables_priority|no_accept|no_checker_emails|no_email_faults|nopreempt|notification_email|notification_email_from|notify|notify_backup|notify_deleted|notify_down|notify_fault|notify_fifo|notify_fifo_script|notify_master|notify_master_rx_lower_pri|notify_priority_changes|notify_stop|notify_up|old_unicast_checksum|omega|ops|param_match|passive|password|path|persistence_engine|persistence_granularity|persistence_timeout|preempt|preempt_delay|priority|process|process_monitor_rcv_bufs|process_monitor_rcv_bufs_force|process_name|process_names|promote_secondaries|protocol|proxy_arp|proxy_arp_pvlan|quorum|quorum_down|quorum_max|quorum_up|random_seed|real_server|regex|regex_max_offset|regex_min_offset|regex_no_match|regex_options|regex_stack|reload_repeat|reload_time_file|require_reply|retry|rise|router_id|rs_init_notifies|script|script_user|sh-fallback|sh-port|shutdown_script|shutdown_script_timeout|skip_check_adv_addr|smtp_alert|smtp_alert_checker|smtp_alert_vrrp|smtp_connect_timeout|smtp_helo_name|smtp_server|snmp_socket|sorry_server|sorry_server_inhibit|sorry_server_lvs_method|source_ip|start|startup_script|startup_script_timeout|state|static_ipaddress|static_routes|static_rules|status_code|step|strict_mode|sync_group_tracking_weight|terminate_delay|timeout|track_bfd|track_file|track_group|track_interface|track_process|track_script|track_src_ip|ttl|type|umask|unicast_peer|unicast_src_ip|unicast_ttl|url|use_ipvlan|use_pid_dir|use_vmac|user|uthreshold|val[123]|version|virtual_ipaddress|virtual_ipaddress_excluded|virtual_router_id|virtual_routes|virtual_rules|virtual_server|virtual_server_group|virtualhost|vmac_xmit_base|vrrp|vrrp_(?:check_unicast_src|cpu_affinity|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|gna_interval|higher_prio_send_advert|instance|ipsets|iptables|lower_prio_no_advert|mcast_group4|mcast_group6|min_garp|netlink_cmd_rcv_bufs|netlink_cmd_rcv_bufs_force|netlink_monitor_rcv_bufs|netlink_monitor_rcv_bufs_force|no_swap|notify_fifo|notify_fifo_script|notify_priority_changes|priority|process_name|rlimit_rttime|rt_priority|rx_bufs_multiplier|rx_bufs_policy|script|skip_check_adv_addr|startup_delay|strict|sync_group|track_process|version)|warmup|weight)\b/, + + constant: + /\b(?:A|AAAA|AH|BACKUP|CNAME|DR|MASTER|MX|NAT|NS|PASS|SCTP|SOA|TCP|TUN|TXT|UDP|dh|fo|lblc|lblcr|lc|mh|nq|ovf|rr|sed|sh|wlc|wrr)\b/, + + number: { + pattern: /(^|[^\w.-])-?\d+(?:\.\d+)?/, + lookbehind: true, + }, + + boolean: /\b(?:false|no|off|on|true|yes)\b/, + + punctuation: /[\{\}]/, +}; diff --git a/public/prism/prism-keepalived.min.js b/public/prism/prism-keepalived.min.js new file mode 100644 index 0000000..88f4236 --- /dev/null +++ b/public/prism/prism-keepalived.min.js @@ -0,0 +1,38 @@ +Prism.languages.keepalived = { + comment: { pattern: /[#!].*/, greedy: !0 }, + string: { + pattern: + /(^|[^\\])(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/, + lookbehind: !0, + greedy: !0, + }, + ip: { + pattern: RegExp( + '\\b(?:(?:(?:[\\da-f]{1,4}:){7}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){6}:[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){5}:(?:[\\da-f]{1,4}:)?[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){4}:(?:[\\da-f]{1,4}:){0,2}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){3}:(?:[\\da-f]{1,4}:){0,3}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){2}:(?:[\\da-f]{1,4}:){0,4}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){6}|(?:[\\da-f]{1,4}:){0,5}:|::(?:[\\da-f]{1,4}:){0,5}|[\\da-f]{1,4}::(?:[\\da-f]{1,4}:){0,5}[\\da-f]{1,4}|::(?:[\\da-f]{1,4}:){0,6}[\\da-f]{1,4}|(?:[\\da-f]{1,4}:){1,7}:)(?:/\\d{1,3})?|(?:/\\d{1,2})?)\\b'.replace( + //g, + function () { + return '(?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d))'; + } + ), + 'i' + ), + alias: 'number', + }, + path: { + pattern: + /(\s)\/(?:[^\/\s]+\/)*[^\/\s]*|\b[a-zA-Z]:\\(?:[^\\\s]+\\)*[^\\\s]*/, + lookbehind: !0, + alias: 'string', + }, + variable: /\$\{?\w+\}?/, + email: { pattern: /[\w-]+@[\w-]+(?:\.[\w-]{2,3}){1,2}/, alias: 'string' }, + 'conditional-configuration': { pattern: /@\^?[\w-]+/, alias: 'variable' }, + operator: /=/, + property: + /\b(?:BFD_CHECK|DNS_CHECK|FILE_CHECK|HTTP_GET|MISC_CHECK|NAME|PING_CHECK|SCRIPTS|SMTP_CHECK|SSL|SSL_GET|TCP_CHECK|UDP_CHECK|accept|advert_int|alpha|auth_pass|auth_type|authentication|bfd_cpu_affinity|bfd_instance|bfd_no_swap|bfd_priority|bfd_process_name|bfd_rlimit_rttime|bfd_rt_priority|bind_if|bind_port|bindto|ca|certificate|check_unicast_src|checker|checker_cpu_affinity|checker_log_all_failures|checker_no_swap|checker_priority|checker_rlimit_rttime|checker_rt_priority|child_wait_time|connect_ip|connect_port|connect_timeout|dbus_service_name|debug|default_interface|delay|delay_before_retry|delay_loop|digest|dont_track_primary|dynamic|dynamic_interfaces|enable_(?:dbus|script_security|sni|snmp_checker|snmp_rfc|snmp_rfcv2|snmp_rfcv3|snmp_vrrp|traps)|end|fall|fast_recovery|file|flag-[123]|fork_delay|full_command|fwmark|garp_group|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|global_defs|global_tracking|gna_interval|group|ha_suspend|hashed|helo_name|higher_prio_send_advert|hoplimit|http_protocol|hysteresis|idle_tx|include|inhibit_on_failure|init_fail|init_file|instance|interface|interfaces|interval|ip_family|ipvs_process_name|keepalived.conf|kernel_rx_buf_size|key|linkbeat_interfaces|linkbeat_use_polling|log_all_failures|log_unknown_vrids|lower_prio_no_advert|lthreshold|lvs_flush|lvs_flush_onstop|lvs_method|lvs_netlink_cmd_rcv_bufs|lvs_netlink_cmd_rcv_bufs_force|lvs_netlink_monitor_rcv_bufs|lvs_netlink_monitor_rcv_bufs_force|lvs_notify_fifo|lvs_notify_fifo_script|lvs_sched|lvs_sync_daemon|max_auto_priority|max_hops|mcast_src_ip|mh-fallback|mh-port|min_auto_priority_delay|min_rx|min_tx|misc_dynamic|misc_path|misc_timeout|multiplier|name|namespace_with_ipsets|native_ipv6|neighbor_ip|net_namespace|net_namespace_ipvs|nftables|nftables_counters|nftables_ifindex|nftables_priority|no_accept|no_checker_emails|no_email_faults|nopreempt|notification_email|notification_email_from|notify|notify_backup|notify_deleted|notify_down|notify_fault|notify_fifo|notify_fifo_script|notify_master|notify_master_rx_lower_pri|notify_priority_changes|notify_stop|notify_up|old_unicast_checksum|omega|ops|param_match|passive|password|path|persistence_engine|persistence_granularity|persistence_timeout|preempt|preempt_delay|priority|process|process_monitor_rcv_bufs|process_monitor_rcv_bufs_force|process_name|process_names|promote_secondaries|protocol|proxy_arp|proxy_arp_pvlan|quorum|quorum_down|quorum_max|quorum_up|random_seed|real_server|regex|regex_max_offset|regex_min_offset|regex_no_match|regex_options|regex_stack|reload_repeat|reload_time_file|require_reply|retry|rise|router_id|rs_init_notifies|script|script_user|sh-fallback|sh-port|shutdown_script|shutdown_script_timeout|skip_check_adv_addr|smtp_alert|smtp_alert_checker|smtp_alert_vrrp|smtp_connect_timeout|smtp_helo_name|smtp_server|snmp_socket|sorry_server|sorry_server_inhibit|sorry_server_lvs_method|source_ip|start|startup_script|startup_script_timeout|state|static_ipaddress|static_routes|static_rules|status_code|step|strict_mode|sync_group_tracking_weight|terminate_delay|timeout|track_bfd|track_file|track_group|track_interface|track_process|track_script|track_src_ip|ttl|type|umask|unicast_peer|unicast_src_ip|unicast_ttl|url|use_ipvlan|use_pid_dir|use_vmac|user|uthreshold|val[123]|version|virtual_ipaddress|virtual_ipaddress_excluded|virtual_router_id|virtual_routes|virtual_rules|virtual_server|virtual_server_group|virtualhost|vmac_xmit_base|vrrp|vrrp_(?:check_unicast_src|cpu_affinity|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|gna_interval|higher_prio_send_advert|instance|ipsets|iptables|lower_prio_no_advert|mcast_group4|mcast_group6|min_garp|netlink_cmd_rcv_bufs|netlink_cmd_rcv_bufs_force|netlink_monitor_rcv_bufs|netlink_monitor_rcv_bufs_force|no_swap|notify_fifo|notify_fifo_script|notify_priority_changes|priority|process_name|rlimit_rttime|rt_priority|rx_bufs_multiplier|rx_bufs_policy|script|skip_check_adv_addr|startup_delay|strict|sync_group|track_process|version)|warmup|weight)\b/, + constant: + /\b(?:A|AAAA|AH|BACKUP|CNAME|DR|MASTER|MX|NAT|NS|PASS|SCTP|SOA|TCP|TUN|TXT|UDP|dh|fo|lblc|lblcr|lc|mh|nq|ovf|rr|sed|sh|wlc|wrr)\b/, + number: { pattern: /(^|[^\w.-])-?\d+(?:\.\d+)?/, lookbehind: !0 }, + boolean: /\b(?:false|no|off|on|true|yes)\b/, + punctuation: /[\{\}]/, +}; diff --git a/public/prism/prism-keyman.js b/public/prism/prism-keyman.js new file mode 100644 index 0000000..cc58923 --- /dev/null +++ b/public/prism/prism-keyman.js @@ -0,0 +1,47 @@ +Prism.languages.keyman = { + comment: { + pattern: /\bc .*/i, + greedy: true, + }, + string: { + pattern: /"[^"\r\n]*"|'[^'\r\n]*'/, + greedy: true, + }, + 'virtual-key': { + pattern: + /\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i, + greedy: true, + alias: 'function', // alias for styles + }, + + // https://help.keyman.com/developer/language/guide/headers + 'header-keyword': { + pattern: /&\w+/, + alias: 'bold', // alias for styles + }, + 'header-statement': { + pattern: + /\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i, + alias: 'bold', // alias for styles + }, + + 'rule-keyword': { + pattern: + /\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i, + alias: 'keyword', + }, + 'structural-keyword': { + pattern: /\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i, + alias: 'keyword', + }, + + 'compile-target': { + pattern: /\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i, + alias: 'property', + }, + + // U+####, x###, d### characters and numbers + number: /\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i, + operator: /[+>\\$]|\.\./, + punctuation: /[()=,]/, +}; diff --git a/public/prism/prism-keyman.min.js b/public/prism/prism-keyman.min.js new file mode 100644 index 0000000..6023bbf --- /dev/null +++ b/public/prism/prism-keyman.min.js @@ -0,0 +1,32 @@ +Prism.languages.keyman = { + comment: { pattern: /\bc .*/i, greedy: !0 }, + string: { pattern: /"[^"\r\n]*"|'[^'\r\n]*'/, greedy: !0 }, + 'virtual-key': { + pattern: + /\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i, + greedy: !0, + alias: 'function', + }, + 'header-keyword': { pattern: /&\w+/, alias: 'bold' }, + 'header-statement': { + pattern: + /\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i, + alias: 'bold', + }, + 'rule-keyword': { + pattern: + /\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i, + alias: 'keyword', + }, + 'structural-keyword': { + pattern: /\b(?:ansi|begin|group|match|nomatch|unicode|using keys)\b/i, + alias: 'keyword', + }, + 'compile-target': { + pattern: /\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i, + alias: 'property', + }, + number: /\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i, + operator: /[+>\\$]|\.\./, + punctuation: /[()=,]/, +}; diff --git a/public/prism/prism-kotlin.js b/public/prism/prism-kotlin.js new file mode 100644 index 0000000..b865bb4 --- /dev/null +++ b/public/prism/prism-kotlin.js @@ -0,0 +1,91 @@ +(function (Prism) { + Prism.languages.kotlin = Prism.languages.extend('clike', { + keyword: { + // The lookbehind prevents wrong highlighting of e.g. kotlin.properties.get + pattern: + /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/, + lookbehind: true, + }, + function: [ + { + pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/, + greedy: true, + }, + { + pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/, + lookbehind: true, + greedy: true, + }, + ], + number: + /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/, + operator: + /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/, + }); + + delete Prism.languages.kotlin['class-name']; + + var interpolationInside = { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + expression: { + pattern: /[\s\S]+/, + inside: Prism.languages.kotlin, + }, + }; + + Prism.languages.insertBefore('kotlin', 'string', { + // https://kotlinlang.org/spec/expressions.html#string-interpolation-expressions + 'string-literal': [ + { + pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/, + alias: 'multiline', + inside: { + interpolation: { + pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i, + inside: interpolationInside, + }, + string: /[\s\S]+/, + }, + }, + { + pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/, + alias: 'singleline', + inside: { + interpolation: { + pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i, + lookbehind: true, + inside: interpolationInside, + }, + string: /[\s\S]+/, + }, + }, + ], + char: { + // https://kotlinlang.org/spec/expressions.html#character-literals + pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/, + greedy: true, + }, + }); + + delete Prism.languages.kotlin['string']; + + Prism.languages.insertBefore('kotlin', 'keyword', { + annotation: { + pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/, + alias: 'builtin', + }, + }); + + Prism.languages.insertBefore('kotlin', 'function', { + label: { + pattern: /\b\w+@|@\w+\b/, + alias: 'symbol', + }, + }); + + Prism.languages.kt = Prism.languages.kotlin; + Prism.languages.kts = Prism.languages.kotlin; +})(Prism); diff --git a/public/prism/prism-kotlin.min.js b/public/prism/prism-kotlin.min.js new file mode 100644 index 0000000..1ef2767 --- /dev/null +++ b/public/prism/prism-kotlin.min.js @@ -0,0 +1,66 @@ +!(function (n) { + (n.languages.kotlin = n.languages.extend('clike', { + keyword: { + pattern: + /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/, + lookbehind: !0, + }, + function: [ + { pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/, greedy: !0 }, + { + pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/, + lookbehind: !0, + greedy: !0, + }, + ], + number: + /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/, + operator: + /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/, + })), + delete n.languages.kotlin['class-name']; + var e = { + 'interpolation-punctuation': { + pattern: /^\$\{?|\}$/, + alias: 'punctuation', + }, + expression: { pattern: /[\s\S]+/, inside: n.languages.kotlin }, + }; + n.languages.insertBefore('kotlin', 'string', { + 'string-literal': [ + { + pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/, + alias: 'multiline', + inside: { + interpolation: { pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i, inside: e }, + string: /[\s\S]+/, + }, + }, + { + pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/, + alias: 'singleline', + inside: { + interpolation: { + pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i, + lookbehind: !0, + inside: e, + }, + string: /[\s\S]+/, + }, + }, + ], + char: { pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/, greedy: !0 }, + }), + delete n.languages.kotlin.string, + n.languages.insertBefore('kotlin', 'keyword', { + annotation: { + pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/, + alias: 'builtin', + }, + }), + n.languages.insertBefore('kotlin', 'function', { + label: { pattern: /\b\w+@|@\w+\b/, alias: 'symbol' }, + }), + (n.languages.kt = n.languages.kotlin), + (n.languages.kts = n.languages.kotlin); +})(Prism); diff --git a/public/prism/prism-kumir.js b/public/prism/prism-kumir.js new file mode 100644 index 0000000..6705e38 --- /dev/null +++ b/public/prism/prism-kumir.js @@ -0,0 +1,119 @@ +/* eslint-disable regexp/no-dupe-characters-character-class */ +(function (Prism) { + /** + * Regular expression for characters that are not allowed in identifiers. + * + * @type {string} + */ + var nonId = /\s\x00-\x1f\x22-\x2f\x3a-\x3f\x5b-\x5e\x60\x7b-\x7e/.source; + + /** + * Surround a regular expression for IDs with patterns for non-ID sequences. + * + * @param {string} pattern A regular expression for identifiers. + * @param {string} [flags] The regular expression flags. + * @returns {RegExp} A wrapped regular expression for identifiers. + */ + function wrapId(pattern, flags) { + return RegExp(pattern.replace(//g, nonId), flags); + } + + Prism.languages.kumir = { + comment: { + pattern: /\|.*/, + }, + + prolog: { + pattern: /#.*/, + greedy: true, + }, + + string: { + pattern: /"[^\n\r"]*"|'[^\n\r']*'/, + greedy: true, + }, + + boolean: { + pattern: wrapId(/(^|[])(?:да|нет)(?=[]|$)/.source), + lookbehind: true, + }, + + 'operator-word': { + pattern: wrapId(/(^|[])(?:и|или|не)(?=[]|$)/.source), + lookbehind: true, + alias: 'keyword', + }, + + 'system-variable': { + pattern: wrapId(/(^|[])знач(?=[]|$)/.source), + lookbehind: true, + alias: 'keyword', + }, + + type: [ + { + pattern: wrapId( + /(^|[])(?:вещ|лит|лог|сим|цел)(?:\x20*таб)?(?=[]|$)/ + .source + ), + lookbehind: true, + alias: 'builtin', + }, + { + pattern: wrapId( + /(^|[])(?:компл|сканкод|файл|цвет)(?=[]|$)/.source + ), + lookbehind: true, + alias: 'important', + }, + ], + + /** + * Should be performed after searching for type names because of "таб". + * "таб" is a reserved word, but never used without a preceding type name. + * "НАЗНАЧИТЬ", "Фввод", and "Фвывод" are not reserved words. + */ + keyword: { + pattern: wrapId( + /(^|[])(?:алг|арг(?:\x20*рез)?|ввод|ВКЛЮЧИТЬ|вс[её]|выбор|вывод|выход|дано|для|до|дс|если|иначе|исп|использовать|кон(?:(?:\x20+|_)исп)?|кц(?:(?:\x20+|_)при)?|надо|нач|нс|нц|от|пауза|пока|при|раза?|рез|стоп|таб|то|утв|шаг)(?=[]|$)/ + .source + ), + lookbehind: true, + }, + + /** Should be performed after searching for reserved words. */ + name: { + // eslint-disable-next-line regexp/no-super-linear-backtracking + pattern: wrapId( + /(^|[])[^\d][^]*(?:\x20+[^]+)*(?=[]|$)/ + .source + ), + lookbehind: true, + }, + + /** Should be performed after searching for names. */ + number: { + pattern: wrapId( + /(^|[])(?:\B\$[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?=[]|$)/ + .source, + 'i' + ), + lookbehind: true, + }, + + /** Should be performed after searching for words. */ + punctuation: /:=|[(),:;\[\]]/, + + /** + * Should be performed after searching for + * - numeric constants (because of "+" and "-"); + * - punctuation marks (because of ":=" and "="). + */ + 'operator-char': { + pattern: /\*\*?|<[=>]?|>=?|[-+/=]/, + alias: 'operator', + }, + }; + + Prism.languages.kum = Prism.languages.kumir; +})(Prism); diff --git a/public/prism/prism-kumir.min.js b/public/prism/prism-kumir.min.js new file mode 100644 index 0000000..d1e5c4d --- /dev/null +++ b/public/prism/prism-kumir.min.js @@ -0,0 +1,66 @@ +!(function (n) { + function o(n, o) { + return RegExp( + n.replace( + //g, + '\\s\\x00-\\x1f\\x22-\\x2f\\x3a-\\x3f\\x5b-\\x5e\\x60\\x7b-\\x7e' + ), + o + ); + } + (n.languages.kumir = { + comment: { pattern: /\|.*/ }, + prolog: { pattern: /#.*/, greedy: !0 }, + string: { pattern: /"[^\n\r"]*"|'[^\n\r']*'/, greedy: !0 }, + boolean: { + pattern: o('(^|[])(?:да|нет)(?=[]|$)'), + lookbehind: !0, + }, + 'operator-word': { + pattern: o('(^|[])(?:и|или|не)(?=[]|$)'), + lookbehind: !0, + alias: 'keyword', + }, + 'system-variable': { + pattern: o('(^|[])знач(?=[]|$)'), + lookbehind: !0, + alias: 'keyword', + }, + type: [ + { + pattern: o( + '(^|[])(?:вещ|лит|лог|сим|цел)(?:\\x20*таб)?(?=[]|$)' + ), + lookbehind: !0, + alias: 'builtin', + }, + { + pattern: o('(^|[])(?:компл|сканкод|файл|цвет)(?=[]|$)'), + lookbehind: !0, + alias: 'important', + }, + ], + keyword: { + pattern: o( + '(^|[])(?:алг|арг(?:\\x20*рез)?|ввод|ВКЛЮЧИТЬ|вс[её]|выбор|вывод|выход|дано|для|до|дс|если|иначе|исп|использовать|кон(?:(?:\\x20+|_)исп)?|кц(?:(?:\\x20+|_)при)?|надо|нач|нс|нц|от|пауза|пока|при|раза?|рез|стоп|таб|то|утв|шаг)(?=[]|$)' + ), + lookbehind: !0, + }, + name: { + pattern: o( + '(^|[])[^\\d][^]*(?:\\x20+[^]+)*(?=[]|$)' + ), + lookbehind: !0, + }, + number: { + pattern: o( + '(^|[])(?:\\B\\$[\\da-f]+\\b|(?:\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+)(?:e[+-]?\\d+)?)(?=[]|$)', + 'i' + ), + lookbehind: !0, + }, + punctuation: /:=|[(),:;\[\]]/, + 'operator-char': { pattern: /\*\*?|<[=>]?|>=?|[-+/=]/, alias: 'operator' }, + }), + (n.languages.kum = n.languages.kumir); +})(Prism); diff --git a/public/prism/prism-kusto.js b/public/prism/prism-kusto.js new file mode 100644 index 0000000..f1c86a2 --- /dev/null +++ b/public/prism/prism-kusto.js @@ -0,0 +1,50 @@ +Prism.languages.kusto = { + comment: { + pattern: /\/\/.*/, + greedy: true, + }, + string: { + pattern: + /```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/, + greedy: true, + }, + + verb: { + pattern: /(\|\s*)[a-z][\w-]*/i, + lookbehind: true, + alias: 'keyword', + }, + + command: { + pattern: /\.[a-z][a-z\d-]*\b/, + alias: 'keyword', + }, + + 'class-name': + /\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/, + keyword: + /\b(?:access|alias|and|anti|as|asc|auto|between|by|(?:contains|(?:ends|starts)with|has(?:perfix|suffix)?)(?:_cs)?|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/, + boolean: /\b(?:false|null|true)\b/, + + function: /\b[a-z_]\w*(?=\s*\()/, + + datetime: [ + { + // RFC 822 + RFC 850 + pattern: + /\b(?:(?:Fri|Friday|Mon|Monday|Sat|Saturday|Sun|Sunday|Thu|Thursday|Tue|Tuesday|Wed|Wednesday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:[A-Z]|(?:[ECMT][DS]|GM|U)T)|[+-]\d{4}))?\b/, + alias: 'number', + }, + { + // ISO 8601 + pattern: + /[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/, + alias: 'number', + }, + ], + number: + /\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|[dhms]|microsecond|tick)\b)?|[+-]?\binf\b/, + + operator: /=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./, + punctuation: /[()\[\]{},;.:]/, +}; diff --git a/public/prism/prism-kusto.min.js b/public/prism/prism-kusto.min.js new file mode 100644 index 0000000..fdbdeae --- /dev/null +++ b/public/prism/prism-kusto.min.js @@ -0,0 +1,32 @@ +Prism.languages.kusto = { + comment: { pattern: /\/\/.*/, greedy: !0 }, + string: { + pattern: + /```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/, + greedy: !0, + }, + verb: { pattern: /(\|\s*)[a-z][\w-]*/i, lookbehind: !0, alias: 'keyword' }, + command: { pattern: /\.[a-z][a-z\d-]*\b/, alias: 'keyword' }, + 'class-name': + /\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/, + keyword: + /\b(?:access|alias|and|anti|as|asc|auto|between|by|(?:contains|(?:ends|starts)with|has(?:perfix|suffix)?)(?:_cs)?|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/, + boolean: /\b(?:false|null|true)\b/, + function: /\b[a-z_]\w*(?=\s*\()/, + datetime: [ + { + pattern: + /\b(?:(?:Fri|Friday|Mon|Monday|Sat|Saturday|Sun|Sunday|Thu|Thursday|Tue|Tuesday|Wed|Wednesday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:[A-Z]|(?:[ECMT][DS]|GM|U)T)|[+-]\d{4}))?\b/, + alias: 'number', + }, + { + pattern: + /[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/, + alias: 'number', + }, + ], + number: + /\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|[dhms]|microsecond|tick)\b)?|[+-]?\binf\b/, + operator: /=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./, + punctuation: /[()\[\]{},;.:]/, +}; diff --git a/public/prism/prism-latex.js b/public/prism/prism-latex.js new file mode 100644 index 0000000..35aefec --- /dev/null +++ b/public/prism/prism-latex.js @@ -0,0 +1,69 @@ +(function (Prism) { + var funcPattern = /\\(?:[^a-z()[\]]|[a-z*]+)/i; + var insideEqu = { + 'equation-command': { + pattern: funcPattern, + alias: 'regex', + }, + }; + + Prism.languages.latex = { + comment: /%.*/, + // the verbatim environment prints whitespace to the document + cdata: { + pattern: + /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/, + lookbehind: true, + }, + /* + * equations can be between $$ $$ or $ $ or \( \) or \[ \] + * (all are multiline) + */ + equation: [ + { + pattern: + /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/, + inside: insideEqu, + alias: 'string', + }, + { + pattern: + /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/, + lookbehind: true, + inside: insideEqu, + alias: 'string', + }, + ], + /* + * arguments which are keywords or references are highlighted + * as keywords + */ + keyword: { + pattern: + /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/, + lookbehind: true, + }, + url: { + pattern: /(\\url\{)[^}]+(?=\})/, + lookbehind: true, + }, + /* + * section or chapter headlines are highlighted as bold so that + * they stand out more + */ + headline: { + pattern: + /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/, + lookbehind: true, + alias: 'class-name', + }, + function: { + pattern: funcPattern, + alias: 'selector', + }, + punctuation: /[[\]{}&]/, + }; + + Prism.languages.tex = Prism.languages.latex; + Prism.languages.context = Prism.languages.latex; +})(Prism); diff --git a/public/prism/prism-latex.min.js b/public/prism/prism-latex.min.js new file mode 100644 index 0000000..3ae0a7a --- /dev/null +++ b/public/prism/prism-latex.min.js @@ -0,0 +1,43 @@ +!(function (a) { + var e = /\\(?:[^a-z()[\]]|[a-z*]+)/i, + n = { 'equation-command': { pattern: e, alias: 'regex' } }; + (a.languages.latex = { + comment: /%.*/, + cdata: { + pattern: + /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/, + lookbehind: !0, + }, + equation: [ + { + pattern: + /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/, + inside: n, + alias: 'string', + }, + { + pattern: + /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/, + lookbehind: !0, + inside: n, + alias: 'string', + }, + ], + keyword: { + pattern: + /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/, + lookbehind: !0, + }, + url: { pattern: /(\\url\{)[^}]+(?=\})/, lookbehind: !0 }, + headline: { + pattern: + /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/, + lookbehind: !0, + alias: 'class-name', + }, + function: { pattern: e, alias: 'selector' }, + punctuation: /[[\]{}&]/, + }), + (a.languages.tex = a.languages.latex), + (a.languages.context = a.languages.latex); +})(Prism); diff --git a/public/prism/prism-latte.js b/public/prism/prism-latte.js new file mode 100644 index 0000000..dbf91bb --- /dev/null +++ b/public/prism/prism-latte.js @@ -0,0 +1,72 @@ +(function (Prism) { + Prism.languages.latte = { + comment: /^\{\*[\s\S]*/, + 'latte-tag': { + // https://latte.nette.org/en/tags + pattern: /(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i, + lookbehind: true, + alias: 'important', + }, + delimiter: { + pattern: /^\{\/?|\}$/, + alias: '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|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/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); diff --git a/public/prism/prism-latte.min.js b/public/prism/prism-latte.min.js new file mode 100644 index 0000000..2d5a735 --- /dev/null +++ b/public/prism/prism-latte.min.js @@ -0,0 +1,53 @@ +!(function (t) { + t.languages.latte = { + comment: /^\{\*[\s\S]*/, + 'latte-tag': { + pattern: /(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i, + lookbehind: !0, + alias: 'important', + }, + delimiter: { pattern: /^\{\/?|\}$/, alias: 'punctuation' }, + php: { + pattern: /\S(?:[\s\S]*\S)?/, + alias: 'language-php', + inside: t.languages.php, + }, + }; + var e = t.languages.extend('markup', {}); + t.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: !0 }, + ], + php: { pattern: /\S(?:[\s\S]*\S)?/, inside: t.languages.php }, + }, + }, + }, + }, + }, + e.tag + ), + t.hooks.add('before-tokenize', function (a) { + if ('latte' === a.language) { + t.languages['markup-templating'].buildPlaceholders( + a, + 'latte', + /\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g + ), + (a.grammar = e); + } + }), + t.hooks.add('after-tokenize', function (a) { + t.languages['markup-templating'].tokenizePlaceholders(a, 'latte'); + }); +})(Prism); diff --git a/public/prism/prism-less.js b/public/prism/prism-less.js new file mode 100644 index 0000000..e4703a3 --- /dev/null +++ b/public/prism/prism-less.js @@ -0,0 +1,56 @@ +/* FIXME : + :extend() is not handled specifically : its highlighting is buggy. + Mixin usage must be inside a ruleset to be highlighted. + At-rules (e.g. import) containing interpolations are buggy. + Detached rulesets are highlighted as at-rules. + A comment before a mixin usage prevents the latter to be properly highlighted. + */ + +Prism.languages.less = Prism.languages.extend('css', { + comment: [ + /\/\*[\s\S]*?\*\//, + { + pattern: /(^|[^\\])\/\/.*/, + lookbehind: true, + }, + ], + atrule: { + pattern: + /@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/, + inside: { + punctuation: /[:()]/, + }, + }, + // selectors and mixins are considered the same + selector: { + pattern: + /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/, + inside: { + // mixin parameters + variable: /@+[\w-]+/, + }, + }, + + property: /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/, + operator: /[+\-*\/]/, +}); + +Prism.languages.insertBefore('less', 'property', { + variable: [ + // Variable declaration (the colon must be consumed!) + { + pattern: /@[\w-]+\s*:/, + inside: { + punctuation: /:/, + }, + }, + + // Variable usage + /@@?[\w-]+/, + ], + 'mixin-usage': { + pattern: /([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/, + lookbehind: true, + alias: 'function', + }, +}); diff --git a/public/prism/prism-less.min.js b/public/prism/prism-less.min.js new file mode 100644 index 0000000..4cb5fcf --- /dev/null +++ b/public/prism/prism-less.min.js @@ -0,0 +1,26 @@ +(Prism.languages.less = Prism.languages.extend('css', { + comment: [/\/\*[\s\S]*?\*\//, { pattern: /(^|[^\\])\/\/.*/, lookbehind: !0 }], + atrule: { + pattern: + /@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/, + inside: { punctuation: /[:()]/ }, + }, + selector: { + pattern: + /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/, + inside: { variable: /@+[\w-]+/ }, + }, + property: /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/, + operator: /[+\-*\/]/, +})), + Prism.languages.insertBefore('less', 'property', { + variable: [ + { pattern: /@[\w-]+\s*:/, inside: { punctuation: /:/ } }, + /@@?[\w-]+/, + ], + 'mixin-usage': { + pattern: /([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/, + lookbehind: !0, + alias: 'function', + }, + }); diff --git a/public/prism/prism-lilypond.js b/public/prism/prism-lilypond.js new file mode 100644 index 0000000..a9ceb1e --- /dev/null +++ b/public/prism/prism-lilypond.js @@ -0,0 +1,81 @@ +(function (Prism) { + var schemeExpression = + /\((?:[^();"#\\]|\\[\s\S]|;.*(?!.)|"(?:[^"\\]|\\.)*"|#(?:\{(?:(?!#\})[\s\S])*#\}|[^{])|)*\)/ + .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(//g, function () { + return schemeExpression; + }); + } + schemeExpression = schemeExpression.replace(//g, /[^\s\S]/.source); + + var lilypond = (Prism.languages.lilypond = { + comment: /%(?:(?!\{).*|\{[\s\S]*?%\})/, + 'embedded-scheme': { + pattern: RegExp( + /(^|[=\s])#(?:"(?:[^"\\]|\\.)*"|[^\s()"]*(?:[^\s()]|))/.source.replace( + //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); diff --git a/public/prism/prism-lilypond.min.js b/public/prism/prism-lilypond.min.js new file mode 100644 index 0000000..5b205e3 --- /dev/null +++ b/public/prism/prism-lilypond.min.js @@ -0,0 +1,66 @@ +!(function (e) { + for ( + var n = + '\\((?:[^();"#\\\\]|\\\\[^]|;.*(?!.)|"(?:[^"\\\\]|\\\\.)*"|#(?:\\{(?:(?!#\\})[^])*#\\}|[^{])|)*\\)', + i = 0; + i < 5; + i++ + ) + n = n.replace(//g, function () { + return n; + }); + n = n.replace(//g, '[^\\s\\S]'); + var d = (e.languages.lilypond = { + comment: /%(?:(?!\{).*|\{[\s\S]*?%\})/, + 'embedded-scheme': { + pattern: RegExp( + '(^|[=\\s])#(?:"(?:[^"\\\\]|\\\\.)*"|[^\\s()"]*(?:[^\\s()]|))'.replace( + //g, + function () { + return n; + } + ), + 'm' + ), + lookbehind: !0, + greedy: !0, + inside: { + scheme: { + pattern: /^(#)[\s\S]+$/, + lookbehind: !0, + alias: 'language-scheme', + inside: { + 'embedded-lilypond': { + pattern: /#\{[\s\S]*?#\}/, + greedy: !0, + inside: { + punctuation: /^#\{|#\}$/, + lilypond: { + pattern: /[\s\S]+/, + alias: 'language-lilypond', + inside: null, + }, + }, + }, + rest: e.languages.scheme, + }, + }, + punctuation: /#/, + }, + }, + string: { pattern: /"(?:[^"\\]|\\.)*"/, greedy: !0 }, + 'class-name': { pattern: /(\\new\s+)[\w-]+/, lookbehind: !0 }, + keyword: { pattern: /\\[a-z][-\w]*/i, inside: { punctuation: /^\\/ } }, + operator: /[=|]|<<|>>/, + punctuation: { + pattern: + /(^|[a-z\d])(?:'+|,+|[_^]?-[_^]?(?:[-+^!>._]|(?=\d))|[_^]\.?|[.!])|[{}()[\]<>^~]|\\[()[\]<>\\!]|--|__/, + lookbehind: !0, + }, + number: /\b\d+(?:\/\d+)?\b/, + }); + (d['embedded-scheme'].inside.scheme.inside[ + 'embedded-lilypond' + ].inside.lilypond.inside = d), + (e.languages.ly = d); +})(Prism); diff --git a/public/prism/prism-liquid.js b/public/prism/prism-liquid.js new file mode 100644 index 0000000..7e9d029 --- /dev/null +++ b/public/prism/prism-liquid.js @@ -0,0 +1,74 @@ +Prism.languages.liquid = { + comment: { + pattern: /(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/, + lookbehind: true, + }, + delimiter: { + pattern: /^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/, + alias: 'punctuation', + }, + string: { + pattern: /"[^"]*"|'[^']*'/, + greedy: true, + }, + keyword: + /\b(?:as|assign|break|(?:end)?(?:capture|case|comment|for|form|if|paginate|raw|style|tablerow|unless)|continue|cycle|decrement|echo|else|elsif|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/, + object: + /\b(?:address|all_country_option_tags|article|block|blog|cart|checkout|collection|color|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|fulfillment|generic_file|gift_card|group|handle|image|line_item|link|linklist|localization|location|measurement|media|metafield|model|model_source|order|page|page_description|page_image|page_title|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/, + function: [ + { + pattern: /(\|\s*)\w+/, + lookbehind: true, + alias: 'filter', + }, + { + // array functions + pattern: /(\.\s*)(?:first|last|size)/, + lookbehind: true, + }, + ], + boolean: /\b(?:false|nil|true)\b/, + range: { + pattern: /\.\./, + alias: 'operator', + }, + // https://github.com/Shopify/liquid/blob/698f5e0d967423e013f6169d9111bd969bd78337/lib/liquid/lexer.rb#L21 + number: /\b\d+(?:\.\d+)?\b/, + operator: /[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|contains(?=\s)|or)\b/, + punctuation: /[.,\[\]()]/, + empty: { + pattern: /\bempty\b/, + alias: 'keyword', + }, +}; + +Prism.hooks.add('before-tokenize', function (env) { + var liquidPattern = + /\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g; + var insideRaw = false; + + Prism.languages['markup-templating'].buildPlaceholders( + env, + 'liquid', + liquidPattern, + function (match) { + var tagMatch = /^\{%-?\s*(\w+)/.exec(match); + if (tagMatch) { + var tag = tagMatch[1]; + if (tag === 'raw' && !insideRaw) { + insideRaw = true; + return true; + } else if (tag === 'endraw') { + insideRaw = false; + return true; + } + } + + return !insideRaw; + } + ); +}); + +Prism.hooks.add('after-tokenize', function (env) { + Prism.languages['markup-templating'].tokenizePlaceholders(env, 'liquid'); +}); diff --git a/public/prism/prism-liquid.min.js b/public/prism/prism-liquid.min.js new file mode 100644 index 0000000..d4089c2 --- /dev/null +++ b/public/prism/prism-liquid.min.js @@ -0,0 +1,45 @@ +(Prism.languages.liquid = { + comment: { + pattern: /(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/, + lookbehind: !0, + }, + delimiter: { + pattern: /^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/, + alias: 'punctuation', + }, + string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, + keyword: + /\b(?:as|assign|break|(?:end)?(?:capture|case|comment|for|form|if|paginate|raw|style|tablerow|unless)|continue|cycle|decrement|echo|else|elsif|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/, + object: + /\b(?:address|all_country_option_tags|article|block|blog|cart|checkout|collection|color|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|fulfillment|generic_file|gift_card|group|handle|image|line_item|link|linklist|localization|location|measurement|media|metafield|model|model_source|order|page|page_description|page_image|page_title|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/, + function: [ + { pattern: /(\|\s*)\w+/, lookbehind: !0, alias: 'filter' }, + { pattern: /(\.\s*)(?:first|last|size)/, lookbehind: !0 }, + ], + boolean: /\b(?:false|nil|true)\b/, + range: { pattern: /\.\./, alias: 'operator' }, + number: /\b\d+(?:\.\d+)?\b/, + operator: /[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|contains(?=\s)|or)\b/, + punctuation: /[.,\[\]()]/, + empty: { pattern: /\bempty\b/, alias: 'keyword' }, +}), + Prism.hooks.add('before-tokenize', function (e) { + var i = !1; + Prism.languages['markup-templating'].buildPlaceholders( + e, + 'liquid', + /\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g, + function (e) { + var t = /^\{%-?\s*(\w+)/.exec(e); + if (t) { + var n = t[1]; + if ('raw' === n && !i) return (i = !0); + if ('endraw' === n) return !(i = !1); + } + return !i; + } + ); + }), + Prism.hooks.add('after-tokenize', function (e) { + Prism.languages['markup-templating'].tokenizePlaceholders(e, 'liquid'); + }); diff --git a/public/prism/prism-lisp.js b/public/prism/prism-lisp.js new file mode 100644 index 0000000..8febdfd --- /dev/null +++ b/public/prism/prism-lisp.js @@ -0,0 +1,217 @@ +(function (Prism) { + /** + * Functions to construct regular expressions + * e.g. (interactive ... or (interactive) + * + * @param {string} name + * @returns {RegExp} + */ + function simple_form(name) { + return RegExp(/(\()/.source + '(?:' + name + ')' + /(?=[\s\)])/.source); + } + /** + * booleans and numbers + * + * @param {string} pattern + * @returns {RegExp} + */ + function primitive(pattern) { + return RegExp( + /([\s([])/.source + '(?:' + pattern + ')' + /(?=[\s)])/.source + ); + } + + // Patterns in regular expressions + + // Symbol name. See https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html + // & and : are excluded as they are usually used for special purposes + var symbol = /(?!\d)[-+*/~!@$%^=<>{}\w]+/.source; + // symbol starting with & used in function arguments + var marker = '&' + symbol; + // Open parenthesis for look-behind + var par = '(\\()'; + var endpar = '(?=\\))'; + // End the pattern with look-ahead space + var space = '(?=\\s)'; + var nestedPar = + /(?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\))*\))*\))*/ + .source; + + var language = { + // Three or four semicolons are considered a heading. + // See https://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html + heading: { + pattern: /;;;.*/, + alias: ['comment', 'title'], + }, + comment: /;.*/, + string: { + pattern: /"(?:[^"\\]|\\.)*"/, + greedy: true, + inside: { + argument: /[-A-Z]+(?=[.,\s])/, + symbol: RegExp('`' + symbol + "'"), + }, + }, + 'quoted-symbol': { + pattern: RegExp("#?'" + symbol), + alias: ['variable', 'symbol'], + }, + 'lisp-property': { + pattern: RegExp(':' + symbol), + alias: 'property', + }, + splice: { + pattern: RegExp(',@?' + symbol), + alias: ['symbol', 'variable'], + }, + keyword: [ + { + pattern: RegExp( + par + + '(?:and|(?:cl-)?letf|cl-loop|cond|cons|error|if|(?:lexical-)?let\\*?|message|not|null|or|provide|require|setq|unless|use-package|when|while)' + + space + ), + lookbehind: true, + }, + { + pattern: RegExp( + par + '(?:append|by|collect|concat|do|finally|for|in|return)' + space + ), + lookbehind: true, + }, + ], + declare: { + pattern: simple_form(/declare/.source), + lookbehind: true, + alias: 'keyword', + }, + interactive: { + pattern: simple_form(/interactive/.source), + lookbehind: true, + alias: 'keyword', + }, + boolean: { + pattern: primitive(/nil|t/.source), + lookbehind: true, + }, + number: { + pattern: primitive(/[-+]?\d+(?:\.\d*)?/.source), + lookbehind: true, + }, + defvar: { + pattern: RegExp(par + 'def(?:const|custom|group|var)\\s+' + symbol), + lookbehind: true, + inside: { + keyword: /^def[a-z]+/, + variable: RegExp(symbol), + }, + }, + defun: { + pattern: RegExp( + par + + /(?:cl-)?(?:defmacro|defun\*?)\s+/.source + + symbol + + /\s+\(/.source + + nestedPar + + /\)/.source + ), + lookbehind: true, + greedy: true, + inside: { + keyword: /^(?:cl-)?def\S+/, + // See below, this property needs to be defined later so that it can + // reference the language object. + arguments: null, + function: { + pattern: RegExp('(^\\s)' + symbol), + lookbehind: true, + }, + punctuation: /[()]/, + }, + }, + lambda: { + pattern: RegExp( + par + + 'lambda\\s+\\(\\s*(?:&?' + + symbol + + '(?:\\s+&?' + + symbol + + ')*\\s*)?\\)' + ), + lookbehind: true, + greedy: true, + inside: { + keyword: /^lambda/, + // See below, this property needs to be defined later so that it can + // reference the language object. + arguments: null, + punctuation: /[()]/, + }, + }, + car: { + pattern: RegExp(par + symbol), + lookbehind: true, + }, + punctuation: [ + // open paren, brackets, and close paren + /(?:['`,]?\(|[)\[\]])/, + // cons + { + pattern: /(\s)\.(?=\s)/, + lookbehind: true, + }, + ], + }; + + var arg = { + 'lisp-marker': RegExp(marker), + varform: { + pattern: RegExp( + /\(/.source + symbol + /\s+(?=\S)/.source + nestedPar + /\)/.source + ), + inside: language, + }, + argument: { + pattern: RegExp(/(^|[\s(])/.source + symbol), + lookbehind: true, + alias: 'variable', + }, + rest: language, + }; + + var forms = '\\S+(?:\\s+\\S+)*'; + + var arglist = { + pattern: RegExp(par + nestedPar + endpar), + lookbehind: true, + inside: { + 'rest-vars': { + pattern: RegExp('&(?:body|rest)\\s+' + forms), + inside: arg, + }, + 'other-marker-vars': { + pattern: RegExp('&(?:aux|optional)\\s+' + forms), + inside: arg, + }, + keys: { + pattern: RegExp('&key\\s+' + forms + '(?:\\s+&allow-other-keys)?'), + inside: arg, + }, + argument: { + pattern: RegExp(symbol), + alias: 'variable', + }, + punctuation: /[()]/, + }, + }; + + language['lambda'].inside.arguments = arglist; + language['defun'].inside.arguments = Prism.util.clone(arglist); + language['defun'].inside.arguments.inside.sublist = arglist; + + Prism.languages.lisp = language; + Prism.languages.elisp = language; + Prism.languages.emacs = language; + Prism.languages['emacs-lisp'] = language; +})(Prism); diff --git a/public/prism/prism-lisp.min.js b/public/prism/prism-lisp.min.js new file mode 100644 index 0000000..d9b5041 --- /dev/null +++ b/public/prism/prism-lisp.min.js @@ -0,0 +1,124 @@ +!(function (e) { + function n(e) { + return RegExp('(\\()(?:' + e + ')(?=[\\s\\)])'); + } + function a(e) { + return RegExp('([\\s([])(?:' + e + ')(?=[\\s)])'); + } + var t = '(?!\\d)[-+*/~!@$%^=<>{}\\w]+', + r = '(\\()', + i = '(?=\\s)', + s = + '(?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\))*\\))*\\))*', + l = { + heading: { pattern: /;;;.*/, alias: ['comment', 'title'] }, + comment: /;.*/, + string: { + pattern: /"(?:[^"\\]|\\.)*"/, + greedy: !0, + inside: { + argument: /[-A-Z]+(?=[.,\s])/, + symbol: RegExp('`' + t + "'"), + }, + }, + 'quoted-symbol': { + pattern: RegExp("#?'" + t), + alias: ['variable', 'symbol'], + }, + 'lisp-property': { pattern: RegExp(':' + t), alias: 'property' }, + splice: { pattern: RegExp(',@?' + t), alias: ['symbol', 'variable'] }, + keyword: [ + { + pattern: RegExp( + r + + '(?:and|(?:cl-)?letf|cl-loop|cond|cons|error|if|(?:lexical-)?let\\*?|message|not|null|or|provide|require|setq|unless|use-package|when|while)' + + i + ), + lookbehind: !0, + }, + { + pattern: RegExp( + r + '(?:append|by|collect|concat|do|finally|for|in|return)' + i + ), + lookbehind: !0, + }, + ], + declare: { pattern: n('declare'), lookbehind: !0, alias: 'keyword' }, + interactive: { + pattern: n('interactive'), + lookbehind: !0, + alias: 'keyword', + }, + boolean: { pattern: a('nil|t'), lookbehind: !0 }, + number: { pattern: a('[-+]?\\d+(?:\\.\\d*)?'), lookbehind: !0 }, + defvar: { + pattern: RegExp(r + 'def(?:const|custom|group|var)\\s+' + t), + lookbehind: !0, + inside: { keyword: /^def[a-z]+/, variable: RegExp(t) }, + }, + defun: { + pattern: RegExp( + r + '(?:cl-)?(?:defmacro|defun\\*?)\\s+' + t + '\\s+\\(' + s + '\\)' + ), + lookbehind: !0, + greedy: !0, + inside: { + keyword: /^(?:cl-)?def\S+/, + arguments: null, + function: { pattern: RegExp('(^\\s)' + t), lookbehind: !0 }, + punctuation: /[()]/, + }, + }, + lambda: { + pattern: RegExp( + r + 'lambda\\s+\\(\\s*(?:&?' + t + '(?:\\s+&?' + t + ')*\\s*)?\\)' + ), + lookbehind: !0, + greedy: !0, + inside: { keyword: /^lambda/, arguments: null, punctuation: /[()]/ }, + }, + car: { pattern: RegExp(r + t), lookbehind: !0 }, + punctuation: [ + /(?:['`,]?\(|[)\[\]])/, + { pattern: /(\s)\.(?=\s)/, lookbehind: !0 }, + ], + }, + o = { + 'lisp-marker': RegExp('&(?!\\d)[-+*/~!@$%^=<>{}\\w]+'), + varform: { + pattern: RegExp('\\(' + t + '\\s+(?=\\S)' + s + '\\)'), + inside: l, + }, + argument: { + pattern: RegExp('(^|[\\s(])' + t), + lookbehind: !0, + alias: 'variable', + }, + rest: l, + }, + p = '\\S+(?:\\s+\\S+)*', + d = { + pattern: RegExp(r + s + '(?=\\))'), + lookbehind: !0, + inside: { + 'rest-vars': { pattern: RegExp('&(?:body|rest)\\s+' + p), inside: o }, + 'other-marker-vars': { + pattern: RegExp('&(?:aux|optional)\\s+' + p), + inside: o, + }, + keys: { + pattern: RegExp('&key\\s+' + p + '(?:\\s+&allow-other-keys)?'), + inside: o, + }, + argument: { pattern: RegExp(t), alias: 'variable' }, + punctuation: /[()]/, + }, + }; + (l.lambda.inside.arguments = d), + (l.defun.inside.arguments = e.util.clone(d)), + (l.defun.inside.arguments.inside.sublist = d), + (e.languages.lisp = l), + (e.languages.elisp = l), + (e.languages.emacs = l), + (e.languages['emacs-lisp'] = l); +})(Prism); diff --git a/public/prism/prism-livescript.js b/public/prism/prism-livescript.js new file mode 100644 index 0000000..682b506 --- /dev/null +++ b/public/prism/prism-livescript.js @@ -0,0 +1,123 @@ +Prism.languages.livescript = { + comment: [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, + lookbehind: true, + }, + { + pattern: /(^|[^\\])#.*/, + lookbehind: true, + }, + ], + 'interpolated-string': { + /* Look-behind and look-ahead prevents wrong behavior of the greedy pattern + * forcing it to match """-quoted string when it would otherwise match "-quoted first. */ + pattern: /(^|[^"])("""|")(?:\\[\s\S]|(?!\2)[^\\])*\2(?!")/, + lookbehind: true, + greedy: true, + inside: { + variable: { + pattern: /(^|[^\\])#[a-z_](?:-?[a-z]|[\d_])*/m, + lookbehind: true, + }, + interpolation: { + pattern: /(^|[^\\])#\{[^}]+\}/m, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^#\{|\}$/, + alias: 'variable', + }, + // See rest below + }, + }, + string: /[\s\S]+/, + }, + }, + string: [ + { + pattern: /('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/, + greedy: true, + }, + { + pattern: /<\[[\s\S]*?\]>/, + greedy: true, + }, + /\\[^\s,;\])}]+/, + ], + regex: [ + { + pattern: /\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/, + greedy: true, + inside: { + comment: { + pattern: /(^|[^\\])#.*/, + lookbehind: true, + }, + }, + }, + { + pattern: /\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/, + greedy: true, + }, + ], + keyword: { + pattern: + /(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m, + lookbehind: true, + }, + 'keyword-operator': { + pattern: + /(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?: not|nt)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m, + lookbehind: true, + alias: 'operator', + }, + boolean: { + pattern: /(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m, + lookbehind: true, + }, + argument: { + // Don't match .&. nor && + pattern: /(^|(?!\.&\.)[^&])&(?!&)\d*/m, + lookbehind: true, + alias: 'variable', + }, + number: /\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i, + identifier: /[a-z_](?:-?[a-z]|[\d_])*/i, + operator: [ + // Spaced . + { + pattern: /( )\.(?= )/, + lookbehind: true, + }, + // Full list, in order: + // .= .~ .. ... + // .&. .^. .<<. .>>. .>>>. + // := :: ::= + // && + // || |> + // < << <<< <<<< + // <- <-- <-! <--! + // <~ <~~ <~! <~~! + // <| <= >> >= >? + // - -- -> --> + // + ++ + // @ @@ + // % %% + // * ** + // ! != !~= + // !~> !~~> + // !-> !--> + // ~ ~> ~~> ~= + // = == + // ^ ^^ + // / ? + /\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/, + ], + punctuation: /[(){}\[\]|.,:;`]/, +}; + +Prism.languages.livescript['interpolated-string'].inside[ + 'interpolation' +].inside.rest = Prism.languages.livescript; diff --git a/public/prism/prism-livescript.min.js b/public/prism/prism-livescript.min.js new file mode 100644 index 0000000..45c3feb --- /dev/null +++ b/public/prism/prism-livescript.min.js @@ -0,0 +1,74 @@ +(Prism.languages.livescript = { + comment: [ + { pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, lookbehind: !0 }, + { pattern: /(^|[^\\])#.*/, lookbehind: !0 }, + ], + 'interpolated-string': { + pattern: /(^|[^"])("""|")(?:\\[\s\S]|(?!\2)[^\\])*\2(?!")/, + lookbehind: !0, + greedy: !0, + inside: { + variable: { + pattern: /(^|[^\\])#[a-z_](?:-?[a-z]|[\d_])*/m, + lookbehind: !0, + }, + interpolation: { + pattern: /(^|[^\\])#\{[^}]+\}/m, + lookbehind: !0, + inside: { + 'interpolation-punctuation': { + pattern: /^#\{|\}$/, + alias: 'variable', + }, + }, + }, + string: /[\s\S]+/, + }, + }, + string: [ + { pattern: /('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/, greedy: !0 }, + { pattern: /<\[[\s\S]*?\]>/, greedy: !0 }, + /\\[^\s,;\])}]+/, + ], + regex: [ + { + pattern: /\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/, + greedy: !0, + inside: { comment: { pattern: /(^|[^\\])#.*/, lookbehind: !0 } }, + }, + { + pattern: /\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/, + greedy: !0, + }, + ], + keyword: { + pattern: + /(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m, + lookbehind: !0, + }, + 'keyword-operator': { + pattern: + /(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?: not|nt)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m, + lookbehind: !0, + alias: 'operator', + }, + boolean: { + pattern: /(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m, + lookbehind: !0, + }, + argument: { + pattern: /(^|(?!\.&\.)[^&])&(?!&)\d*/m, + lookbehind: !0, + alias: 'variable', + }, + number: /\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i, + identifier: /[a-z_](?:-?[a-z]|[\d_])*/i, + operator: [ + { pattern: /( )\.(?= )/, lookbehind: !0 }, + /\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/, + ], + punctuation: /[(){}\[\]|.,:;`]/, +}), + (Prism.languages.livescript[ + 'interpolated-string' + ].inside.interpolation.inside.rest = Prism.languages.livescript); diff --git a/public/prism/prism-llvm.js b/public/prism/prism-llvm.js new file mode 100644 index 0000000..bec3d7c --- /dev/null +++ b/public/prism/prism-llvm.js @@ -0,0 +1,21 @@ +(function (Prism) { + Prism.languages.llvm = { + comment: /;.*/, + string: { + pattern: /"[^"]*"/, + greedy: true, + }, + boolean: /\b(?:false|true)\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); diff --git a/public/prism/prism-llvm.min.js b/public/prism/prism-llvm.min.js new file mode 100644 index 0000000..3f49697 --- /dev/null +++ b/public/prism/prism-llvm.min.js @@ -0,0 +1,16 @@ +Prism.languages.llvm = { + comment: /;.*/, + string: { pattern: /"[^"]*"/, greedy: !0 }, + boolean: /\b(?:false|true)\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: /[{}[\];(),.!*=<>]/, +}; diff --git a/public/prism/prism-log.js b/public/prism/prism-log.js new file mode 100644 index 0000000..a052ef2 --- /dev/null +++ b/public/prism/prism-log.js @@ -0,0 +1,130 @@ +// This is a language definition for generic log files. +// Since there is no one log format, this language definition has to support all formats to some degree. +// +// Based on https://github.com/MTDL9/vim-log-highlighting + +Prism.languages.log = { + string: { + // Single-quoted strings must not be confused with plain text. E.g. Can't isn't Susan's Chris' toy + pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/, + greedy: true, + }, + + exception: { + pattern: + /(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/, + lookbehind: true, + greedy: true, + alias: ['javastacktrace', 'language-javastacktrace'], + inside: Prism.languages['javastacktrace'] || { + keyword: /\bat\b/, + function: /[a-z_][\w$]*(?=\()/, + punctuation: /[.:()]/, + }, + }, + + level: [ + { + pattern: + /\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/, + alias: ['error', 'important'], + }, + { + pattern: /\b(?:WARN|WARNING|WRN)\b/, + alias: ['warning', 'important'], + }, + { + pattern: /\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/, + alias: ['info', 'keyword'], + }, + { + pattern: /\b(?:DBG|DEBUG|FINE)\b/, + alias: ['debug', 'keyword'], + }, + { + pattern: /\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/, + alias: ['trace', 'comment'], + }, + ], + + property: { + pattern: + /((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im, + lookbehind: true, + }, + + separator: { + pattern: /(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m, + lookbehind: true, + alias: 'comment', + }, + + url: /\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/, + email: { + pattern: /(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/, + lookbehind: true, + alias: 'url', + }, + + 'ip-address': { + pattern: /\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/, + alias: 'constant', + }, + 'mac-address': { + pattern: /\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i, + alias: 'constant', + }, + domain: { + pattern: + /(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/, + lookbehind: true, + alias: 'constant', + }, + + uuid: { + pattern: + /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i, + alias: 'constant', + }, + hash: { + pattern: /\b(?:[a-f0-9]{32}){1,2}\b/i, + alias: 'constant', + }, + + 'file-path': { + pattern: + /\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i, + lookbehind: true, + greedy: true, + alias: 'string', + }, + + date: { + pattern: RegExp( + /\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source + + '|' + + /\b\d{1,4}[-/ ](?:\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\d{2,4}T?\b/ + .source + + '|' + + /\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\s{1,2}\d{1,2}\b/ + .source, + 'i' + ), + alias: 'number', + }, + time: { + pattern: + /\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/, + alias: 'number', + }, + + boolean: /\b(?:false|null|true)\b/i, + number: { + pattern: + /(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i, + lookbehind: true, + }, + + operator: /[;:?<=>~/@!$%&+\-|^(){}*#]/, + punctuation: /[\[\].,]/, +}; diff --git a/public/prism/prism-log.min.js b/public/prism/prism-log.min.js new file mode 100644 index 0000000..01ba78e --- /dev/null +++ b/public/prism/prism-log.min.js @@ -0,0 +1,98 @@ +Prism.languages.log = { + string: { + pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/, + greedy: !0, + }, + exception: { + pattern: + /(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/, + lookbehind: !0, + greedy: !0, + alias: ['javastacktrace', 'language-javastacktrace'], + inside: Prism.languages.javastacktrace || { + keyword: /\bat\b/, + function: /[a-z_][\w$]*(?=\()/, + punctuation: /[.:()]/, + }, + }, + level: [ + { + pattern: + /\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/, + alias: ['error', 'important'], + }, + { pattern: /\b(?:WARN|WARNING|WRN)\b/, alias: ['warning', 'important'] }, + { + pattern: /\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/, + alias: ['info', 'keyword'], + }, + { pattern: /\b(?:DBG|DEBUG|FINE)\b/, alias: ['debug', 'keyword'] }, + { + pattern: /\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/, + alias: ['trace', 'comment'], + }, + ], + property: { + pattern: + /((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im, + lookbehind: !0, + }, + separator: { + pattern: /(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m, + lookbehind: !0, + alias: 'comment', + }, + url: /\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/, + email: { + pattern: /(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/, + lookbehind: !0, + alias: 'url', + }, + 'ip-address': { + pattern: /\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/, + alias: 'constant', + }, + 'mac-address': { + pattern: /\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i, + alias: 'constant', + }, + domain: { + pattern: + /(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/, + lookbehind: !0, + alias: 'constant', + }, + uuid: { + pattern: + /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i, + alias: 'constant', + }, + hash: { pattern: /\b(?:[a-f0-9]{32}){1,2}\b/i, alias: 'constant' }, + 'file-path': { + pattern: + /\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i, + lookbehind: !0, + greedy: !0, + alias: 'string', + }, + date: { + pattern: RegExp( + '\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b', + 'i' + ), + alias: 'number', + }, + time: { + pattern: + /\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/, + alias: 'number', + }, + boolean: /\b(?:false|null|true)\b/i, + number: { + pattern: + /(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i, + lookbehind: !0, + }, + operator: /[;:?<=>~/@!$%&+\-|^(){}*#]/, + punctuation: /[\[\].,]/, +}; diff --git a/public/prism/prism-lolcode.js b/public/prism/prism-lolcode.js new file mode 100644 index 0000000..d5da3c6 --- /dev/null +++ b/public/prism/prism-lolcode.js @@ -0,0 +1,50 @@ +Prism.languages.lolcode = { + comment: [/\bOBTW\s[\s\S]*?\sTLDR\b/, /\bBTW.+/], + string: { + pattern: /"(?::.|[^":])*"/, + inside: { + variable: /:\{[^}]+\}/, + symbol: [/:\([a-f\d]+\)/i, /:\[[^\]]+\]/, /:[)>o":]/], + }, + greedy: true, + }, + number: /(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/, + symbol: { + pattern: /(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/, + lookbehind: true, + inside: { + keyword: /A(?=\s)/, + }, + }, + label: { + pattern: /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/, + lookbehind: true, + alias: 'string', + }, + function: { + pattern: /((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/, + lookbehind: true, + }, + keyword: [ + { + pattern: + /(^|\s)(?:AN|FOUND YR|GIMMEH|GTFO|HAI|HAS A|HOW IZ I|I HAS A|I IZ|IF U SAY SO|IM IN YR|IM OUTTA YR|IS NOW(?: A)?|ITZ(?: A)?|IZ|KTHX|KTHXBYE|LIEK(?: A)?|MAEK|MEBBE|MKAY|NERFIN|NO WAI|O HAI IM|O RLY\?|OIC|OMG|OMGWTF|R|SMOOSH|SRS|TIL|UPPIN|VISIBLE|WILE|WTF\?|YA RLY|YR)(?=\s|,|$)/, + lookbehind: true, + }, + /'Z(?=\s|,|$)/, + ], + boolean: { + pattern: /(^|\s)(?:FAIL|WIN)(?=\s|,|$)/, + lookbehind: true, + }, + variable: { + pattern: /(^|\s)IT(?=\s|,|$)/, + lookbehind: true, + }, + operator: { + pattern: + /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/, + lookbehind: true, + }, + punctuation: /\.{3}|…|,|!/, +}; diff --git a/public/prism/prism-lolcode.min.js b/public/prism/prism-lolcode.min.js new file mode 100644 index 0000000..7835890 --- /dev/null +++ b/public/prism/prism-lolcode.min.js @@ -0,0 +1,42 @@ +Prism.languages.lolcode = { + comment: [/\bOBTW\s[\s\S]*?\sTLDR\b/, /\bBTW.+/], + string: { + pattern: /"(?::.|[^":])*"/, + inside: { + variable: /:\{[^}]+\}/, + symbol: [/:\([a-f\d]+\)/i, /:\[[^\]]+\]/, /:[)>o":]/], + }, + greedy: !0, + }, + number: /(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/, + symbol: { + pattern: /(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/, + lookbehind: !0, + inside: { keyword: /A(?=\s)/ }, + }, + label: { + pattern: /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/, + lookbehind: !0, + alias: 'string', + }, + function: { + pattern: /((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/, + lookbehind: !0, + }, + keyword: [ + { + pattern: + /(^|\s)(?:AN|FOUND YR|GIMMEH|GTFO|HAI|HAS A|HOW IZ I|I HAS A|I IZ|IF U SAY SO|IM IN YR|IM OUTTA YR|IS NOW(?: A)?|ITZ(?: A)?|IZ|KTHX|KTHXBYE|LIEK(?: A)?|MAEK|MEBBE|MKAY|NERFIN|NO WAI|O HAI IM|O RLY\?|OIC|OMG|OMGWTF|R|SMOOSH|SRS|TIL|UPPIN|VISIBLE|WILE|WTF\?|YA RLY|YR)(?=\s|,|$)/, + lookbehind: !0, + }, + /'Z(?=\s|,|$)/, + ], + boolean: { pattern: /(^|\s)(?:FAIL|WIN)(?=\s|,|$)/, lookbehind: !0 }, + variable: { pattern: /(^|\s)IT(?=\s|,|$)/, lookbehind: !0 }, + operator: { + pattern: + /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/, + lookbehind: !0, + }, + punctuation: /\.{3}|…|,|!/, +}; diff --git a/public/prism/prism-lua.js b/public/prism/prism-lua.js new file mode 100644 index 0000000..3acf73e --- /dev/null +++ b/public/prism/prism-lua.js @@ -0,0 +1,23 @@ +Prism.languages.lua = { + comment: /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m, + // \z may be used to skip the following space + string: { + pattern: + /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/, + greedy: true, + }, + number: + /\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i, + keyword: + /\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/, + function: /(?!\d)\w+(?=\s*(?:[({]))/, + operator: [ + /[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/, + { + // Match ".." but don't break "..." + pattern: /(^|[^.])\.\.(?!\.)/, + lookbehind: true, + }, + ], + punctuation: /[\[\](){},;]|\.+|:+/, +}; diff --git a/public/prism/prism-lua.min.js b/public/prism/prism-lua.min.js new file mode 100644 index 0000000..55aa2d5 --- /dev/null +++ b/public/prism/prism-lua.min.js @@ -0,0 +1,18 @@ +Prism.languages.lua = { + comment: /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m, + string: { + pattern: + /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/, + greedy: !0, + }, + number: + /\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i, + keyword: + /\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/, + function: /(?!\d)\w+(?=\s*(?:[({]))/, + operator: [ + /[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/, + { pattern: /(^|[^.])\.\.(?!\.)/, lookbehind: !0 }, + ], + punctuation: /[\[\](){},;]|\.+|:+/, +}; diff --git a/public/prism/prism-magma.js b/public/prism/prism-magma.js new file mode 100644 index 0000000..1810ed3 --- /dev/null +++ b/public/prism/prism-magma.js @@ -0,0 +1,38 @@ +Prism.languages.magma = { + output: { + pattern: + /^(>.*(?:\r(?:\n|(?!\n))|\n))(?!>)(?:.+|(?:\r(?:\n|(?!\n))|\n)(?!>).*)(?:(?:\r(?:\n|(?!\n))|\n)(?!>).*)*/m, + lookbehind: true, + greedy: true, + }, + + comment: { + pattern: /\/\/.*|\/\*[\s\S]*?\*\//, + greedy: true, + }, + string: { + pattern: /(^|[^\\"])"(?:[^\r\n\\"]|\\.)*"/, + lookbehind: true, + greedy: true, + }, + + // http://magma.maths.usyd.edu.au/magma/handbook/text/82 + keyword: + /\b(?:_|adj|and|assert|assert2|assert3|assigned|break|by|case|cat|catch|clear|cmpeq|cmpne|continue|declare|default|delete|diff|div|do|elif|else|end|eq|error|eval|exists|exit|for|forall|forward|fprintf|freeze|function|ge|gt|if|iload|import|in|intrinsic|is|join|le|load|local|lt|meet|mod|ne|not|notadj|notin|notsubset|or|print|printf|procedure|quit|random|read|readi|repeat|require|requirege|requirerange|restore|return|save|sdiff|select|subset|then|time|to|try|until|vprint|vprintf|vtime|when|where|while|xor)\b/, + boolean: /\b(?:false|true)\b/, + + generator: { + pattern: /\b[a-z_]\w*(?=\s*<)/i, + alias: 'class-name', + }, + function: /\b[a-z_]\w*(?=\s*\()/i, + + number: { + pattern: + /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/, + lookbehind: true, + }, + + operator: /->|[-+*/^~!|#=]|:=|\.\./, + punctuation: /[()[\]{}<>,;.:]/, +}; diff --git a/public/prism/prism-magma.min.js b/public/prism/prism-magma.min.js new file mode 100644 index 0000000..39c0d27 --- /dev/null +++ b/public/prism/prism-magma.min.js @@ -0,0 +1,26 @@ +Prism.languages.magma = { + output: { + pattern: + /^(>.*(?:\r(?:\n|(?!\n))|\n))(?!>)(?:.+|(?:\r(?:\n|(?!\n))|\n)(?!>).*)(?:(?:\r(?:\n|(?!\n))|\n)(?!>).*)*/m, + lookbehind: !0, + greedy: !0, + }, + comment: { pattern: /\/\/.*|\/\*[\s\S]*?\*\//, greedy: !0 }, + string: { + pattern: /(^|[^\\"])"(?:[^\r\n\\"]|\\.)*"/, + lookbehind: !0, + greedy: !0, + }, + keyword: + /\b(?:_|adj|and|assert|assert2|assert3|assigned|break|by|case|cat|catch|clear|cmpeq|cmpne|continue|declare|default|delete|diff|div|do|elif|else|end|eq|error|eval|exists|exit|for|forall|forward|fprintf|freeze|function|ge|gt|if|iload|import|in|intrinsic|is|join|le|load|local|lt|meet|mod|ne|not|notadj|notin|notsubset|or|print|printf|procedure|quit|random|read|readi|repeat|require|requirege|requirerange|restore|return|save|sdiff|select|subset|then|time|to|try|until|vprint|vprintf|vtime|when|where|while|xor)\b/, + boolean: /\b(?:false|true)\b/, + generator: { pattern: /\b[a-z_]\w*(?=\s*<)/i, alias: 'class-name' }, + function: /\b[a-z_]\w*(?=\s*\()/i, + number: { + pattern: + /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/, + lookbehind: !0, + }, + operator: /->|[-+*/^~!|#=]|:=|\.\./, + punctuation: /[()[\]{}<>,;.:]/, +}; diff --git a/public/prism/prism-makefile.js b/public/prism/prism-makefile.js new file mode 100644 index 0000000..08ecf19 --- /dev/null +++ b/public/prism/prism-makefile.js @@ -0,0 +1,36 @@ +Prism.languages.makefile = { + comment: { + pattern: /(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/, + lookbehind: true, + }, + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + + 'builtin-target': { + pattern: /\.[A-Z][^:#=\s]+(?=\s*:(?!=))/, + alias: 'builtin', + }, + + target: { + pattern: /^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m, + alias: 'symbol', + inside: { + variable: /\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/, + }, + }, + variable: /\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/, + + // Directives + keyword: + /-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/, + + function: { + pattern: + /(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/, + lookbehind: true, + }, + operator: /(?:::|[?:+!])?=|[|@]/, + punctuation: /[:;(){}]/, +}; diff --git a/public/prism/prism-makefile.min.js b/public/prism/prism-makefile.min.js new file mode 100644 index 0000000..ed18643 --- /dev/null +++ b/public/prism/prism-makefile.min.js @@ -0,0 +1,29 @@ +Prism.languages.makefile = { + comment: { + pattern: /(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/, + lookbehind: !0, + }, + string: { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: !0, + }, + 'builtin-target': { + pattern: /\.[A-Z][^:#=\s]+(?=\s*:(?!=))/, + alias: 'builtin', + }, + target: { + pattern: /^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m, + alias: 'symbol', + inside: { variable: /\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/ }, + }, + variable: /\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/, + keyword: + /-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/, + function: { + pattern: + /(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/, + lookbehind: !0, + }, + operator: /(?:::|[?:+!])?=|[|@]/, + punctuation: /[:;(){}]/, +}; diff --git a/public/prism/prism-markdown.js b/public/prism/prism-markdown.js new file mode 100644 index 0000000..191fc73 --- /dev/null +++ b/public/prism/prism-markdown.js @@ -0,0 +1,455 @@ +(function (Prism) { + // Allow only one line break + var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source; + + /** + * This function is intended for the creation of the bold or italic pattern. + * + * This also adds a lookbehind group to the given pattern to ensure that the pattern is not backslash-escaped. + * + * _Note:_ Keep in mind that this adds a capturing group. + * + * @param {string} pattern + * @returns {RegExp} + */ + function createInline(pattern) { + pattern = pattern.replace(//g, function () { + return inner; + }); + return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + '(?:' + pattern + ')'); + } + + var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/ + .source; + var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.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', { + 'front-matter-block': { + pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/, + lookbehind: true, + greedy: true, + inside: { + punctuation: /^---|---$/, + 'front-matter': { + pattern: /\S+(?:\s+\S+)*/, + alias: ['yaml', 'language-yaml'], + inside: Prism.languages.yaml, + }, + }, + }, + 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 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', + }, + { + // ```optional language + // code block + // ``` + pattern: /^```[\s\S]*?^```$/m, + greedy: true, + inside: { + 'code-block': { + pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m, + lookbehind: true, + }, + 'code-language': { + pattern: /^(```).+/, + lookbehind: true, + }, + punctuation: /```/, + }, + }, + ], + title: [ + { + // title 1 + // ======= + + // title 2 + // ------- + pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m, + alias: 'important', + inside: { + punctuation: /==+$|--+$/, + }, + }, + { + // # title 1 + // ###### title 6 + pattern: /(^\s*)#.+/m, + lookbehind: true, + alias: 'important', + inside: { + punctuation: /^#+|#+$/, + }, + }, + ], + hr: { + // *** + // --- + // * * * + // ----------- + pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, + lookbehind: true, + alias: 'punctuation', + }, + list: { + // * item + // + item + // - item + // 1. item + pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, + lookbehind: true, + alias: 'punctuation', + }, + 'url-reference': { + // [id]: http://example.com "Optional title" + // [id]: http://example.com 'Optional title' + // [id]: http://example.com (Optional title) + // [id]: "Optional title" + pattern: + /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, + inside: { + variable: { + pattern: /^(!?\[)[^\]]+/, + lookbehind: true, + }, + string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, + punctuation: /^[\[\]!:]|[<>]/, + }, + alias: 'url', + }, + bold: { + // **strong** + // __strong__ + + // allow one nested instance of italic text using the same delimiter + pattern: createInline( + /\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/ + .source + ), + lookbehind: true, + greedy: true, + inside: { + content: { + pattern: /(^..)[\s\S]+(?=..$)/, + lookbehind: true, + inside: {}, // see below + }, + punctuation: /\*\*|__/, + }, + }, + italic: { + // *em* + // _em_ + + // allow one nested instance of bold text using the same delimiter + pattern: createInline( + /\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/ + .source + ), + lookbehind: true, + greedy: true, + inside: { + content: { + pattern: /(^.)[\s\S]+(?=.$)/, + lookbehind: true, + inside: {}, // see below + }, + punctuation: /[*_]/, + }, + }, + strike: { + // ~~strike through~~ + // ~strike~ + // eslint-disable-next-line regexp/strict + pattern: createInline(/(~~?)(?:(?!~))+\2/.source), + lookbehind: true, + greedy: true, + inside: { + content: { + pattern: /(^~~?)[\s\S]+(?=\1$)/, + lookbehind: true, + inside: {}, // see below + }, + punctuation: /~~?/, + }, + }, + 'code-snippet': { + // `code` + // ``code`` + pattern: + /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/, + lookbehind: true, + greedy: true, + alias: ['code', 'keyword'], + }, + url: { + // [example](http://example.com "Optional title") + // [example][id] + // [example] [id] + pattern: createInline( + /!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/ + .source + ), + lookbehind: true, + greedy: true, + inside: { + operator: /^!/, + content: { + pattern: /(^\[)[^\]]+(?=\])/, + lookbehind: true, + inside: {}, // see below + }, + variable: { + pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/, + lookbehind: true, + }, + url: { + pattern: /(^\]\()[^\s)]+/, + lookbehind: true, + }, + string: { + pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/, + lookbehind: true, + }, + }, + }, + }); + + ['url', 'bold', 'italic', 'strike'].forEach(function (token) { + ['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function ( + inside + ) { + if (token !== inside) { + Prism.languages.markdown[token].inside.content.inside[inside] = + Prism.languages.markdown[inside]; + } + }); + }); + + Prism.hooks.add('after-tokenize', function (env) { + if (env.language !== 'markdown' && env.language !== 'md') { + return; + } + + function walkTokens(tokens) { + if (!tokens || typeof tokens === 'string') { + return; + } + + for (var i = 0, l = tokens.length; i < l; i++) { + var token = tokens[i]; + + if (token.type !== 'code') { + walkTokens(token.content); + continue; + } + + /* + * Add the correct `language-xxxx` class to this code block. Keep in mind that the `code-language` token + * is optional. But the grammar is defined so that there is only one case we have to handle: + * + * token.content = [ + * ```, + * xxxx, + * '\n', // exactly one new lines (\r or \n or \r\n) + * ..., + * '\n', // exactly one new lines again + * ``` + * ]; + */ + + var codeLang = token.content[1]; + var codeBlock = token.content[3]; + + if ( + codeLang && + codeBlock && + codeLang.type === 'code-language' && + codeBlock.type === 'code-block' && + typeof codeLang.content === 'string' + ) { + // this might be a language that Prism does not support + + // 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) { + codeBlock.alias = [alias]; + } else if (typeof codeBlock.alias === 'string') { + codeBlock.alias = [codeBlock.alias, alias]; + } else { + codeBlock.alias.push(alias); + } + } + } + } + + walkTokens(env.tokens); + }); + + Prism.hooks.add('wrap', function (env) { + if (env.type !== 'code-block') { + return; + } + + var codeLang = ''; + for (var i = 0, l = env.classes.length; i < l; i++) { + var cls = env.classes[i]; + var match = /language-(.+)/.exec(cls); + if (match) { + codeLang = match[1]; + break; + } + } + + var grammar = Prism.languages[codeLang]; + + if (!grammar) { + if (codeLang && codeLang !== 'none' && Prism.plugins.autoloader) { + var id = + 'md-' + new Date().valueOf() + '-' + Math.floor(Math.random() * 1e16); + env.attributes['id'] = id; + + Prism.plugins.autoloader.loadLanguages(codeLang, function () { + var ele = document.getElementById(id); + if (ele) { + ele.innerHTML = Prism.highlight( + ele.textContent, + Prism.languages[codeLang], + codeLang + ); + } + }); + } + } else { + env.content = Prism.highlight( + textContent(env.content), + grammar, + codeLang + ); + } + }); + + var tagPattern = RegExp(Prism.languages.markup.tag.pattern.source, 'gi'); + + /** + * A list of known entity names. + * + * This will always be incomplete to save space. The current list is the one used by lowdash's unescape function. + * + * @see {@link https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/unescape.js#L2} + */ + var KNOWN_ENTITY_NAMES = { + amp: '&', + lt: '<', + gt: '>', + quot: '"', + }; + + // IE 11 doesn't support `String.fromCodePoint` + var fromCodePoint = String.fromCodePoint || String.fromCharCode; + + /** + * Returns the text content of a given HTML source code string. + * + * @param {string} html + * @returns {string} + */ + function textContent(html) { + // remove all tags + var text = html.replace(tagPattern, ''); + + // decode known entities + text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function (m, code) { + code = code.toLowerCase(); + + if (code[0] === '#') { + var value; + if (code[1] === 'x') { + value = parseInt(code.slice(2), 16); + } else { + value = Number(code.slice(1)); + } + + return fromCodePoint(value); + } else { + var known = KNOWN_ENTITY_NAMES[code]; + if (known) { + return known; + } + + // unable to decode + return m; + } + }); + + return text; + } + + Prism.languages.md = Prism.languages.markdown; +})(Prism); diff --git a/public/prism/prism-markdown.min.js b/public/prism/prism-markdown.min.js new file mode 100644 index 0000000..ba1b36f --- /dev/null +++ b/public/prism/prism-markdown.min.js @@ -0,0 +1,278 @@ +!(function (s) { + function n(n) { + return ( + (n = n.replace(//g, function () { + return '(?:\\\\.|[^\\\\\n\r]|(?:\n|\r\n?)(?![\r\n]))'; + })), + RegExp('((?:^|[^\\\\])(?:\\\\{2})*)(?:' + n + ')') + ); + } + var e = '(?:\\\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\\\|\r\n`])+', + t = '\\|?__(?:\\|__)+\\|?(?:(?:\n|\r\n?)|(?![^]))'.replace( + /__/g, + function () { + return e; + } + ), + a = + '\\|?[ \t]*:?-{3,}:?[ \t]*(?:\\|[ \t]*:?-{3,}:?[ \t]*)+\\|?(?:\n|\r\n?)'; + (s.languages.markdown = s.languages.extend('markup', {})), + s.languages.insertBefore('markdown', 'prolog', { + 'front-matter-block': { + pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/, + lookbehind: !0, + greedy: !0, + inside: { + punctuation: /^---|---$/, + 'front-matter': { + pattern: /\S+(?:\s+\S+)*/, + alias: ['yaml', 'language-yaml'], + inside: s.languages.yaml, + }, + }, + }, + blockquote: { pattern: /^>(?:[\t ]*>)*/m, alias: 'punctuation' }, + table: { + pattern: RegExp('^' + t + a + '(?:' + t + ')*', 'm'), + inside: { + 'table-data-rows': { + pattern: RegExp('^(' + t + a + ')(?:' + t + ')*$'), + lookbehind: !0, + inside: { + 'table-data': { + pattern: RegExp(e), + inside: s.languages.markdown, + }, + punctuation: /\|/, + }, + }, + 'table-line': { + pattern: RegExp('^(' + t + ')' + a + '$'), + lookbehind: !0, + inside: { punctuation: /\||:?-{3,}:?/ }, + }, + 'table-header-row': { + pattern: RegExp('^' + t + '$'), + inside: { + 'table-header': { + pattern: RegExp(e), + alias: 'important', + inside: s.languages.markdown, + }, + punctuation: /\|/, + }, + }, + }, + }, + code: [ + { + pattern: + /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/, + lookbehind: !0, + alias: 'keyword', + }, + { + pattern: /^```[\s\S]*?^```$/m, + greedy: !0, + inside: { + 'code-block': { + pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m, + lookbehind: !0, + }, + 'code-language': { pattern: /^(```).+/, lookbehind: !0 }, + punctuation: /```/, + }, + }, + ], + title: [ + { + pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m, + alias: 'important', + inside: { punctuation: /==+$|--+$/ }, + }, + { + pattern: /(^\s*)#.+/m, + lookbehind: !0, + alias: 'important', + inside: { punctuation: /^#+|#+$/ }, + }, + ], + hr: { + pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, + lookbehind: !0, + alias: 'punctuation', + }, + list: { + pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, + lookbehind: !0, + alias: 'punctuation', + }, + 'url-reference': { + pattern: + /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, + inside: { + variable: { pattern: /^(!?\[)[^\]]+/, lookbehind: !0 }, + string: + /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, + punctuation: /^[\[\]!:]|[<>]/, + }, + alias: 'url', + }, + bold: { + pattern: n( + '\\b__(?:(?!_)|_(?:(?!_))+_)+__\\b|\\*\\*(?:(?!\\*)|\\*(?:(?!\\*))+\\*)+\\*\\*' + ), + lookbehind: !0, + greedy: !0, + inside: { + content: { + pattern: /(^..)[\s\S]+(?=..$)/, + lookbehind: !0, + inside: {}, + }, + punctuation: /\*\*|__/, + }, + }, + italic: { + pattern: n( + '\\b_(?:(?!_)|__(?:(?!_))+__)+_\\b|\\*(?:(?!\\*)|\\*\\*(?:(?!\\*))+\\*\\*)+\\*' + ), + lookbehind: !0, + greedy: !0, + inside: { + content: { pattern: /(^.)[\s\S]+(?=.$)/, lookbehind: !0, inside: {} }, + punctuation: /[*_]/, + }, + }, + strike: { + pattern: n('(~~?)(?:(?!~))+\\2'), + lookbehind: !0, + greedy: !0, + inside: { + content: { + pattern: /(^~~?)[\s\S]+(?=\1$)/, + lookbehind: !0, + inside: {}, + }, + punctuation: /~~?/, + }, + }, + 'code-snippet': { + pattern: + /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/, + lookbehind: !0, + greedy: !0, + alias: ['code', 'keyword'], + }, + url: { + pattern: n( + '!?\\[(?:(?!\\]))+\\](?:\\([^\\s)]+(?:[\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \t]?\\[(?:(?!\\]))+\\])' + ), + lookbehind: !0, + greedy: !0, + inside: { + operator: /^!/, + content: { pattern: /(^\[)[^\]]+(?=\])/, lookbehind: !0, inside: {} }, + variable: { pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/, lookbehind: !0 }, + url: { pattern: /(^\]\()[^\s)]+/, lookbehind: !0 }, + string: { + pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/, + lookbehind: !0, + }, + }, + }, + }), + ['url', 'bold', 'italic', 'strike'].forEach(function (e) { + ['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function (n) { + e !== n && + (s.languages.markdown[e].inside.content.inside[n] = + s.languages.markdown[n]); + }); + }), + s.hooks.add('after-tokenize', function (n) { + ('markdown' !== n.language && 'md' !== n.language) || + !(function n(e) { + if (e && 'string' != typeof e) + for (var t = 0, a = e.length; t < a; t++) { + var r = e[t]; + if ('code' === r.type) { + var i = r.content[1], + o = r.content[3]; + if ( + i && + o && + 'code-language' === i.type && + 'code-block' === o.type && + 'string' == typeof i.content + ) { + var l = i.content + .replace(/\b#/g, 'sharp') + .replace(/\b\+\+/g, 'pp'), + s = + 'language-' + + (l = (/[a-z][\w-]*/i.exec(l) || [''])[0].toLowerCase()); + o.alias + ? 'string' == typeof o.alias + ? (o.alias = [o.alias, s]) + : o.alias.push(s) + : (o.alias = [s]); + } + } else n(r.content); + } + })(n.tokens); + }), + s.hooks.add('wrap', function (n) { + if ('code-block' === n.type) { + for (var e = '', t = 0, a = n.classes.length; t < a; t++) { + var r = n.classes[t], + i = /language-(.+)/.exec(r); + if (i) { + e = i[1]; + break; + } + } + var o = s.languages[e]; + if (o) + n.content = s.highlight( + (function (n) { + var e = n.replace(d, ''); + return (e = e.replace( + /&(\w{1,8}|#x?[\da-f]{1,8});/gi, + function (n, e) { + var t; + if ('#' === (e = e.toLowerCase())[0]) + return ( + (t = + 'x' === e[1] + ? parseInt(e.slice(2), 16) + : Number(e.slice(1))), + u(t) + ); + var a = p[e]; + return a || n; + } + )); + })(n.content), + o, + e + ); + else if (e && 'none' !== e && s.plugins.autoloader) { + var l = + 'md-' + + new Date().valueOf() + + '-' + + Math.floor(1e16 * Math.random()); + (n.attributes.id = l), + s.plugins.autoloader.loadLanguages(e, function () { + var n = document.getElementById(l); + n && + (n.innerHTML = s.highlight(n.textContent, s.languages[e], e)); + }); + } + } + }); + var d = RegExp(s.languages.markup.tag.pattern.source, 'gi'), + p = { amp: '&', lt: '<', gt: '>', quot: '"' }, + u = String.fromCodePoint || String.fromCharCode; + s.languages.md = s.languages.markdown; +})(Prism); diff --git a/public/prism/prism-markup-templating.js b/public/prism/prism-markup-templating.js new file mode 100644 index 0000000..267ca96 --- /dev/null +++ b/public/prism/prism-markup-templating.js @@ -0,0 +1,134 @@ +(function (Prism) { + /** + * Returns the placeholder for the given language id and index. + * + * @param {string} language + * @param {string|number} index + * @returns {string} + */ + function getPlaceholder(language, index) { + return '___' + language.toUpperCase() + index + '___'; + } + + Object.defineProperties((Prism.languages['markup-templating'] = {}), { + buildPlaceholders: { + /** + * Tokenize all inline templating expressions matching `placeholderPattern`. + * + * If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns + * `true` will be replaced. + * + * @param {object} env The environment of the `before-tokenize` hook. + * @param {string} language The language id. + * @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders. + * @param {(match: string) => boolean} [replaceFilter] + */ + value: function (env, language, placeholderPattern, replaceFilter) { + if (env.language !== language) { + return; + } + + var tokenStack = (env.tokenStack = []); + + env.code = env.code.replace(placeholderPattern, function (match) { + if (typeof replaceFilter === 'function' && !replaceFilter(match)) { + return match; + } + var i = tokenStack.length; + var placeholder; + + // Check for existing strings + while ( + env.code.indexOf((placeholder = getPlaceholder(language, i))) !== -1 + ) { + ++i; + } + + // Create a sparse array + tokenStack[i] = match; + + return placeholder; + }); + + // Switch the grammar to markup + env.grammar = Prism.languages.markup; + }, + }, + tokenizePlaceholders: { + /** + * Replace placeholders with proper tokens after tokenizing. + * + * @param {object} env The environment of the `after-tokenize` hook. + * @param {string} language The language id. + */ + value: function (env, language) { + if (env.language !== language || !env.tokenStack) { + return; + } + + // Switch the grammar back + env.grammar = Prism.languages[language]; + + var j = 0; + var keys = Object.keys(env.tokenStack); + + function walkTokens(tokens) { + for (var i = 0; i < tokens.length; i++) { + // all placeholders are replaced already + if (j >= keys.length) { + break; + } + + var token = tokens[i]; + if ( + typeof token === 'string' || + (token.content && typeof token.content === 'string') + ) { + var k = keys[j]; + var t = env.tokenStack[k]; + var s = typeof token === 'string' ? token : token.content; + var placeholder = getPlaceholder(language, k); + + var index = s.indexOf(placeholder); + if (index > -1) { + ++j; + + var before = s.substring(0, index); + var middle = new Prism.Token( + language, + Prism.tokenize(t, env.grammar), + 'language-' + language, + t + ); + var after = s.substring(index + placeholder.length); + + var replacement = []; + if (before) { + replacement.push.apply(replacement, walkTokens([before])); + } + replacement.push(middle); + if (after) { + replacement.push.apply(replacement, walkTokens([after])); + } + + if (typeof token === 'string') { + tokens.splice.apply(tokens, [i, 1].concat(replacement)); + } else { + token.content = replacement; + } + } + } else if ( + token.content /* && typeof token.content !== 'string' */ + ) { + walkTokens(token.content); + } + } + + return tokens; + } + + walkTokens(env.tokens); + }, + }, + }); +})(Prism); diff --git a/public/prism/prism-markup-templating.min.js b/public/prism/prism-markup-templating.min.js new file mode 100644 index 0000000..43488c9 --- /dev/null +++ b/public/prism/prism-markup-templating.min.js @@ -0,0 +1,64 @@ +!(function (h) { + function v(e, n) { + return '___' + e.toUpperCase() + n + '___'; + } + Object.defineProperties((h.languages['markup-templating'] = {}), { + buildPlaceholders: { + value: function (a, r, e, o) { + if (a.language === r) { + var c = (a.tokenStack = []); + (a.code = a.code.replace(e, function (e) { + if ('function' == typeof o && !o(e)) return e; + for (var n, t = c.length; -1 !== a.code.indexOf((n = v(r, t))); ) + ++t; + return (c[t] = e), n; + })), + (a.grammar = h.languages.markup); + } + }, + }, + tokenizePlaceholders: { + value: function (p, k) { + if (p.language === k && p.tokenStack) { + p.grammar = h.languages[k]; + var m = 0, + d = Object.keys(p.tokenStack); + !(function e(n) { + for (var t = 0; t < n.length && !(m >= d.length); t++) { + var a = n[t]; + if ( + 'string' == typeof a || + (a.content && 'string' == typeof a.content) + ) { + var r = d[m], + o = p.tokenStack[r], + c = 'string' == typeof a ? a : a.content, + i = v(k, r), + u = c.indexOf(i); + if (-1 < u) { + ++m; + var g = c.substring(0, u), + l = new h.Token( + k, + h.tokenize(o, p.grammar), + 'language-' + k, + o + ), + s = c.substring(u + i.length), + f = []; + g && f.push.apply(f, e([g])), + f.push(l), + s && f.push.apply(f, e([s])), + 'string' == typeof a + ? n.splice.apply(n, [t, 1].concat(f)) + : (a.content = f); + } + } else a.content && e(a.content); + } + return n; + })(p.tokens); + } + }, + }, + }); +})(Prism); diff --git a/public/prism/prism-markup.js b/public/prism/prism-markup.js new file mode 100644 index 0000000..031bbc9 --- /dev/null +++ b/public/prism/prism-markup.js @@ -0,0 +1,196 @@ +Prism.languages.markup = { + comment: { + pattern: //, + greedy: true, + }, + prolog: { + pattern: /<\?[\s\S]+?\?>/, + greedy: true, + }, + doctype: { + // https://www.w3.org/TR/xml/#NT-doctypedecl + pattern: + /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i, + greedy: true, + inside: { + 'internal-subset': { + pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, + lookbehind: true, + greedy: true, + inside: null, // see below + }, + string: { + pattern: /"[^"]*"|'[^']*'/, + greedy: true, + }, + punctuation: /^$|[[\]]/, + 'doctype-tag': /^DOCTYPE/i, + name: /[^\s<>'"]+/, + }, + }, + cdata: { + pattern: //i, + greedy: true, + }, + tag: { + pattern: + /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, + greedy: true, + inside: { + tag: { + pattern: /^<\/?[^\s>\/]+/, + inside: { + punctuation: /^<\/?/, + namespace: /^[^\s>\/:]+:/, + }, + }, + 'special-attr': [], + 'attr-value': { + pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, + inside: { + punctuation: [ + { + pattern: /^=/, + alias: 'attr-equals', + }, + /"|'/, + ], + }, + }, + punctuation: /\/?>/, + 'attr-name': { + pattern: /[^\s>\/]+/, + inside: { + namespace: /^[^\s>\/:]+:/, + }, + }, + }, + }, + entity: [ + { + pattern: /&[\da-z]{1,8};/i, + alias: 'named-entity', + }, + /&#x?[\da-f]{1,8};/i, + ], +}; + +Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = + Prism.languages.markup['entity']; +Prism.languages.markup['doctype'].inside['internal-subset'].inside = + Prism.languages.markup; + +// Plugin to make entity title show the real entity, idea by Roman Komarov +Prism.hooks.add('wrap', function (env) { + if (env.type === 'entity') { + env.attributes['title'] = env.content.replace(/&/, '&'); + } +}); + +Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { + /** + * Adds an inlined language to markup. + * + * An example of an inlined language is CSS with `