From: Tim Düsterhus Date: Tue, 15 Sep 2020 12:52:11 +0000 (+0200) Subject: Update prism to 1.21.0 X-Git-Tag: 5.3.0_Beta_1~30^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a5c4888cf977f3e859b85bc439d62f07d37d37a6;p=GitHub%2FWoltLab%2FWCF.git Update prism to 1.21.0 --- diff --git a/wcfsetup/install/files/js/3rdParty/prism/README.md b/wcfsetup/install/files/js/3rdParty/prism/README.md index b09d6eb81f..2478355c9d 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/README.md +++ b/wcfsetup/install/files/js/3rdParty/prism/README.md @@ -16,13 +16,14 @@ You can learn more on [prismjs.com](https://prismjs.com/). Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, considering giving back by sending a pull request. Here are a few tips: - Read the [documentation](https://prismjs.com/extending.html). Prism was designed to be extensible. -- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. The minified files are also generated automatically. -- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. Having gulp installed, you just need to run the command `gulp`. +- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. `prism.js` and all minified files are also generated automatically by our build system. +- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. With all of Prism's dependencies installed, you just need to run the command `npm run build`. - Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc. - Please try to err towards more smaller PRs rather than few huge PRs. If a PR includes changes I want to merge and changes I don't, handling it becomes difficult. - My time is very limited these days, so it might take a long time to review longer PRs (short ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected. - If you contribute a new language definition, you will be responsible for handling bug reports about that language definition. -- If you add a new language definition, theme or plugin, you need to add it to `components.json` as well and rebuild Prism by running `gulp`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder. +- If you [add a new language definition](https://prismjs.com/extending.html#creating-a-new-language-definition) or plugin, you need to add it to `components.json` as well and rebuild Prism by running `npm run build`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder. +- Go to [prism-themes](https://github.com/PrismJS/prism-themes) if you want to add a new theme. Thank you so much for contributing!! diff --git a/wcfsetup/install/files/js/3rdParty/prism/components.json b/wcfsetup/install/files/js/3rdParty/prism/components.json index 70eef9e16d..0ae297ea21 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components.json +++ b/wcfsetup/install/files/js/3rdParty/prism/components.json @@ -48,12 +48,15 @@ }, "markup": { "title": "Markup", - "alias": ["html", "xml", "svg", "mathml"], + "alias": ["html", "xml", "svg", "mathml", "ssml", "atom", "rss"], "aliasTitles": { "html": "HTML", "xml": "XML", "svg": "SVG", - "mathml": "MathML" + "mathml": "MathML", + "ssml": "SSML", + "atom": "Atom", + "rss": "RSS" }, "option": "default" }, @@ -78,7 +81,7 @@ "owner": "dellagustin" }, "abnf": { - "title": "Augmented Backus–Naur form", + "title": "ABNF", "owner": "RunDevelopment" }, "actionscript": { @@ -91,6 +94,14 @@ "title": "Ada", "owner": "Lucretia" }, + "agda": { + "title": "Agda", + "owner": "xy-ren" + }, + "al": { + "title": "AL", + "owner": "RunDevelopment" + }, "antlr4": { "title": "ANTLR4", "alias": "g4", @@ -126,15 +137,15 @@ "title": "AsciiDoc", "owner": "Golmote" }, - "asm6502": { - "title": "6502 Assembly", - "owner": "kzurawel" - }, "aspnet": { "title": "ASP.NET (C#)", "require": ["markup", "csharp"], "owner": "nauzilus" }, + "asm6502": { + "title": "6502 Assembly", + "owner": "kzurawel" + }, "autohotkey": { "title": "AutoHotkey", "owner": "aviaryan" @@ -173,10 +184,10 @@ "owner": "Golmote" }, "bnf": { - "title": "Backus–Naur form", + "title": "BNF", "alias": "rbnf", "aliasTitles": { - "rbnf": "Routing Backus–Naur form" + "rbnf": "RBNF" }, "owner": "RunDevelopment" }, @@ -197,11 +208,6 @@ "require": "clike", "owner": "zeitgeist87" }, - "concurnas": { - "title": "Concurnas", - "alias": "conc", - "owner": "jasontatton" - }, "csharp": { "title": "C#", "require": "clike", @@ -217,35 +223,44 @@ "title": "CIL", "owner": "sbrl" }, + "clojure": { + "title": "Clojure", + "owner": "troglotit" + }, + "cmake": { + "title": "CMake", + "owner": "mjrogozinski" + }, "coffeescript": { "title": "CoffeeScript", "require": "javascript", "alias": "coffee", "owner": "R-osey" }, - "cmake": { - "title": "CMake", - "owner": "mjrogozinski" + "concurnas": { + "title": "Concurnas", + "alias": "conc", + "owner": "jasontatton" }, - "clojure": { - "title": "Clojure", - "owner": "troglotit" + "csp": { + "title": "Content-Security-Policy", + "owner": "ScottHelme" }, "crystal": { "title": "Crystal", "require": "ruby", "owner": "MakeNowJust" }, - "csp": { - "title": "Content-Security-Policy", - "owner": "ScottHelme" - }, "css-extras": { "title": "CSS Extras", "require": "css", "modify": "css", "owner": "milesj" }, + "cypher": { + "title": "Cypher", + "owner": "RunDevelopment" + }, "d": { "title": "D", "require": "clike", @@ -260,6 +275,10 @@ "title": "DAX", "owner": "peterbud" }, + "dhall": { + "title": "Dhall", + "owner": "RunDevelopment" + }, "diff": { "title": "Diff", "owner": "uranusjr" @@ -281,9 +300,13 @@ "owner": "JustinBeckwith" }, "ebnf": { - "title": "Extended Backus–Naur form", + "title": "EBNF", "owner": "RunDevelopment" }, + "editorconfig": { + "title": "EditorConfig", + "owner": "osipxd" + }, "eiffel": { "title": "Eiffel", "owner": "Conaclos" @@ -291,7 +314,11 @@ "ejs": { "title": "EJS", "require": ["javascript", "markup-templating"], - "owner": "RunDevelopment" + "owner": "RunDevelopment", + "alias": "eta", + "aliasTitles": { + "eta": "Eta" + } }, "elixir": { "title": "Elixir", @@ -348,6 +375,12 @@ "require": "markup-templating", "owner": "RunDevelopment" }, + "gml": { + "title": "GameMaker Language", + "alias": "gamemakerlanguage", + "require": "clike", + "owner": "LiarOnce" + }, "gcode": { "title": "G-code", "owner": "RunDevelopment" @@ -370,15 +403,9 @@ }, "glsl": { "title": "GLSL", - "require": "clike", + "require": "c", "owner": "Golmote" }, - "gml": { - "title": "GameMaker Language", - "alias": "gamemakerlanguage", - "require": "clike", - "owner": "LiarOnce" - }, "go": { "title": "Go", "require": "clike", @@ -386,6 +413,7 @@ }, "graphql": { "title": "GraphQL", + "optional": ["markdown"], "owner": "Golmote" }, "groovy": { @@ -428,6 +456,11 @@ "title": "HCL", "owner": "outsideris" }, + "hlsl": { + "title": "HLSL", + "require": "c", + "owner": "RunDevelopment" + }, "http": { "title": "HTTP", "optional": [ @@ -454,6 +487,20 @@ "title": "Icon", "owner": "Golmote" }, + "ignore": { + "title": ".ignore", + "owner": "osipxd", + "alias": [ + "gitignore", + "hgignore", + "npmignore" + ], + "aliasTitles": { + "gitignore": ".gitignore", + "hgignore": ".hgignore", + "npmignore": ".npmignore" + } + }, "inform7": { "title": "Inform 7", "owner": "Golmote" @@ -506,7 +553,7 @@ }, "jsdoc": { "title": "JSDoc", - "require": ["javascript", "javadoclike"], + "require": ["javascript", "javadoclike", "typescript"], "modify": "javascript", "optional": [ "actionscript", @@ -527,6 +574,28 @@ ], "owner": "RunDevelopment" }, + "json": { + "title": "JSON", + "alias": "webmanifest", + "aliasTitles": { + "webmanifest": "Web App Manifest" + }, + "owner": "CupOfTea696" + }, + "json5": { + "title": "JSON5", + "require": "json", + "owner": "RunDevelopment" + }, + "jsonp": { + "title": "JSONP", + "require": "json", + "owner": "RunDevelopment" + }, + "jsstacktrace": { + "title": "JS stack trace", + "owner": "sbrl" + }, "js-templates": { "title": "JS Templates", "require": "javascript", @@ -540,20 +609,6 @@ ], "owner": "RunDevelopment" }, - "json": { - "title": "JSON", - "owner": "CupOfTea696" - }, - "jsonp": { - "title": "JSONP", - "require": "json", - "owner": "RunDevelopment" - }, - "json5": { - "title": "JSON5", - "require": "json", - "owner": "RunDevelopment" - }, "julia": { "title": "Julia", "owner": "cdagnino" @@ -564,6 +619,10 @@ }, "kotlin": { "title": "Kotlin", + "alias": ["kt", "kts"], + "aliasTitles": { + "kts": "Kotlin Script" + }, "require": "clike", "owner": "Golmote" }, @@ -697,6 +756,7 @@ "objectivec": { "title": "Objective-C", "require": "c", + "alias": "objc", "owner": "uranusjr" }, "ocaml": { @@ -742,6 +802,11 @@ "alias": "px", "owner": "RunDevelopment" }, + "peoplecode": { + "title": "PeopleCode", + "alias": "pcode", + "owner": "RunDevelopment" + }, "perl": { "title": "Perl", "owner": "Golmote" @@ -824,6 +889,12 @@ ], "owner": "Golmote" }, + "purebasic": { + "title": "PureBasic", + "require": "clike", + "alias": "pbfasm", + "owner": "HeX0R101" + }, "python": { "title": "Python", "alias": "py", @@ -847,6 +918,12 @@ "title": "R", "owner": "Golmote" }, + "racket": { + "title": "Racket", + "require": "scheme", + "alias": "rkt", + "owner": "RunDevelopment" + }, "jsx": { "title": "React JSX", "require": ["markup", "javascript"], @@ -861,10 +938,6 @@ "title": "React TSX", "require": ["jsx", "typescript"] }, - "renpy": { - "title": "Ren'py", - "owner": "HyuchiaDiego" - }, "reason": { "title": "Reason", "require": "clike", @@ -882,6 +955,11 @@ ], "owner": "RunDevelopment" }, + "renpy": { + "title": "Ren'py", + "alias": "rpy", + "owner": "HyuchiaDiego" + }, "rest": { "title": "reST (reStructuredText)", "owner": "Golmote" @@ -939,6 +1017,10 @@ "require": "bash", "owner": "RunDevelopment" }, + "smali": { + "title": "Smali", + "owner": "RunDevelopment" + }, "smalltalk": { "title": "Smalltalk", "owner": "Golmote" @@ -950,6 +1032,7 @@ }, "solidity": { "title": "Solidity (Ethereum)", + "alias": "sol", "require": "clike", "owner": "glachaud" }, @@ -982,6 +1065,10 @@ "title": "SQL", "owner": "multipetros" }, + "iecst": { + "title": "Structured Text (IEC 61131-3)", + "owner": "serhioromano" + }, "stylus": { "title": "Stylus", "owner": "vkbansal" @@ -991,6 +1078,21 @@ "require": "clike", "owner": "chrischares" }, + "t4-templating": { + "title": "T4 templating", + "owner": "RunDevelopment" + }, + "t4-cs": { + "title": "T4 Text Templates (C#)", + "require": ["t4-templating", "csharp"], + "alias": "t4", + "owner": "RunDevelopment" + }, + "t4-vb": { + "title": "T4 Text Templates (VB)", + "require": ["t4-templating", "vbnet"], + "owner": "RunDevelopment" + }, "tap": { "title": "TAP", "owner": "isaacs", @@ -1000,6 +1102,11 @@ "title": "Tcl", "owner": "PeterChaplin" }, + "tt2": { + "title": "Template Toolkit 2", + "require": ["clike", "markup-templating"], + "owner": "gflohr" + }, "textile": { "title": "Textile", "require": "markup", @@ -1010,11 +1117,6 @@ "title": "TOML", "owner": "RunDevelopment" }, - "tt2": { - "title": "Template Toolkit 2", - "require": ["clike", "markup-templating"], - "owner": "gflohr" - }, "turtle": { "title": "Turtle", "alias": "trig", @@ -1035,19 +1137,9 @@ "alias": "ts", "owner": "vkbansal" }, - "t4-cs": { - "title": "T4 Text Templates (C#)", - "require": ["t4-templating", "csharp"], - "alias": "t4", - "owner": "RunDevelopment" - }, - "t4-vb": { - "title": "T4 Text Templates (VB)", - "require": ["t4-templating", "visual-basic"], - "owner": "RunDevelopment" - }, - "t4-templating": { - "title": "T4 templating", + "unrealscript": { + "title": "UnrealScript", + "alias": ["uscript", "uc"], "owner": "RunDevelopment" }, "vala": { @@ -1079,9 +1171,16 @@ }, "visual-basic": { "title": "Visual Basic", - "alias": "vb", + "alias": ["vb", "vba"], + "aliasTitles": { + "vba": "VBA" + }, "owner": "Golmote" }, + "warpscript": { + "title": "WarpScript", + "owner": "RunDevelopment" + }, "wasm": { "title": "WebAssembly", "owner": "Golmote" @@ -1100,6 +1199,12 @@ }, "owner": "freakmaxi" }, + "xml-doc": { + "title": "XML doc (.net)", + "require": "markup", + "modify": ["csharp", "fsharp", "vbnet"], + "owner": "RunDevelopment" + }, "xojo": { "title": "Xojo (REALbasic)", "owner": "Golmote" @@ -1114,6 +1219,10 @@ "alias": "yml", "owner": "hason" }, + "yang": { + "title": "YANG", + "owner": "RunDevelopment" + }, "zig": { "title": "Zig", "owner": "RunDevelopment" diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-agda.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-agda.js new file mode 100644 index 0000000000..072ffa3942 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-agda.js @@ -0,0 +1,27 @@ +define(["prism/prism"], function () { +(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]*)[^:\r\n]+?(?=:)/m, + lookbehind: true, + }, + 'operator': { + pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/, + lookbehind: true, + }, + 'keyword': /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|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)); + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-al.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-al.js new file mode 100644 index 0000000000..ce98312815 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-al.js @@ -0,0 +1,28 @@ +define(["prism/prism"], function () { +// 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|U(?:LL?)?|LL?)?\b/i, + 'boolean': /\b(?:false|true)\b/i, + 'variable': /\b(?:Curr(?:FieldNo|Page|Report)|RequestOptionsPage|x?Rec)\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': /[()\[\]{}:.;,]/ +}; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-antlr4.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-antlr4.js index d67937757a..32c20bfab0 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-antlr4.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-antlr4.js @@ -32,7 +32,7 @@ Prism.languages.antlr4 = { } }, 'command': { - pattern: /(->\s*)(?:\s*(?:,\s*)?[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i, + pattern: /(->\s*)(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i, lookbehind: true, inside: { 'function': /\b\w+(?=\s*(?:[,(]|$))/, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-apl.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-apl.js index 3a6dfa4ef9..78c65fecff 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-apl.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-apl.js @@ -5,7 +5,7 @@ Prism.languages.apl = { pattern: /'(?:[^'\r\n]|'')*'/, greedy: true }, - 'number': /¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞))?/i, + 'number': /¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞))?/i, 'statement': /:[A-Z][a-z][A-Za-z]*\b/, 'system-function': { pattern: /⎕[A-Z]+/i, @@ -18,7 +18,7 @@ Prism.languages.apl = { alias: 'operator' }, 'dyadic-operator': { - pattern: /[.⍣⍠⍤∘⌸@⌺]/, + pattern: /[.⍣⍠⍤∘⌸@⌺⍥]/, alias: 'operator' }, 'assignment': { @@ -31,4 +31,5 @@ Prism.languages.apl = { alias: 'builtin' } }; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-applescript.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-applescript.js index 7b8b1a442b..1ccec1b2b6 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-applescript.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-applescript.js @@ -2,7 +2,7 @@ define(["prism/prism"], function () { Prism.languages.applescript = { 'comment': [ // Allow one level of nesting - /\(\*(?:\(\*[\s\S]*?\*\)|[\s\S])*?\*\)/, + /\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/, /--.+/, /#.+/ ], @@ -19,4 +19,5 @@ Prism.languages.applescript = { }, 'punctuation': /[{}():,¬«»《》]/ }; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-asciidoc.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-asciidoc.js index f7dcc99e55..a7540b25ab 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-asciidoc.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-asciidoc.js @@ -150,7 +150,7 @@ define(["prism/prism"], function () { 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)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\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, + 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, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-asm6502.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-asm6502.js index d02c3529df..9a8a20b4d6 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-asm6502.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-asm6502.js @@ -7,19 +7,19 @@ Prism.languages.asm6502 = { }, 'string': /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, 'opcode': { - 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/, + 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: 'property' }, 'hexnumber': { - pattern: /#?\$[\da-f]{2,4}/i, + pattern: /#?\$[\da-f]{2,4}\b/i, alias: 'string' }, 'binarynumber': { - pattern: /#?%[01]+/, + pattern: /#?%[01]+\b/, alias: 'string' }, 'decimalnumber': { - pattern: /#?\d+/, + pattern: /#?\b\d+\b/, alias: 'string' }, 'register': { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-autohotkey.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-autohotkey.js index 17e8fe1a4d..fb829a54cf 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-autohotkey.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-autohotkey.js @@ -1,30 +1,37 @@ define(["prism/prism"], function () { // NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl -Prism.languages.autohotkey= { - 'comment': { - pattern: /(^[^";\n]*(?:"[^"\n]*?"[^"\n]*?)*)(?:;.*$|^\s*\/\*[\s\S]*\n\*\/)/m, - lookbehind: true - }, +Prism.languages.autohotkey = { + 'comment': [ + { + pattern: /(^|\s);.*/, + lookbehind: true + }, + { + pattern: /(^\s*)\/\*[^\r\n]*(?:[\r\n](?![ \t]*\*\/)|[^\r\n])*(?:[\r\n][ \t]*\*\/)?/m, + lookbehind: true, + greedy: true + } + ], 'string': /"(?:[^"\n\r]|"")*"/m, - 'function': /[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+?(?=\()/m, //function - don't use .*\) in the end bcoz string locks it - 'tag': /^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m, //labels + 'tag': /^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m, //labels 'variable': /%\w+%/, 'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/, 'operator': /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/, - 'punctuation': /[{}[\]():,]/, 'boolean': /\b(?:true|false)\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|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, + '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_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|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_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|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|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)\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_guievent|a_guicontrol|a_guicontrolevent|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|programfiles|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)\b/i, - 'builtin': /\b(?:abs|acos|asc|asin|atan|ceil|chr|class|cos|dllcall|exp|fileexist|Fileopen|floor|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\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|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|ltrim|rtrim|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|strreplace|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__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|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InstallKeybdHook|InstallMouseHook|KeyHistory|LTrim|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|WinActivateForce)\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_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i + '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|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Throw|Try|Catch|Finally|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+*\-=?>:\\\/<&%\[\]]+?(?=\()/m, + 'punctuation': /[{}[\]():,]/ }; return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-bash.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-bash.js index bb44e54365..1fd9b86eb9 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-bash.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-bash.js @@ -134,7 +134,7 @@ define(["prism/prism"], function () { }, 'variable': insideString.variable, 'function': { - pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|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|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|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, + pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|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|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|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|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': { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-batch.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-batch.js index 42184819a8..18c1cb1b32 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-batch.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-batch.js @@ -8,7 +8,7 @@ define(["prism/prism"], function () { 'punctuation': /:/ } }; - var string = /"[^"]*"/; + var string = /"(?:[\\"]"|[^"])*"(?!")/; var number = /(?:\b|-)\d+\b/; Prism.languages.batch = { @@ -77,7 +77,7 @@ define(["prism/prism"], function () { }, { // Other commands - pattern: /((?:^|[&(])[ \t]*@?)\w+\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, + pattern: /((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, lookbehind: true, inside: { 'keyword': /^\w+\b/i, @@ -98,4 +98,5 @@ define(["prism/prism"], function () { 'punctuation': /[()']/ }; }(Prism)); + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-c.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-c.js index 0f25fc840f..26f9c5338e 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-c.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-c.js @@ -18,20 +18,31 @@ Prism.languages.insertBefore('c', 'string', { 'macro': { // allow for multiline macro definitions // spaces after the # character compile fine with gcc - pattern: /(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im, + pattern: /(^\s*)#\s*[a-z]+(?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, lookbehind: true, + greedy: true, alias: 'property', inside: { - // highlight the path of the include statement as a string - 'string': { - pattern: /(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/, - lookbehind: true - }, + 'string': [ + { + // highlight the path of the include statement as a string + pattern: /^(#\s*include\s*)<[^>]+>/, + lookbehind: true + }, + Prism.languages.c['string'] + ], + 'comment': Prism.languages.c['comment'], // highlight macro directives as keywords 'directive': { - pattern: /(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/, + pattern: /^(#\s*)[a-z]+/, lookbehind: true, alias: 'keyword' + }, + 'directive-hash': /^#/, + 'punctuation': /##|\\(?=[\r\n])/, + 'expression': { + pattern: /\S[\s\S]*/, + inside: Prism.languages.c } } }, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-cpp.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cpp.js index 2028e8a970..9df6f8a221 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-cpp.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cpp.js @@ -1,24 +1,59 @@ define(["prism/prism","prism/components/prism-c"], function () { -Prism.languages.cpp = Prism.languages.extend('c', { - 'class-name': { - pattern: /(\b(?:class|enum|struct)\s+)\w+/, - lookbehind: true - }, - 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, - 'number': { - pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i, - greedy: true - }, - 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, - 'boolean': /\b(?:true|false)\b/ -}); +(function (Prism) { -Prism.languages.insertBefore('cpp', 'string', { - 'raw-string': { - pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, - alias: 'string', - greedy: true - } -}); + var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/; + + 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). + /\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]*/i, + greedy: true + }, + 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, + 'boolean': /\b(?:true|false)\b/ + }); + + Prism.languages.insertBefore('cpp', 'string', { + 'raw-string': { + pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, + alias: 'string', + greedy: true + } + }); + + 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*[;{])/, + lookbehind: true, + greedy: true, + inside: Prism.languages.extend('cpp', {}) + } + }); + Prism.languages.insertBefore('inside', 'operator', { + // 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)); return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-csharp.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-csharp.js index ed26c1dd3b..9161bc6cd4 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-csharp.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-csharp.js @@ -48,7 +48,7 @@ define(["prism/prism","prism/components/prism-clike"], function () { typeDeclaration: 'class enum interface struct', // contextual keywords // ("var" and "dynamic" are missing because they are used like types) - contextual: 'add alias ascending async await by descending from get global group into join let nameof notnull on orderby partial remove select set unmanaged value when where where', + contextual: 'add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where where', // all other keywords other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield' }; @@ -69,6 +69,7 @@ define(["prism/prism","prism/components/prism-clike"], function () { 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]); @@ -151,14 +152,14 @@ define(["prism/prism","prism/components/prism-clike"], function () { // 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|as)\s+)<<0>>/.source, [typeExpression]), + 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>>)<<2>>(?:\s*[=,;:{)\]]|\s+in))/.source, [typeExpression, nonContextualKeywords, name]), + pattern: re(/\b<<0>>(?=\s+(?!<<1>>)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [typeExpression, nonContextualKeywords, name]), inside: typeInside } ], @@ -270,7 +271,7 @@ define(["prism/prism","prism/components/prism-clike"], function () { // attributes var regularStringOrCharacter = regularString + '|' + character; - var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*[\s\S]*?\*\/|<<0>>/.source, [regularStringOrCharacter]); + 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 @@ -311,13 +312,13 @@ define(["prism/prism","prism/components/prism-clike"], function () { 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 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]), + pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]), lookbehind: true, inside: { 'format-string': { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-csp.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-csp.js index 89b78d77b7..c9f4d16a73 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-csp.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-csp.js @@ -12,7 +12,7 @@ define(["prism/prism"], function () { Prism.languages.csp = { 'directive': { - pattern: /\b(?:(?:base-uri|form-action|frame-ancestors|plugin-types|referrer|reflected-xss|report-to|report-uri|require-sri-for|sandbox) |(?:block-all-mixed-content|disown-opener|upgrade-insecure-requests)(?: |;)|(?:child|connect|default|font|frame|img|manifest|media|object|script|style|worker)-src )/i, + pattern: /\b(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|script|style|worker)-src|disown-opener|form-action|frame-ancestors|plugin-types|referrer|reflected-xss|report-to|report-uri|require-sri-for|sandbox|upgrade-insecure-requests)\b/i, alias: 'keyword' }, 'safe': { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-css-extras.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-css-extras.js index e9ea7f8d29..8befc522e8 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-css-extras.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-css-extras.js @@ -9,8 +9,8 @@ define(["prism/prism","prism/components/prism-css"], function () { inside: selectorInside = { 'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/, 'pseudo-class': /:[-\w]+/, - 'class': /\.[-:.\w]+/, - 'id': /#[-:.\w]+/, + 'class': /\.[-\w]+/, + 'id': /#[-\w]+/, 'attribute': { pattern: RegExp('\\[(?:[^[\\]"\']|' + string.source + ')*\\]'), greedy: true, @@ -28,11 +28,11 @@ define(["prism/prism","prism/components/prism-css"], function () { 'punctuation': /\|$/ } }, - 'attribute': { + 'attr-name': { pattern: /^(\s*)[-\w\xA0-\uFFFF]+/, lookbehind: true }, - 'value': [ + 'attr-value': [ string, { pattern: /(=\s*)[-\w\xA0-\uFFFF]+(?=\s*$)/, @@ -56,7 +56,13 @@ define(["prism/prism","prism/components/prism-css"], function () { lookbehind: true } ], - 'punctuation': /[()]/ + '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': /[(),]/, } }; @@ -70,7 +76,7 @@ define(["prism/prism","prism/components/prism-css"], function () { }); var unit = { - pattern: /(\d)(?:%|[a-z]+)/, + pattern: /(\b\d+)(?:%|[a-z]+\b)/, lookbehind: true }; // 123 -123 .123 -.123 12.3 -12.3 @@ -102,6 +108,7 @@ define(["prism/prism","prism/components/prism-css"], function () { } } ], + // it's important that there is no boundary assertion after the hex digits 'entity': /\\[\da-f]{1,8}/i, 'unit': unit, 'number': number diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-css.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-css.js index f2bf04c2a2..45c7d8a0c1 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-css.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-css.js @@ -13,16 +13,25 @@ define(["prism/prism"], function () { pattern: /(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/, lookbehind: true, alias: 'selector' + }, + 'keyword': { + pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, + lookbehind: true } // See rest below } }, 'url': { - pattern: RegExp('url\\((?:' + string.source + '|[^\n\r()]*)\\)', 'i'), + // 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': /^\(|\)$/ + 'punctuation': /^\(|\)$/, + 'string': { + pattern: RegExp('^' + string.source + '$'), + alias: 'url' + } } }, 'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'), diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-cypher.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cypher.js new file mode 100644 index 0000000000..dfa112b3c3 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-cypher.js @@ -0,0 +1,40 @@ +define(["prism/prism"], function () { +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, + alias: 'symbol' + }, + + '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(?:true|false|null)\b/i, + 'number': /\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/, + // https://neo4j.com/docs/cypher-manual/current/syntax/operators/ + 'operator': /:|<--?|--?>?|<>|=~?|[<>]=?|[+*/%^|]|\.\.\.?/, + 'punctuation': /[()[\]{},;.]/ +}; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-d.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-d.js index 93f24734fb..b9486b33b2 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-d.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-d.js @@ -10,7 +10,7 @@ Prism.languages.d = Prism.languages.extend('clike', { pattern: RegExp(/(^|[^\\])/.source + '(?:' + [ // /+ comment +/ // Allow one level of nesting - /\/\+(?:\/\+[\s\S]*?\+\/|(?!\/\+)[\s\S])*?\+\//.source, + /\/\+(?:\/\+(?:[^+]|\+(?!\/))*\+\/|(?!\/\+)[\s\S])*?\+\//.source, // // comment /\/\/.*/.source, // /* comment */ diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-dart.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-dart.js index ca296f9abc..94c70634e7 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-dart.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-dart.js @@ -12,7 +12,7 @@ Prism.languages.dart = Prism.languages.extend('clike', { ], 'keyword': [ /\b(?:async|sync|yield)\*/, - /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/ + /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extension|external|extends|factory|final|finally|for|Function|get|hide|if|implements|interface|import|in|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/ ], 'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/ }); @@ -23,4 +23,5 @@ Prism.languages.insertBefore('dart','function',{ alias: 'symbol' } }); + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-dhall.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-dhall.js new file mode 100644 index 0000000000..68ae8d0f57 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-dhall.js @@ -0,0 +1,72 @@ +define(["prism/prism"], function () { +// 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(?:Some|None)\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; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-diff.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-diff.js index 406383e2e1..fe2548a07a 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-diff.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-diff.js @@ -41,10 +41,20 @@ define(["prism/prism"], function () { } Prism.languages.diff[name] = { - // pattern: /^(?:[_].*(?:\r\n?|\n|(?![\s\S])))+/m pattern: RegExp('^(?:[' + prefix + '].*(?:\r\n?|\n|(?![\\s\\S])))+', 'm'), - alias: alias + 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 diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-docker.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-docker.js index 5e7e7d96b4..8b0a5fbd05 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-docker.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-docker.js @@ -5,7 +5,10 @@ Prism.languages.docker = { lookbehind: true }, 'string': /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/, - 'comment': /#.*/, + 'comment': { + pattern: /#.*/, + greedy: true + }, 'punctuation': /---|\.\.\.|[:[\]{}\-,|>?]/ }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ebnf.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ebnf.js index 57aecab487..a7567b60a9 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ebnf.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ebnf.js @@ -16,7 +16,7 @@ Prism.languages.ebnf = { lookbehind: true, alias: ['rule', 'keyword'] }, - 'rule': /[a-z]\w*(?:[ \t]+[a-z]\w*)*/i, + 'rule': /\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i, 'punctuation': /\([:/]|[:/]\)|[.,;()[\]{}]/, 'operator': /[-=|*/!]/ diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-editorconfig.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-editorconfig.js new file mode 100644 index 0000000000..13f8f99a7c --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-editorconfig.js @@ -0,0 +1,28 @@ +define(["prism/prism"], function () { +Prism.languages.editorconfig = { + // https://editorconfig-specification.readthedocs.io/en/latest/ + 'comment': /[;#].*/, + 'section': { + pattern: /(^[ \t]*)\[.+]/m, + lookbehind: true, + alias: 'keyword', + inside: { + 'regex': /\\\\[\[\]{},!?.*]/, // Escape special characters with '\\' + 'operator': /[!?]|\.\.|\*{1,2}/, + 'punctuation': /[\[\]{},]/ + } + }, + 'property': { + pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m, + lookbehind: true + }, + 'value': { + pattern: /=.*/, + alias: 'string', + inside: { + 'punctuation': /^=/ + } + } +}; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-eiffel.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-eiffel.js index cc2e560712..b8c6a47600 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-eiffel.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-eiffel.js @@ -14,7 +14,7 @@ Prism.languages.eiffel = { }, // Single-line string { - pattern: /"(?:%\s+%|%.|[^%"\r\n])*"/, + pattern: /"(?:%\s*\n\s*%|%.|[^%"\r\n])*"/, greedy: true } ], @@ -31,7 +31,7 @@ Prism.languages.eiffel = { // hexa | octal | bin /\b0[xcb][\da-f](?:_*[\da-f])*\b/i, // Decimal - /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/i + /(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i ], 'punctuation': /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/, 'operator': /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/ diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ejs.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ejs.js index aeb71c4f41..dac5f6b2ec 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ejs.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ejs.js @@ -22,6 +22,8 @@ define(["prism/prism","prism/components/prism-javascript","prism/components/pris Prism.languages['markup-templating'].tokenizePlaceholders(env, 'ejs'); }); + Prism.languages.eta = Prism.languages.ejs; + }(Prism)); return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-elixir.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-elixir.js index 736e1e6f9c..2ebdf37840 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-elixir.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-elixir.js @@ -9,7 +9,7 @@ Prism.languages.elixir = { '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]?/, + 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 diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-excel-formula.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-excel-formula.js index ffee8c963b..3792b708ef 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-excel-formula.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-excel-formula.js @@ -39,11 +39,11 @@ Prism.languages['excel-formula'] = { } }, 'function-name': { - pattern: /[A-Z]\w*(?=\()/i, + pattern: /\b[A-Z]\w*(?=\()/i, alias: 'keyword' }, 'range': { - pattern: /\$?(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)/i, + pattern: /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i, alias: 'property', inside: { 'operator': /:/, @@ -55,7 +55,7 @@ Prism.languages['excel-formula'] = { 'cell': { // Excel is case insensitive, so the string "foo1" could be either a variable or a cell. // To combat this, we match cells case insensitive, if the contain at least one "$", and case sensitive otherwise. - pattern: /[A-Z]+\d+|\$[A-Za-z]+\$?\d+|[A-Za-z]+\$\d+/, + 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, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ftl.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ftl.js index 3fc7f06ee2..a9d8b6b134 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ftl.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ftl.js @@ -4,11 +4,11 @@ define(["prism/prism","prism/components/prism-markup-templating"], function () { // https://freemarker.apache.org/docs/dgui_template_exp.html // FTL expression with 4 levels of nesting supported - var FTL_EXPR = /(?!<#--)[^()"']|\((?:)*\)|<#--[\s\S]*?-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/.source; + 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]'); + FTL_EXPR = FTL_EXPR.replace(//g, /[^\s\S]/.source); var ftl = { 'comment': /<#--[\s\S]*?-->/, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-glsl.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-glsl.js index c4ab498a7a..9d1a98c5c3 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-glsl.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-glsl.js @@ -1,18 +1,6 @@ -define(["prism/prism","prism/components/prism-clike"], function () { -Prism.languages.glsl = Prism.languages.extend('clike', { - 'comment': [ - /\/\*[\s\S]*?\*\//, - /\/\/(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/ - ], - 'number': /(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ulf]*/i, +define(["prism/prism","prism/components/prism-c"], function () { +Prism.languages.glsl = Prism.languages.extend('c', { 'keyword': /\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/ }); -Prism.languages.insertBefore('glsl', 'comment', { - 'preprocessor': { - pattern: /(^[ \t]*)#(?:(?:define|undef|if|ifdef|ifndef|else|elif|endif|error|pragma|extension|version|line)\b)?/m, - lookbehind: true, - alias: 'builtin' - } -}); return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-graphql.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-graphql.js index 3e498c1d47..6cfee87672 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-graphql.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-graphql.js @@ -1,8 +1,20 @@ define(["prism/prism"], function () { 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])*"/, + pattern: /"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/, greedy: true }, 'number': /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, @@ -17,7 +29,7 @@ Prism.languages.graphql = { greedy: true }, 'class-name': { - pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+)[a-zA-Z_]\w*/, + pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*)[a-zA-Z_]\w*/, lookbehind: true }, 'fragment': { @@ -25,8 +37,8 @@ Prism.languages.graphql = { lookbehind: true, alias: 'function' }, - 'keyword': /\b(?:enum|fragment|implements|input|interface|mutation|on|query|scalar|schema|type|union)\b/, - 'operator': /[!=|]|\.{3}/, + 'keyword': /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/, + 'operator': /[!=|&]|\.{3}/, 'punctuation': /[!(){}\[\]:=,]/, 'constant': /\b(?!ID\b)[A-Z][A-Z_\d]*\b/ }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-groovy.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-groovy.js index 0a5366ddc1..87ee716850 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-groovy.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-groovy.js @@ -2,7 +2,8 @@ define(["prism/prism","prism/components/prism-clike"], function () { Prism.languages.groovy = Prism.languages.extend('clike', { 'string': [ { - pattern: /("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:\$\/\$|[\s\S])*?\/\$/, + // https://groovy-lang.org/syntax.html#_dollar_slashy_string + pattern: /("""|''')(?:[^\\]|\\[\s\S])*?\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/, greedy: true }, { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-hcl.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-hcl.js index 3e7ab0a478..4412040e07 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-hcl.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-hcl.js @@ -27,9 +27,7 @@ Prism.languages.hcl = { } } }, - { - pattern: /[\w-]+(?=\s+{)/ - } + /[\w-]+(?=\s+{)/ ], 'property': [ /[\w-\.]+(?=\s*=(?!=))/, @@ -54,13 +52,13 @@ Prism.languages.hcl = { pattern: /"(?:\\[\s\S]|[^\\"])*"/, greedy: true, }, - 'number': /\b0x[\da-f]+|\d+\.?\d*(?:e[+-]?\d+)?/i, + 'number': /\b0x[\da-f]+\b|\b\d+\.?\d*(?:e[+-]?\d+)?/i, 'punctuation': /[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/, } }, } }, - 'number': /\b0x[\da-f]+|\d+\.?\d*(?:e[+-]?\d+)?/i, + 'number': /\b0x[\da-f]+\b|\b\d+\.?\d*(?:e[+-]?\d+)?/i, 'boolean': /\b(?:true|false)\b/i, 'punctuation': /[=\[\]{}]/, }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-hlsl.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-hlsl.js new file mode 100644 index 0000000000..91072b0322 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-hlsl.js @@ -0,0 +1,23 @@ +define(["prism/prism","prism/components/prism-c"], function () { +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|RasterizerState|RenderTargetView|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|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/ +}); + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-hpkp.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-hpkp.js index a1d34f5ae0..87e21c80a1 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-hpkp.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-hpkp.js @@ -11,11 +11,11 @@ Prism.languages.hpkp = { alias: 'keyword' }, 'safe': { - pattern: /\d{7,}/, + pattern: /\b\d{7,}\b/, alias: 'selector' }, 'unsafe': { - pattern: /\d{1,6}/, + pattern: /\b\d{1,6}\b/, alias: 'function' } }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-hsts.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-hsts.js index a10fe382bc..37ddd750c2 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-hsts.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-hsts.js @@ -11,11 +11,11 @@ Prism.languages.hsts = { alias: 'keyword' }, 'safe': { - pattern: /\d{8,}/, + pattern: /\b\d{8,}\b/, alias: 'selector' }, 'unsafe': { - pattern: /\d{1,7}/, + pattern: /\b\d{1,7}\b/, alias: 'function' } }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-iecst.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-iecst.js new file mode 100644 index 0000000000..92db12027a --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-iecst.js @@ -0,0 +1,33 @@ +define(["prism/prism"], function () { +Prism.languages.iecst = { + 'comment': [ + { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/, + lookbehind: true, + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true, + }, + ], + 'string': { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + }, + 'class-name': /\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:GLOBAL|INPUT|PUTPUT|IN_OUT|ACCESS|TEMP|EXTERNAL|CONFIG)|VAR|METHOD|PROPERTY)\b/i, + 'keyword': /\b(?:(?:END_)?(?:IF|WHILE|REPEAT|CASE|FOR)|ELSE|FROM|THEN|ELSIF|DO|TO|BY|PRIVATE|PUBLIC|PROTECTED|CONSTANT|RETURN|EXIT|CONTINUE|GOTO|JMP|AT|RETAIN|NON_RETAIN|TASK|WITH|UNTIL|USING|EXTENDS|IMPLEMENTS|GET|SET|__TRY|__CATCH|__FINALLY|__ENDTRY)\b/, + 'variable': /\b(?:AT|BOOL|BYTE|(?:D|L)?WORD|U?(?:S|D|L)?INT|L?REAL|TIME(?:_OF_DAY)?|TOD|DT|DATE(?:_AND_TIME)?|STRING|ARRAY|ANY|POINTER)\b/, + 'symbol': /%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/, + 'number': /\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:T|D|DT|TOD)#[\d_shmd:]*|\b[A-Z]*\#[\d.,_]*|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, + 'boolean': /\b(?:TRUE|FALSE|NULL)\b/, + 'function': /\w+(?=\()/, + 'operator': /(?:S?R?:?=>?|&&?|\*\*?|<=?|>=?|[-:^/+])|\b(?:OR|AND|MOD|NOT|XOR|LE|GE|EQ|NE|GE|LT)\b/, + 'punctuation': /[();]/, + 'type': { + 'pattern': /#/, + 'alias': 'selector', + }, +}; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ignore.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ignore.js new file mode 100644 index 0000000000..1f269a1f1d --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ignore.js @@ -0,0 +1,26 @@ +define(["prism/prism"], function () { +(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)); + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-io.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-io.js index 7791dc7cea..e44c44b257 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-io.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-io.js @@ -27,7 +27,7 @@ Prism.languages.io = { 'builtin':/\b(?:Array|AudioDevice|AudioMixer|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Regex|SGML|SGMLElement|SGMLParser|SQLite|Server|Sequence|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink|Random|BigNum|Sequence)\b/, 'boolean': /\b(?:true|false|nil)\b/, 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e-?\d+)?/i, - 'operator': /[=!*/%+-^&|]=|>>?=?|<>?=?|<+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/, alias: 'keyword' }, - 'number': /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_(?!\.))/, + 'number': /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/, 'adverb': { pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/, alias: 'builtin' @@ -24,4 +24,5 @@ Prism.languages.j = { }, 'punctuation': /[()]/ }; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-java.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-java.js index 482183eb0b..e4cba23f3e 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-java.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-java.js @@ -45,7 +45,9 @@ define(["prism/prism","prism/components/prism-clike"], function () { lookbehind: true }, 'namespace': { - pattern: /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(?:\.[a-z]\w*)+/, + pattern: 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': /\./, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-javadoc.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-javadoc.js index de1ff547e0..e3b5965d29 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-javadoc.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-javadoc.js @@ -1,54 +1,82 @@ define(["prism/prism","prism/components/prism-markup","prism/components/prism-java","prism/components/prism-javadoclike"], function () { (function (Prism) { - var codeLines = { - 'code': { - pattern: /(^(?:\s*(?:\*\s*)*)).*[^*\s].+$/m, - lookbehind: true, - inside: Prism.languages.java, - alias: 'language-java' - } - }; + var codeLinePattern = /(^(?:\s*(?:\*\s*)*)).*[^*\s].*$/m; + + var memberReference = /#\s*\w+(?:\s*\([^()]*\))?/.source; + var reference = /(?:[a-zA-Z]\w+\s*\.\s*)*[A-Z]\w*(?:\s*)?|/.source.replace(//g, function () { return memberReference }); Prism.languages.javadoc = Prism.languages.extend('javadoclike', {}); Prism.languages.insertBefore('javadoc', 'keyword', { - 'class-name': [ - { - pattern: /(@(?:exception|throws|see|link|linkplain|value)\s+(?:[a-z\d]+\.)*)[A-Z](?:\w*[a-z]\w*)?(?:\.[A-Z](?:\w*[a-z]\w*)?)*/, - lookbehind: true, - inside: { - 'punctuation': /\./ - } - }, - { - // @param the first generic type parameter - pattern: /(@param\s+)<[A-Z]\w*>/, - lookbehind: true, - inside: { - 'punctuation': /[.<>]/ - } + 'reference': { + pattern: RegExp(/(@(?:exception|throws|see|link|linkplain|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': /[#()[\],.]/ } - ], - 'namespace': { - pattern: /(@(?:exception|throws|see|link|linkplain)\s+)(?:[a-z\d]+\.)+/, + }, + 'class-name': { + // @param the first generic type parameter + pattern: /(@param\s+)<[A-Z]\w*>/, lookbehind: true, inside: { - 'punctuation': /\./ + 'punctuation': /[.<>]/ } }, 'code-section': [ { - pattern: /(\{@code\s+)(?:[^{}]|\{[^{}]*\})+?(?=\s*\})/, + pattern: /(\{@code\s+)(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+?(?=\s*\})/, lookbehind: true, - inside: codeLines + 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|tt)>\s*)[\s\S]+?(?=\s*<\/\2>)/, + pattern: /(<(code|pre|tt)>(?!)\s*)[\s\S]+?(?=\s*<\/\2>)/, lookbehind: true, - inside: codeLines + 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); diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-javascript.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-javascript.js index fac96be33d..45ff0f4299 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-javascript.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-javascript.js @@ -13,21 +13,21 @@ Prism.languages.javascript = Prism.languages.extend('clike', { lookbehind: true }, { - pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, + pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|(?:get|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 }, ], 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/, // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, - 'operator': /--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/ + 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }); Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/; Prism.languages.insertBefore('javascript', 'keyword', { 'regex': { - pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, + pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, lookbehind: true, greedy: true }, @@ -52,7 +52,7 @@ Prism.languages.insertBefore('javascript', 'keyword', { 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]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, + 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]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, lookbehind: true, inside: Prism.languages.javascript } diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-jq.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-jq.js index 610b41a6c2..5f672ea448 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-jq.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-jq.js @@ -38,12 +38,12 @@ define(["prism/prism"], function () { 'variable': /\B\$\w+/, 'property-literal': { - pattern: /[a-z_]\w*(?=\s*:(?!:))/i, + 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(?:true|false)\b/, - 'number': /(?:\b\d+\.|\B\.)?\d+(?:[eE][+-]?\d+)?\b/, + 'number': /(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/, 'operator': [ { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsdoc.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsdoc.js index fbf6cbc014..f9ba19c0f0 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsdoc.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsdoc.js @@ -1,4 +1,4 @@ -define(["prism/prism","prism/components/prism-javascript","prism/components/prism-javadoclike"], function () { +define(["prism/prism","prism/components/prism-javascript","prism/components/prism-javadoclike","prism/components/prism-typescript"], function () { (function (Prism) { var javascript = Prism.languages.javascript; @@ -41,17 +41,22 @@ define(["prism/prism","prism/components/prism-javascript","prism/components/pris }, 'class-name': [ { - pattern: RegExp('(@[a-z]+\\s+)' + type), + pattern: RegExp(/(@(?:augments|extends|class|interface|memberof!?|template|this|typedef)\s+(?:\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(//g, function () { return type; })), lookbehind: true, inside: { - 'punctuation': /[.,:?=<>|{}()[\]]/ + 'punctuation': /\./ } }, { - pattern: /(@(?:augments|extends|class|interface|memberof!?|this)\s+)[A-Z]\w*(?:\.[A-Z]\w*)*/, + pattern: RegExp('(@[a-z]+\\s+)' + type), lookbehind: true, inside: { - 'punctuation': /\./ + 'string': javascript.string, + 'number': javascript.number, + 'boolean': javascript.boolean, + 'keyword': Prism.languages.typescript.keyword, + 'operator': /=>|\.\.\.|[&|?:*]/, + 'punctuation': /[.,;=<>{}()[\]]/ } } ], diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-json.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-json.js index 58cfc2be5b..b69577de30 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-json.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-json.js @@ -1,4 +1,5 @@ define(["prism/prism"], function () { +// https://www.json.org/json-en.html Prism.languages.json = { 'property': { pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, @@ -8,8 +9,11 @@ Prism.languages.json = { pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, greedy: true }, - 'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, - 'number': /-?\d+\.?\d*(?:e[+-]?\d+)?/i, + 'comment': { + pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, + greedy: true + }, + 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, 'punctuation': /[{}[\],]/, 'operator': /:/, 'boolean': /\b(?:true|false)\b/, @@ -19,4 +23,6 @@ Prism.languages.json = { } }; +Prism.languages.webmanifest = Prism.languages.json; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-json5.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-json5.js index 8e88becf90..7931d486fe 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-json5.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-json5.js @@ -18,7 +18,7 @@ define(["prism/prism","prism/components/prism-json"], function () { pattern: string, greedy: true }, - 'number': /[+-]?(?:NaN|Infinity|0x[a-fA-F\d]+|(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?)/ + 'number': /[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+\.?\d*|\B\.\d+)(?:[eE][+-]?\d+\b)?/ }); }(Prism)); diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsstacktrace.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsstacktrace.js new file mode 100644 index 0000000000..362a1365f3 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsstacktrace.js @@ -0,0 +1,51 @@ +define(["prism/prism"], function () { +Prism.languages.jsstacktrace = { + 'error-message': { + pattern: /^\S.*/m, + alias: 'string' + }, + + 'stack-frame': { + pattern: /^[ \t]+at[ \t]+.*/m, + inside: { + 'not-my-code': { + pattern: /[ \t]+at[ \t]+(?:node\.js|\|.*(?:node_modules|\(\\)|\(\|\$|\(internal\/|\(node\.js)).*/m, + alias: 'comment' + }, + + 'filename': { + pattern: /(\bat\s+|\()(?:[a-zA-Z]:)?[^():]+(?=:)/, + lookbehind: true, + alias: 'url' + }, + + 'function': { + pattern: /(at\s+(?:new\s+)?)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/, + lookbehind: true, + inside: { + 'punctuation': /\./ + } + }, + + 'punctuation': /[()]/, + + 'keyword': /\b(?:at|new)\b/, + + 'alias': { + pattern: /\[(?:as\s+)?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/, + alias: 'variable' + }, + + 'line-number': { + pattern: /:[0-9]+(?::[0-9]+)?\b/, + alias: 'number', + inside: { + 'punctuation': /:/ + } + }, + + } + } +} + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsx.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsx.js index c3e60df7bf..2c5b9134fe 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsx.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-jsx.js @@ -4,7 +4,7 @@ define(["prism/prism","prism/components/prism-markup","prism/components/prism-ja var javascript = Prism.util.clone(Prism.languages.javascript); Prism.languages.jsx = Prism.languages.extend('markup', javascript); -Prism.languages.jsx.tag.pattern= /<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:$-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^}]*\}|[^{}])*\}|[^{}])+\}))?|\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}))*\s*\/?)?>/i; +Prism.languages.jsx.tag.pattern= /<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:$-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\s*\.{3}\s*[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\s*\}))*\s*\/?)?>/i; Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/i; Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">]+)/i; @@ -23,7 +23,7 @@ Prism.languages.insertBefore('inside', 'attr-name', { Prism.languages.insertBefore('inside', 'attr-value',{ 'script': { // Allow for two levels of nesting - pattern: /=(?:\{(?:\{(?:\{[^}]*\}|[^}])*\}|[^}])+\})/i, + pattern: /=(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/i, inside: { 'script-punctuation': { pattern: /^=(?={)/, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-julia.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-julia.js index 8ca2a73414..d0d68985c0 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-julia.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-julia.js @@ -1,16 +1,34 @@ define(["prism/prism"], function () { -Prism.languages.julia= { +Prism.languages.julia = { 'comment': { - pattern: /(^|[^\\])#.*/, + // support one level of nested comments + // https://github.com/JuliaLang/julia/pull/6128 + pattern: /(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/, lookbehind: true }, - 'string': /("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2/, - '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(?:true|false)\b/, - 'number' : /(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+\.?\d*|\.\d+)(?:[efp][+-]?\d+)?j?/i, - 'operator': /[-+*^%÷&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥]/, - 'punctuation' : /[{}[\];(),.:]/, - 'constant': /\b(?:(?:NaN|Inf)(?:16|32|64)?)\b/ + '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/#man-characters-1 + // 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]+?"""|\w*"(?:\\.|[^"\\\r\n])*"|(^|[^\w'])'(?:\\[^\r\n][^'\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(?:true|false)\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(?:(?:NaN|Inf)(?:16|32|64)?|im|pi|e|catalan|eulergamma|golden)\b|[πℯγφ]/ }; return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-kotlin.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-kotlin.js index d61dd9b73b..24d8835801 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-kotlin.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-kotlin.js @@ -60,6 +60,8 @@ define(["prism/prism","prism/components/prism-clike"], function () { interpolation: interpolation }; + Prism.languages.kt = Prism.languages.kotlin; + Prism.languages.kts = Prism.languages.kotlin; }(Prism)); return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-lilypond.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-lilypond.js index 5ca1553dbc..abaadff24d 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-lilypond.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-lilypond.js @@ -1,7 +1,7 @@ define(["prism/prism","prism/components/prism-scheme"], function () { (function (Prism) { - var schemeExpression = /\((?:[^();"#\\]|\\[\s\S]|;.*|"(?:[^"\\]|\\.)*"|#(?:\{(?:(?!#\})[\s\S])*#\}|[^{])|)*\)/.source; + 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; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-livescript.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-livescript.js index 7e7efb089a..bc9f5c8a00 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-livescript.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-livescript.js @@ -48,7 +48,7 @@ Prism.languages.livescript = { ], 'regex': [ { - pattern: /\/\/(?:\[.+?]|\\.|(?!\/\/)[^\\])+\/\/[gimyu]{0,5}/, + pattern: /\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/, greedy: true, inside: { 'comment': { @@ -58,7 +58,7 @@ Prism.languages.livescript = { } }, { - pattern: /\/(?:\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}/, + pattern: /\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/, greedy: true } ], diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-lolcode.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-lolcode.js index e746fcccab..a211a8fe88 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-lolcode.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-lolcode.js @@ -5,7 +5,7 @@ Prism.languages.lolcode = { /\bBTW.+/ ], 'string': { - pattern: /"(?::.|[^"])*"/, + pattern: /"(?::.|[^":])*"/, inside: { 'variable': /:\{[^}]+\}/, 'symbol': [ @@ -54,4 +54,5 @@ Prism.languages.lolcode = { }, 'punctuation': /\.{3}|…|,|!/ }; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-markdown.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-markdown.js index 4a19b7aed2..05474769cc 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-markdown.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-markdown.js @@ -12,19 +12,15 @@ define(["prism/prism","prism/components/prism-markup"], function () { * _Note:_ Keep in mind that this adds a capturing group. * * @param {string} pattern - * @param {boolean} starAlternative Whether to also add an alternative where all `_`s are replaced with `*`s. * @returns {RegExp} */ - function createInline(pattern, starAlternative) { + function createInline(pattern) { pattern = pattern.replace(//g, function () { return inner; }); - if (starAlternative) { - pattern = pattern + '|' + pattern.replace(/_/g, '\\*'); - } return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + '(?:' + pattern + ')'); } - var tableCell = /(?:\\.|``.+?``|`[^`\r\n]+`|[^\\|\r\n`])+/.source; + var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source; var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|$)/.source.replace(/__/g, function () { return tableCell; }); var tableLine = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source; @@ -165,7 +161,7 @@ define(["prism/prism","prism/components/prism-markup"], function () { // __strong__ // allow one nested instance of italic text using the same delimiter - pattern: createInline(/__(?:(?!_)|_(?:(?!_))+_)+__/.source, true), + pattern: createInline(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source), lookbehind: true, greedy: true, inside: { @@ -182,7 +178,7 @@ define(["prism/prism","prism/components/prism-markup"], function () { // _em_ // allow one nested instance of bold text using the same delimiter - pattern: createInline(/_(?:(?!_)|__(?:(?!_))+__)+_/.source, true), + pattern: createInline(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source), lookbehind: true, greedy: true, inside: { @@ -197,7 +193,7 @@ define(["prism/prism","prism/components/prism-markup"], function () { 'strike': { // ~~strike through~~ // ~strike~ - pattern: createInline(/(~~?)(?:(?!~))+?\2/.source, false), + pattern: createInline(/(~~?)(?:(?!~))+?\2/.source), lookbehind: true, greedy: true, inside: { @@ -213,7 +209,7 @@ define(["prism/prism","prism/components/prism-markup"], function () { // [example](http://example.com "Optional title") // [example][id] // [example] [id] - pattern: createInline(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[(?:(?!\]))+\])/.source, false), + pattern: createInline(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[(?:(?!\]))+\])/.source), lookbehind: true, greedy: true, inside: { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-markup.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-markup.js index e1c955878c..ee720120d2 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-markup.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-markup.js @@ -3,30 +3,46 @@ Prism.languages.markup = { 'comment': //, 'prolog': /<\?[\s\S]+?\?>/, 'doctype': { - pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i, - greedy: true + // 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/, + 'name': /[^\s<>'"]+/ + } }, 'cdata': //i, 'tag': { - pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i, + pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: true, inside: { 'tag': { - pattern: /^<\/?[^\s>\/]+/i, + pattern: /^<\/?[^\s>\/]+/, inside: { 'punctuation': /^<\/?/, 'namespace': /^[^\s>\/:]+:/ } }, 'attr-value': { - pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i, + pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { 'punctuation': [ - /^=/, { - pattern: /^(\s*)["']|["']$/, - lookbehind: true - } + pattern: /^=/, + alias: 'attr-equals' + }, + /"|'/ ] } }, @@ -40,14 +56,21 @@ Prism.languages.markup = { } }, - 'entity': /&#?[\da-z]{1,8};/i + '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) { +Prism.hooks.add('wrap', function (env) { if (env.type === 'entity') { env.attributes['title'] = env.content.replace(/&/, '&'); @@ -88,7 +111,7 @@ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { var def = {}; def[tagName] = { - pattern: RegExp(/(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'), + pattern: RegExp(/(<__[\s\S]*?>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function () { return tagName; }), 'i'), lookbehind: true, greedy: true, inside: inside @@ -98,9 +121,13 @@ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { } }); -Prism.languages.xml = Prism.languages.extend('markup', {}); Prism.languages.html = Prism.languages.markup; Prism.languages.mathml = Prism.languages.markup; Prism.languages.svg = Prism.languages.markup; +Prism.languages.xml = Prism.languages.extend('markup', {}); +Prism.languages.ssml = Prism.languages.xml; +Prism.languages.atom = Prism.languages.xml; +Prism.languages.rss = Prism.languages.xml; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-neon.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-neon.js index 461131c720..7603bf03e5 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-neon.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-neon.js @@ -28,7 +28,7 @@ Prism.languages.neon = { alias: 'keyword' }, 'string': { - pattern: /(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^"\r\n])*")/, + pattern: /(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/, lookbehind: true, greedy: true }, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-objectivec.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-objectivec.js index 5e7110022c..1ea46e28fc 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-objectivec.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-objectivec.js @@ -7,4 +7,5 @@ Prism.languages.objectivec = Prism.languages.extend('c', { delete Prism.languages.objectivec['class-name']; +Prism.languages.objc = Prism.languages.objectivec; return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ocaml.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ocaml.js index 6b68af363c..af62b0b81e 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ocaml.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ocaml.js @@ -38,6 +38,7 @@ Prism.languages.ocaml = { 'boolean': /\b(?:false|true)\b/, // Custom operators are allowed 'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/, - 'punctuation': /[(){}\[\]|_.,:;]/ + 'punctuation': /[(){}\[\]|.,:;]|\b_\b/ }; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-oz.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-oz.js index 734a15bcf2..b0ef230643 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-oz.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-oz.js @@ -10,18 +10,19 @@ Prism.languages.oz = { greedy: true, alias: 'builtin' }, - 'keyword': /[$_]|\[\]|\b(?:at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/, + 'keyword': /\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/, 'function': [ - /[a-z][A-Za-z\d]*(?=\()/, + /\b[a-z][A-Za-z\d]*(?=\()/, { - pattern: /(\{)[A-Z][A-Za-z\d]*/, + pattern: /(\{)[A-Z][A-Za-z\d]*\b/, lookbehind: true } ], - 'number': /\b(?:0[bx][\da-f]+|\d+\.?\d*(?:e~?\d+)?\b)|&(?:[^\\]|\\(?:\d{3}|.))/i, + 'number': /\b(?:0[bx][\da-f]+|\d+\.?\d*(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i, 'variable': /\b[A-Z][A-Za-z\d]*|`(?:[^`\\]|\\.)+`/, 'attr-name': /\w+(?=:)/, 'operator': /:(?:=|::?)|<[-:=]?|=(?:=|=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/, 'punctuation': /[\[\](){}.:;?]/ }; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-parigp.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-parigp.js index 9d55b63c1a..766d45054d 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-parigp.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-parigp.js @@ -23,10 +23,11 @@ Prism.languages.parigp = { 'function': /\w[\w ]*?(?= *\()/, 'number': { // The lookbehind and the negative lookahead prevent from breaking the .. operator - pattern: /((?:\. *\. *)?)(?:\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *[+-]? *\d(?: *\d)*)?/i, + pattern: /((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *[+-]? *\d(?: *\d)*)?/i, lookbehind: true }, 'operator': /\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?:(?: *<)?(?: *=)?| *>)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/, 'punctuation': /[\[\]{}().,:;|]/ }; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-pascal.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-pascal.js index a9988e66c6..1c8cf75e8b 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-pascal.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-pascal.js @@ -12,7 +12,7 @@ Prism.languages.pascal = { /\/\/.*/ ], 'string': { - pattern: /(?:'(?:''|[^'\r\n])*'|#[&$%]?[a-f\d]+)+|\^[a-z]/i, + pattern: /(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i, greedy: true }, 'keyword': [ @@ -54,4 +54,5 @@ Prism.languages.pascal = { }; Prism.languages.objectpascal = Prism.languages.pascal; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-peoplecode.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-peoplecode.js new file mode 100644 index 0000000000..88ee086009 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-peoplecode.js @@ -0,0 +1,45 @@ +define(["prism/prism"], function () { +Prism.languages.peoplecode = { + 'comment': RegExp([ + // C-style multiline comments + /\/\*[\s\S]*?\*\//.source, + // REM comments + /\bREM[^;]*;/.source, + // Nested <* *> comments + /<\*(?:[^<*]|\*(?!>)|<(?!\*)|<\*(?:(?!\*>)[\s\S])*\*>)*\*>/.source, + // /+ +/ comments + /\/\+[\s\S]*?\+\//.source, + ].join("|")), + 'string': { + pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/, + greedy: true + }, + 'variable': /%\w+/, + 'function-definition': { + pattern: /((?:^|[^\w-])(?:function|method)\s+)\w+/i, + lookbehind: true, + alias: 'function' + }, + 'class-name': { + pattern: /((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i, + lookbehind: true, + inside: { + 'punctuation': /:/ + } + }, + 'keyword': /\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|implements|import|instance|if|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i, + 'operator-keyword': { + pattern: /\b(?:and|not|or)\b/i, + alias: 'operator' + }, + 'function': /[_a-z]\w*(?=\s*\()/i, + + 'boolean': /\b(?:false|true)\b/i, + 'number': /\b\d+(?:\.\d+)?\b/, + 'operator': /<>|[<>]=?|!=|\*\*|[-+*/|=@]/, + 'punctuation': /[:.;,()[\]]/ +}; + +Prism.languages.pcode = Prism.languages.peoplecode; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-php.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-php.js index 5e8c995570..ab4210b162 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-php.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-php.js @@ -63,14 +63,14 @@ define(["prism/prism","prism/components/prism-clike","prism/components/prism-mar }); var string_interpolation = { - pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/, + pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/, lookbehind: true, inside: Prism.languages.php }; Prism.languages.insertBefore('php', 'string', { 'nowdoc-string': { - pattern: /<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/, + pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/, greedy: true, alias: 'string', inside: { @@ -84,7 +84,7 @@ define(["prism/prism","prism/components/prism-clike","prism/components/prism-mar } }, 'heredoc-string': { - pattern: /<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i, + pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i, greedy: true, alias: 'string', inside: { diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-powershell.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-powershell.js index 3de38ffa7a..5571e0a529 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-powershell.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-powershell.js @@ -19,7 +19,7 @@ define(["prism/prism"], function () { inside: { 'function': { // Allow for one level of nesting - pattern: /(^|[^`])\$\((?:\$\(.*?\)|(?!\$\()[^\r\n)])*\)/, + pattern: /(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/, lookbehind: true, // Populated at end of file inside: {} @@ -35,12 +35,12 @@ define(["prism/prism"], function () { // Supports two levels of nested brackets (e.g. `[OutputType([System.Collections.Generic.List[int]])]`) 'namespace': /\[[a-z](?:\[(?:\[[^\]]*]|[^\[\]])*]|[^\[\]])*]/i, 'boolean': /\$(?:true|false)\b/i, - 'variable': /\$\w+\b/i, + 'variable': /\$\w+\b/, // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example // Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" } // Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" } 'function': [ - /\b(?:Add-(?:Computer|Content|History|Member|PSSnapin|Type)|Checkpoint-Computer|Clear-(?:Content|EventLog|History|Item|ItemProperty|Variable)|Compare-Object|Complete-Transaction|Connect-PSSession|ConvertFrom-(?:Csv|Json|StringData)|Convert-Path|ConvertTo-(?:Csv|Html|Json|Xml)|Copy-(?:Item|ItemProperty)|Debug-Process|Disable-(?:ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Disconnect-PSSession|Enable-(?:ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)|Enter-PSSession|Exit-PSSession|Export-(?:Alias|Clixml|Console|Csv|FormatData|ModuleMember|PSSession)|ForEach-Object|Format-(?:Custom|List|Table|Wide)|Get-(?:Alias|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Culture|Date|Event|EventLog|EventSubscriber|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|WmiObject)|Group-Object|Import-(?:Alias|Clixml|Csv|LocalizedData|Module|PSSession)|Invoke-(?:Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)|Join-Path|Limit-EventLog|Measure-(?:Command|Object)|Move-(?:Item|ItemProperty)|New-(?:Alias|Event|EventLog|Item|ItemProperty|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy)|Out-(?:Default|File|GridView|Host|Null|Printer|String)|Pop-Location|Push-Location|Read-Host|Receive-(?:Job|PSSession)|Register-(?:EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)|Remove-(?:Computer|Event|EventLog|Item|ItemProperty|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)|Rename-(?:Computer|Item|ItemProperty)|Reset-ComputerMachinePassword|Resolve-Path|Restart-(?:Computer|Service)|Restore-Computer|Resume-(?:Job|Service)|Save-Help|Select-(?:Object|String|Xml)|Send-MailMessage|Set-(?:Alias|Content|Date|Item|ItemProperty|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)|Show-(?:Command|ControlPanelItem|EventLog)|Sort-Object|Split-Path|Start-(?:Job|Process|Service|Sleep|Transaction)|Stop-(?:Computer|Job|Process|Service)|Suspend-(?:Job|Service)|Tee-Object|Test-(?:ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)|Trace-Command|Unblock-File|Undo-Transaction|Unregister-(?:Event|PSSessionConfiguration)|Update-(?:FormatData|Help|List|TypeData)|Use-Transaction|Wait-(?:Event|Job|Process)|Where-Object|Write-(?:Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning))\b/i, + /\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i, /\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i ], // per http://technet.microsoft.com/en-us/library/hh847744.aspx diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-protobuf.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-protobuf.js index 6538d36325..1ee4726888 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-protobuf.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-protobuf.js @@ -4,16 +4,23 @@ define(["prism/prism","prism/components/prism-clike"], function () { var builtinTypes = /\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/; Prism.languages.protobuf = Prism.languages.extend('clike', { - 'class-name': { - pattern: /(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/, - lookbehind: true - }, - 'keyword': /\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|service|syntax|to)\b/ + 'class-name': [ + { + pattern: /(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/, + lookbehind: true + }, + { + pattern: /(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/, + lookbehind: true + } + ], + 'keyword': /\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/, + 'function': /[a-z_]\w*(?=\s*\()/i }); Prism.languages.insertBefore('protobuf', 'operator', { 'map': { - pattern: /\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[A-Za-z_]\w*\s*[=;])/, + pattern: /\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i, alias: 'class-name', inside: { 'punctuation': /[<>.,]/, @@ -22,14 +29,14 @@ define(["prism/prism","prism/components/prism-clike"], function () { }, 'builtin': builtinTypes, 'positional-class-name': { - pattern: /(?:\b|\B\.)[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s+[A-Za-z_]\w*\s*[=;])/, + pattern: /(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i, alias: 'class-name', inside: { 'punctuation': /\./ } }, 'annotation': { - pattern: /(\[\s*)[A-Za-z_]\w*(?=\s*=)/, + pattern: /(\[\s*)[a-z_]\w*(?=\s*=)/i, lookbehind: true } }); diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-pug.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-pug.js index db728fdfe0..da580262fb 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-pug.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-pug.js @@ -131,7 +131,9 @@ define(["prism/prism","prism/components/prism-markup","prism/components/prism-ja } } ], - 'punctuation': /:/ + 'punctuation': /:/, + 'attr-id': /#[\w\-]+/, + 'attr-class': /\.[\w\-]+/ } }, 'code': [ diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-pure.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-pure.js index 76f13d32d1..40d5cb06d7 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-pure.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-pure.js @@ -1,5 +1,7 @@ define(["prism/prism"], function () { (function (Prism) { + // https://agraef.github.io/pure-docs/pure.html#lexical-matters + Prism.languages.pure = { 'comment': [ { @@ -43,7 +45,7 @@ define(["prism/prism"], function () { alias: 'builtin' }, // Any combination of operator chars can be an operator - 'operator': /(?=\b_|[^_])[!"#$%&'*+,\-.\/:<=>?@\\^_`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]+|\b(?:and|div|mod|not|or)\b/, + 'operator': /(?:[!"#$%&'*+,\-.\/:<=>?@\\^`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]|\b_+\b)+|\b(?:and|div|mod|not|or)\b/, // FIXME: How can we prevent | and , to be highlighted as operator when they are used alone? 'punctuation': /[(){}\[\];,|]/ }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-purebasic.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-purebasic.js new file mode 100644 index 0000000000..a77fa0ebd3 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-purebasic.js @@ -0,0 +1,73 @@ +define(["prism/prism","prism/components/prism-clike"], function () { +/* +Original Code by Bas Groothedde +!!MANY THANKS!! I never would have made this, regex and me will never be best friends ;) +==> https://codepen.io/ImagineProgramming/details/JYydBy/ +slightly changed to pass all tests +*/ + + +// PureBasic support, steal stuff from ansi-c +Prism.languages.purebasic = Prism.languages.extend('clike', { + 'comment': /;.*/, + 'keyword': /\b(?:declarecdll|declaredll|compilerselect|compilercase|compilerdefault|compilerendselect|compilererror|enableexplicit|disableexplicit|not|and|or|xor|calldebugger|debuglevel|enabledebugger|disabledebugger|restore|read|includepath|includebinary|threaded|runtime|with|endwith|structureunion|endstructureunion|align|newlist|newmap|interface|endinterface|extends|enumeration|endenumeration|swap|foreach|continue|fakereturn|goto|gosub|return|break|module|endmodule|declaremodule|enddeclaremodule|declare|declarec|prototype|prototypec|enableasm|disableasm|dim|redim|data|datasection|enddatasection|to|procedurereturn|debug|default|case|select|endselect|as|import|endimport|importc|compilerif|compilerelse|compilerendif|compilerelseif|end|structure|endstructure|while|wend|for|next|step|if|else|elseif|endif|repeat|until|procedure|proceduredll|procedurec|procedurecdll|endprocedure|protected|shared|static|global|define|includefile|xincludefile|macro|endmacro)\b/i, + 'function': /\b\w+(?:\.\w+)?\s*(?=\()/, + 'number': /(?:\$[\da-f]+|\b-?\d*\.?\d+(?:e[+-]?\d+)?)\b/i, + 'operator': /(?:@\*?|\?|\*)\w+|-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*/@]/ +}); + +Prism.languages.insertBefore('purebasic', 'keyword', { + 'tag': /#\w+/, + 'asm': { + pattern: /(^\s*)!.*/m, + lookbehind: true, + alias: 'tag', + inside: { + 'comment': /;.*/, + 'string': { + pattern: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + // Anonymous label references, i.e.: jmp @b + 'label-reference-anonymous': { + pattern: /(\s*!\s*j[a-z]+\s+)@[fb]/i, + lookbehind: true, + alias: 'fasm-label' + }, + // Named label reference, i.e.: jne label1 + 'label-reference-addressed': { + pattern: /(\s*!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i, + lookbehind: true, + alias: 'fasm-label' + }, + 'function': { + pattern: /^(\s*!\s*)[\da-z]+(?=\s|$)/im, + lookbehind: true + }, + 'function-inline': { + pattern: /(\s*:\s*)[\da-z]+(?=\s)/i, + lookbehind: true, + alias: 'function' + }, + 'label': { + pattern: /^(\s*!\s*)[A-Za-z._?$@][\w.?$@~#]*(?=:)/m, + lookbehind: true, + alias: 'fasm-label' + }, + 'keyword': [ + /(?:extern|extern|global)[^;\r\n]*/i, + /(?:CPU|FLOAT|DEFAULT).*/ + ], + 'register': /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|sp|si|di)|[cdefgs]s|mm\d+)\b/i, + 'number': /(?:\b|-|(?=\$))(?:0[hx][\da-f]*\.?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(?:\.?e[+-]?\d+)?[dt]?)\b/i, + 'operator': /[\[\]*+\-/%<>=&|$!,.:]/ + } + } +}); + +delete Prism.languages.purebasic['class-name']; +delete Prism.languages.purebasic['boolean']; + +Prism.languages.pbfasm = Prism.languages['purebasic']; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-python.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-python.js index 13ac07d5ca..1f2edbe3e1 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-python.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-python.js @@ -5,7 +5,7 @@ Prism.languages.python = { lookbehind: true }, 'string-interpolation': { - pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, + pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, greedy: true, inside: { 'interpolation': { @@ -28,7 +28,7 @@ Prism.languages.python = { } }, 'triple-quoted-string': { - pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i, + pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i, greedy: true, alias: 'string' }, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-q.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-q.js index 7bde867262..1bb2151ca8 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-q.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-q.js @@ -45,9 +45,10 @@ Prism.languages.q = { alias: 'function' }, 'verb': { - pattern: /(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?_~=|$&#@^]):?/, + pattern: /(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?~=|$&#@^]):?|\b_\b:?/, alias: 'operator' }, 'punctuation': /[(){}\[\];.]/ }; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-qml.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-qml.js index 0870499ddd..41ea1cf9f3 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-qml.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-qml.js @@ -2,7 +2,7 @@ define(["prism/prism","prism/components/prism-javascript"], function () { (function (Prism) { var jsString = /"(?:\\.|[^\\"\r\n])*"|'(?:\\.|[^\\'\r\n])*'/.source; - var jsComment = /\/\/.*|\/\*(?:(?!\*\/)[\s\S])*\*\//.source; + var jsComment = /\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\//.source; var jsExpr = /(?:[^\\()[\]{}"'/]||\/(?![*/])||\(*\)|\[*\]|\{*\}|\\[\s\S])/ .source.replace(//g, function () { return jsString; }).replace(//g, function () { return jsComment; }); diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-racket.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-racket.js new file mode 100644 index 0000000000..28d97fcf97 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-racket.js @@ -0,0 +1,68 @@ +define(["prism/prism","prism/components/prism-scheme"], function () { +Prism.languages.racket = Prism.languages.extend('scheme', { + 'lambda-parameter': { + // the racket lambda syntax is a lot more complex, so we won't even attempt to capture it. + // this will just prevent false positives of the `function` pattern + pattern: /(\(lambda\s+\()[^()'\s]+/, + lookbehind: true + } +}); + +// Add brackets to racket +// The basic idea here is to go through all pattens of Scheme and replace all occurrences of "(" with the union of "(" +// and "["; Similar for ")". This is a bit tricky because "(" can be escaped or inside a character set. Both cases +// have to be handled differently and, of course, we don't want to destroy groups, so we can only replace literal "(" +// and ")". +// To do this, we use a regular expression which will parse any JS regular expression. It works because regexes are +// matches from left to right and already matched text cannot be matched again. We use this to first capture all +// escaped characters (not really, we don't get escape sequences but we don't need them). Because we already captured +// all escaped characters, we know that any "[" character is the start of a character set, so we match that character +// set whole. +// With the regex parsed, we only have to replace all escaped "(" (they cannot be unescaped outside of character sets) +// with /[([]/ and replace all "(" inside character sets. +// Note: This method does not work for "(" that are escaped like this /\x28/ or this /\u0028/. +Prism.languages.DFS(Prism.languages.racket, function (key, value) { + if (Prism.util.type(value) === 'RegExp') { + var source = value.source.replace(/\\(.)|\[\^?((?:\\.|[^\\\]])*)\]/g, function (m, g1, g2) { + if (g1) { + if (g1 === '(') { + // replace all '(' characters outside character sets + return '[([]'; + } + if (g1 === ')') { + // replace all ')' characters outside character sets + return '[)\\]]'; + } + } + if (g2) { + var prefix = m[1] === '^' ? '[^' : '['; + return prefix + g2.replace(/\\(.)|[()]/g, function (m, g1) { + if (m === '(' || g1 === '(') { + // replace all '(' characters inside character sets + return '(['; + } + if (m === ')' || g1 === ')') { + // replace all ')' characters inside character sets + return ')\\]'; + } + return m; + }) + ']'; + } + return m; + }); + + this[key] = RegExp(source, value.flags); + } +}); + +Prism.languages.insertBefore('racket', 'string', { + 'lang': { + pattern: /^#lang.+/m, + greedy: true, + alias: 'keyword' + } +}); + +Prism.languages.rkt = Prism.languages.racket; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-regex.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-regex.js index 6bcc3b41f0..5316baf6f4 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-regex.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-regex.js @@ -5,8 +5,15 @@ define(["prism/prism"], function () { pattern: /\\[\\(){}[\]^$+*?|.]/, alias: 'escape' }; - var escape = /\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|c[a-zA-Z]|0[0-7]{0,2}|[123][0-7]{2}|.)/ - var charClass = /\\[wsd]|\.|\\p{[^{}]+}/i + var escape = /\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|c[a-zA-Z]|0[0-7]{0,2}|[123][0-7]{2}|.)/; + var charClass = { + pattern: /\.|\\[wsd]|\\p{[^{}]+}/i, + alias: 'class-name' + }; + var charClassWithoutDot = { + pattern: /\\[wsd]|\\p{[^{}]+}/i, + alias: 'class-name' + }; var rangeChar = '(?:[^\\\\-]|' + escape.source + ')'; var range = RegExp(rangeChar + '-' + rangeChar); @@ -18,16 +25,6 @@ define(["prism/prism"], function () { alias: 'variable' }; - var backreference = [ - /\\(?![123][0-7]{2})[1-9]/, // a backreference which is not an octal escape - { - pattern: /\\k<[^<>']+>/, - inside: { - 'group-name': groupName - } - } - ]; - Prism.languages.regex = { 'charset': { pattern: /((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/, @@ -36,25 +33,47 @@ define(["prism/prism"], function () { 'charset-negation': { pattern: /(^\[)\^/, lookbehind: true, + alias: 'operator' + }, + 'charset-punctuation': { + pattern: /^\[|\]$/, + alias: 'punctuation' }, - 'charset-punctuation': /^\[|\]$/, 'range': { pattern: range, inside: { 'escape': escape, - 'range-punctuation': /-/ + 'range-punctuation': { + pattern: /-/, + alias: 'operator' + } } }, 'special-escape': specialEscape, - 'charclass': charClass, - 'backreference': backreference, + 'charclass': charClassWithoutDot, 'escape': escape } }, 'special-escape': specialEscape, 'charclass': charClass, - 'backreference': backreference, - 'anchor': /[$^]|\\[ABbGZz]/, + 'backreference': [ + { + // a backreference which is not an octal escape + pattern: /\\(?![123][0-7]{2})[1-9]/, + alias: 'keyword' + }, + { + pattern: /\\k<[^<>']+>/, + alias: 'keyword', + inside: { + 'group-name': groupName + } + } + ], + 'anchor': { + pattern: /[$^]|\\[ABbGZz]/, + alias: 'function' + }, 'escape': escape, 'group': [ { @@ -63,14 +82,24 @@ define(["prism/prism"], function () { // (), (?), (?'name'), (?>), (?:), (?=), (?!), (?<=), (?']+>|'[^<>']+'|[>:]|\[\]{}]\b/, 'regex': { - pattern: /(^|[^/])\/(?!\/)(?:\[.+?]|\\.|[^/\\\r\n])+\/(?=\s*(?:$|[\r\n,.;})]))/, + pattern: /(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/, lookbehind: true, greedy: true }, @@ -25,7 +25,7 @@ Prism.languages.rip = { pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, greedy: true }, - 'number': /[+-]?(?:(?:\d+\.\d+)|(?:\d+))/, + 'number': /[+-]?\b(?:\d+\.\d+|\d+)\b/, 'punctuation': /(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-robotframework.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-robotframework.js index 4832913de3..99828dc91a 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-robotframework.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-robotframework.js @@ -47,7 +47,7 @@ define(["prism/prism"], function () { var docTag = { - pattern: /(\[Documentation\](?: |\t)[ \t]*)(?![ \t]|#)(?:.|[ \t]*(?:\r\n?|\n)[ \t]*\.{3}[ \t]*)+/, + pattern: /(\[Documentation\](?: |\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/, lookbehind: true, alias: 'string' }; @@ -72,7 +72,7 @@ define(["prism/prism"], function () { Prism.languages['robotframework'] = { 'settings': createSection('Settings', { 'documentation': { - pattern: /([\r\n] ?Documentation(?: |\t)[ \t]*)(?![ \t]|#)(?:.|[ \t]*(?:\r\n?|\n)[ \t]*\.{3}[ \t]*)+/, + pattern: /([\r\n] ?Documentation(?: |\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/, lookbehind: true, alias: 'string' }, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ruby.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ruby.js index ab04e5b027..b9072c0a73 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-ruby.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-ruby.js @@ -40,36 +40,14 @@ define(["prism/prism","prism/components/prism-clike"], function () { Prism.languages.insertBefore('ruby', 'keyword', { 'regex': [ { - pattern: /%r([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/, - greedy: true, - inside: { - 'interpolation': interpolation - } - }, - { - pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/, - greedy: true, - inside: { - 'interpolation': interpolation - } - }, - { - // Here we need to specifically allow interpolation - pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/, - greedy: true, - inside: { - 'interpolation': interpolation - } - }, - { - pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/, - greedy: true, - inside: { - 'interpolation': interpolation - } - }, - { - pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/, + pattern: RegExp(/%r/.source + '(?:' + [ + /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/.source, + /\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/.source, + // Here we need to specifically allow interpolation + /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/.source, + /\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/.source, + /<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/.source + ].join('|') + ')'), greedy: true, inside: { 'interpolation': interpolation @@ -103,36 +81,14 @@ define(["prism/prism","prism/components/prism-clike"], function () { Prism.languages.ruby.string = [ { - pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/, - greedy: true, - inside: { - 'interpolation': interpolation - } - }, - { - pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/, - greedy: true, - inside: { - 'interpolation': interpolation - } - }, - { - // Here we need to specifically allow interpolation - pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/, - greedy: true, - inside: { - 'interpolation': interpolation - } - }, - { - pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/, - greedy: true, - inside: { - 'interpolation': interpolation - } - }, - { - pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/, + pattern: RegExp(/%[qQiIwWxs]?/.source + '(?:' + [ + /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source, + /\((?:[^()\\]|\\[\s\S])*\)/.source, + // Here we need to specifically allow interpolation + /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source, + /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source, + /<(?:[^<>\\]|\\[\s\S])*>/.source + ].join('|') + ')'), greedy: true, inside: { 'interpolation': interpolation diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-rust.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-rust.js index aa9e796c83..c4238f3b86 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-rust.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-rust.js @@ -1,71 +1,132 @@ define(["prism/prism"], function () { -/* TODO - Add support for Markdown notation inside doc comments - Add support for nested block comments... - Match closure params even when not followed by dash or brace - Add better support for macro definition -*/ +(function (Prism) { -Prism.languages.rust = { - 'comment': [ - { - pattern: /(^|[^\\])\/\*[\s\S]*?\*\//, - lookbehind: true - }, - { - pattern: /(^|[^\\:])\/\/.*/, - lookbehind: true - } - ], - 'string': [ - { - pattern: /b?r(#*)"(?:\\.|(?!"\1)[^\\\r\n])*"\1/, + var multilineComment = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source; + for (var i = 0; i < 2; i++) { + // support 4 levels of nested comments + multilineComment = multilineComment.replace(//g, function () { return multilineComment; }); + } + multilineComment = multilineComment.replace(//g, function () { return /[^\s\S]/.source; }); + + + Prism.languages.rust = { + 'comment': [ + { + pattern: RegExp(/(^|[^\\])/.source + multilineComment), + lookbehind: true, + greedy: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true + } + ], + 'string': { + pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/, greedy: true }, - { - pattern: /b?"(?:\\.|[^\\\r\n"])*"/, - greedy: true - } - ], - 'char': { - pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u{(?:[\da-fA-F]_*){1,6}|.)|[^\\\r\n\t'])'/, - alias: 'string' - }, - 'lifetime-annotation': { - pattern: /'[^\s>']+/, - alias: 'symbol' - }, - 'keyword': /\b(?:abstract|alignof|as|async|await|be|box|break|const|continue|crate|do|dyn|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|offsetof|once|override|priv|pub|pure|ref|return|sizeof|static|self|Self|struct|super|true|trait|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/, + 'char': { + pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u{(?:[\da-fA-F]_*){1,6}|.)|[^\\\r\n\t'])'/, + greedy: true, + alias: 'string' + }, + 'attribute': { + pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/, + greedy: true, + alias: 'attr-name', + inside: { + 'string': null // see below + } + }, + + // Closure params should not be confused with bitwise OR | + 'closure-params': { + pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/, + lookbehind: true, + greedy: true, + inside: { + 'closure-punctuation': { + pattern: /^\||\|$/, + alias: 'punctuation' + }, + rest: null // see below + } + }, + + 'lifetime-annotation': { + pattern: /'\w+/, + alias: 'symbol' + }, + + 'fragment-specifier': { + pattern: /(\$\w+:)[a-z]+/, + lookbehind: true, + alias: 'punctuation' + }, + 'variable': /\$\w+/, - 'attribute': { - pattern: /#!?\[.+?\]/, - greedy: true, - alias: 'attr-name' - }, + 'function-definition': { + pattern: /(\bfn\s+)\w+/, + lookbehind: true, + alias: 'function' + }, + 'type-definition': { + pattern: /(\b(?:enum|struct|union)\s+)\w+/, + lookbehind: true, + alias: 'class-name' + }, + 'module-declaration': [ + { + pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/, + lookbehind: true, + alias: 'namespace' + }, + { + pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/, + lookbehind: true, + alias: 'namespace', + inside: { + 'punctuation': /::/ + } + } + ], + 'keyword': [ + // https://github.com/rust-lang/reference/blob/master/src/keywords.md + /\b(?:abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|Self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/, + // primitives and str + // https://doc.rust-lang.org/stable/rust-by-example/primitives.html + /\b(?:[ui](?:8|16|32|64|128|size)|f(?:32|64)|bool|char|str)\b/ + ], + + // functions can technically start with an upper-case letter, but this will introduce a lot of false positives + // and Rust's naming conventions recommend snake_case anyway. + // https://doc.rust-lang.org/1.0.0/style/style/naming/README.html + 'function': /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/, + 'macro': { + pattern: /\w+!/, + alias: 'property' + }, + 'constant': /\b[A-Z_][A-Z_\d]+\b/, + 'class-name': /\b[A-Z]\w*\b/, + + 'namespace': { + pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/, + inside: { + 'punctuation': /::/ + } + }, - 'function': [ - /\w+(?=\s*\()/, - // Macros can use parens or brackets - /\w+!(?=\s*\(|\[)/ - ], - 'macro-rules': { - pattern: /\w+!/, - alias: 'function' - }, + // Hex, oct, bin, dec numbers with visual separators and type suffix + 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64|size)?|f32|f64))?\b/, + 'boolean': /\b(?:false|true)\b/, + 'punctuation': /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/, + 'operator': /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/ + }; - // Hex, oct, bin, dec numbers with visual separators and type suffix - 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/, + Prism.languages.rust['closure-params'].inside.rest = Prism.languages.rust; + Prism.languages.rust['attribute'].inside['string'] = Prism.languages.rust['string']; - // Closure params should not be confused with bitwise OR | - 'closure-params': { - pattern: /\|[^|]*\|(?=\s*[{-])/, - inside: { - 'punctuation': /[|:,]/, - 'operator': /[&*]/ - } - }, - 'punctuation': /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/, - 'operator': /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/ -}; +}(Prism)); return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-sas.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-sas.js index 7552902d5a..426346a7bc 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-sas.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-sas.js @@ -9,6 +9,16 @@ define(["prism/prism"], function () { alias: 'number' }; + var macroVariable = { + pattern: /&[a-z_][a-z_0-9]*/i + }; + + var macroKeyword = { + pattern: /((?:^|\s|=|\())%(?:ABORT|BY|CMS|COPY|DISPLAY|DO|ELSE|END|EVAL|GLOBAL|GO|GOTO|IF|INC|INCLUDE|INDEX|INPUT|KTRIM|LENGTH|LET|LIST|LOCAL|PUT|QKTRIM|QSCAN|QSUBSTR|QSYSFUNC|QUPCASE|RETURN|RUN|SCAN|SUBSTR|SUPERQ|SYMDEL|SYMGLOBL|SYMLOCAL|SYMEXIST|SYSCALL|SYSEVALF|SYSEXEC|SYSFUNC|SYSGET|SYSRPUT|THEN|TO|TSO|UNQUOTE|UNTIL|UPCASE|WHILE|WINDOW)\b/i, + lookbehind: true, + alias: 'keyword' + }; + var step = { pattern: /(^|\s+)(?:proc\s+\w+|quit|run|data(?!\=))\b/i, alias: 'keyword', @@ -42,10 +52,7 @@ define(["prism/prism"], function () { lookbehind: true }, 'operator': /=/, - 'macro-variable': { - pattern: /&[^\.]*\./i, - alias: 'string' - }, + 'macro-variable': macroVariable, 'arg': { pattern: /[A-Z]+/i, alias: 'keyword' @@ -102,10 +109,10 @@ define(["prism/prism"], function () { pattern: /(?:action)/i, alias: 'keyword' }, + 'comment': comment, 'function': func, 'arg-value': args['arg-value'], 'operator': args.operator, - 'comment': comment, 'argument': args.arg, 'number': number, 'numeric-constant': numericConstant, @@ -155,15 +162,17 @@ define(["prism/prism"], function () { }, 'proc-groovy': { - pattern: /(^proc\s+groovy(?:\s+[\w|=]+)?;)(?:\s*submit)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im, + pattern: /(^proc\s+groovy(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im, lookbehind: true, inside: { + 'comment': comment, 'groovy': { pattern: RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:|[^"'])+?(?=endsubmit;)/.source.replace(//g, function () { return stringPattern; }), 'im'), lookbehind: true, alias: 'language-groovy', inside: Prism.languages.groovy }, + 'keyword': keywords, 'submit-statement': submitStatement, 'global-statements': globalStatements, 'number': number, @@ -174,15 +183,17 @@ define(["prism/prism"], function () { }, 'proc-lua': { - pattern: /(^proc\s+lua(?:\s+[\w|=]+)?;)(?:\s*submit)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im, + pattern: /(^proc\s+lua(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|run|data);|(?![\s\S]))/im, lookbehind: true, inside: { + 'comment': comment, 'lua': { pattern: RegExp(/(^[ \t]*submit(?:\s+(?:load|parseonly|norun))?)(?:|[^"'])+?(?=endsubmit;)/.source.replace(//g, function () { return stringPattern; }), 'im'), lookbehind: true, alias: 'language-lua', inside: Prism.languages.lua }, + 'keyword': keywords, 'submit-statement': submitStatement, 'global-statements': globalStatements, 'number': number, @@ -196,6 +207,7 @@ define(["prism/prism"], function () { pattern: /(^proc\s+cas(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|data);|(?![\s\S]))/im, lookbehind: true, inside: { + 'comment': comment, 'statement-var': { pattern: /((?:^|\s)=?)saveresult\s+[^;]+/im, lookbehind: true, @@ -218,7 +230,6 @@ define(["prism/prism"], function () { 'step': step, 'keyword': keywords, 'function': func, - 'comment': comment, 'format': format, 'altformat': altformat, 'global-statements': globalStatements, @@ -234,12 +245,24 @@ define(["prism/prism"], function () { lookbehind: true, inside: args }, - /*Special keywords within macros*/ - 'macro-keyword': { - pattern: /((?:^|\s)=?)%(?:ABORT|BQUOTE|BY|CMS|COPY|DISPLAY|DO|ELSE|END|EVAL|GLOBAL|GO|GOTO|IF|INC|INCLUDE|INDEX|INPUT|KTRIM|LENGTH|LET|LIST|LOCAL|NRBQUOTE|NRQUOTE|NRSTR|PUT|QKTRIM|QSCAN|QSUBSTR|QSYSFUNC|QUOTE|QUPCASE|RETURN|RUN|SCAN|STR|SUBSTR|SUPERQ|SYMDEL|SYMGLOBL|SYMLOCAL|SYMEXIST|SYSCALL|SYSEVALF|SYSEXEC|SYSFUNC|SYSGET|SYSRPUT|THEN|TO|TSO|UNQUOTE|UNTIL|UPCASE|WHILE|WINDOW)\b/i, + 'macro-keyword': macroKeyword, + 'macro-variable': macroVariable, + 'macro-string-functions': { + pattern: /((?:^|\s|=))%(?:NRBQUOTE|NRQUOTE|NRSTR|BQUOTE|QUOTE|STR)\(.*?(?:[^%]\))/i, lookbehind: true, - alias: 'keyword' + inside: { + 'function': { + pattern: /%(?:NRBQUOTE|NRQUOTE|NRSTR|BQUOTE|QUOTE|STR)/i, + alias: 'keyword' + }, + 'macro-keyword': macroKeyword, + 'macro-variable': macroVariable, + 'escaped-char': { + pattern: /%['"()<>=¬^~;,#]/i, + }, + 'punctuation': punctuation + } }, 'macro-declaration': { pattern: /^%macro[^;]+(?=;)/im, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-scheme.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-scheme.js index 36e4e5c48b..acfbfaba60 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-scheme.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-scheme.js @@ -2,32 +2,66 @@ define(["prism/prism"], function () { Prism.languages.scheme = { 'comment': /;.*/, 'string': { - pattern: /"(?:[^"\\]|\\.)*"|'[^()#'\s]+/, + pattern: /"(?:[^"\\]|\\.)*"/, + greedy: true + }, + 'symbol': { + pattern: /'[^()#'\s]+/, greedy: true }, 'character': { - pattern: /#\\(?:[ux][a-fA-F\d]+|[a-zA-Z]+|\S)/, + pattern: /#\\(?:[ux][a-fA-F\d]+|[-a-zA-Z]+|\S)/, + greedy: true, alias: 'string' }, + 'lambda-parameter': [ + // https://www.cs.cmu.edu/Groups/AI/html/r4rs/r4rs_6.html#SEC30 + { + pattern: /(\(lambda\s+)[^()'\s]+/, + lookbehind: true + }, + { + pattern: /(\(lambda\s+\()[^()']+/, + lookbehind: true + } + ], 'keyword': { - pattern: /(\()(?:define(?:-syntax|-library|-values)?|(?:case-)?lambda|let(?:\*|rec)?(?:-values)?|else|if|cond|begin|delay(?:-force)?|parameterize|guard|set!|(?:quasi-)?quote|syntax-rules)(?=[()\s])/, + pattern: /(\()(?:define(?:-library|-macro|-syntax|-values)?|defmacro|(?:case-)?lambda|let(?:(?:\*|rec)?(?:-values)?|-syntax|rec-syntax)|else|if|cond|begin|delay(?:-force)?|parameterize|guard|set!|(?:quasi-)?quote|syntax-(?:case|rules))(?=[()\s]|$)/, lookbehind: true }, 'builtin': { - pattern: /(\()(?:(?:cons|car|cdr|list|call-with-current-continuation|call\/cc|append|abs|apply|eval)\b|null\?|pair\?|boolean\?|eof-object\?|char\?|procedure\?|number\?|port\?|string\?|vector\?|symbol\?|bytevector\?)(?=[()\s])/, + pattern: /(\()(?:(?:cons|car|cdr|list|call-with-current-continuation|call\/cc|append|abs|apply|eval)\b|null\?|pair\?|boolean\?|eof-object\?|char\?|procedure\?|number\?|port\?|string\?|vector\?|symbol\?|bytevector\?)(?=[()\s]|$)/, lookbehind: true }, 'number': { - pattern: /([\s()])[-+]?(?:\d+\/\d+|\d*\.?\d+(?:\s*[-+]\s*\d*\.?\d+i)?)\b/, + // This pattern (apart from the lookarounds) works like this: + // + // Decimal numbers + // := \d*\.?\d+(?:[eE][+-]?\d+)?|\d+\/\d+ + // := (?:[+-]i)?|i + // := (?:#d(?:#[ei])?|#[ei](?:#d)?)? + // := [+-]? + // + // Binary, octal, and hexadecimal numbers + // := [\da-fA-F]+(?:\/[\da-fA-F]+)? + // := (?:[+-]i)?|i + // := #[box](?:#[ei])?|#[ei](?:#[box])? + // := [+-]? + // + // := | + pattern: /(^|[\s()])(?:(?:#d(?:#[ei])?|#[ei](?:#d)?)?[+-]?(?:(?:\d*\.?\d+(?:[eE][+-]?\d+)?|\d+\/\d+)(?:[+-](?:\d*\.?\d+(?:[eE][+-]?\d+)?|\d+\/\d+)i)?|(?:\d*\.?\d+(?:[eE][+-]?\d+)?|\d+\/\d+)i)|(?:#[box](?:#[ei])?|#[ei](?:#[box])?)[+-]?(?:[\da-fA-F]+(?:\/[\da-fA-F]+)?(?:[+-][\da-fA-F]+(?:\/[\da-fA-F]+)?i)?|[\da-fA-F]+(?:\/[\da-fA-F]+)?i))(?=[()\s]|$)/, + lookbehind: true + }, + 'boolean': { + pattern: /(^|[\s()])#[ft](?=[()\s]|$)/, lookbehind: true }, - 'boolean': /#[tf]/, 'operator': { - pattern: /(\()(?:[-+*%\/]|[<>]=?|=>?)(?=\s|$)/, + pattern: /(\()(?:[-+*%\/]|[<>]=?|=>?)(?=[()\s]|$)/, lookbehind: true }, 'function': { - pattern: /(\()[^()'\s]+(?=[()\s)]|$)/, + pattern: /(\()[^()'\s]+(?=[()\s]|$)/, lookbehind: true }, 'punctuation': /[()']/ diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-shell-session.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-shell-session.js index 2ad86a15dc..23222acc40 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-shell-session.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-shell-session.js @@ -11,11 +11,11 @@ define(["prism/prism","prism/components/prism-bash"], function () { // here doc // 1 capturing group - /<<-?\s*(\w+?)\s*(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\2/.source, + /<<-?\s*(\w+?)[ \t]*(?!.)[\s\S]*?[\r\n]\2/.source, // here doc quoted // 2 capturing group - /<<-?\s*(["'])(\w+)\3\s*(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\4/.source + /<<-?\s*(["'])(\w+)\3[ \t]*(?!.)[\s\S]*?[\r\n]\4/.source ].join('|'); Prism.languages['shell-session'] = { @@ -49,7 +49,7 @@ define(["prism/prism","prism/components/prism-bash"], function () { } } }, - 'output': /.(?:.*(?:\r\n?|\n|.$))*/ + 'output': /.(?:.*(?:[\r\n]|.$))*/ }; }(Prism)); diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-smali.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-smali.js new file mode 100644 index 0000000000..ee6de21745 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-smali.js @@ -0,0 +1,89 @@ +define(["prism/prism"], function () { +// Test files for the parser itself: +// https://github.com/JesusFreke/smali/tree/master/smali/src/test/resources/LexerTest + +Prism.languages.smali = { + 'comment': /#.*/, + 'string': { + pattern: /"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\(?:.|u[\da-fA-F]{4}))'/, + greedy: true + }, + + 'class-name': { + pattern: /L(?:(?:\w+|`[^`\r\n]*`)\/)*(?:[\w$]+|`[^`\r\n]*`)(?=\s*;)/, + inside: { + 'class-name': { + pattern: /(^L|\/)(?:[\w$]+|`[^`\r\n]*`)$/, + lookbehind: true + }, + 'namespace': { + pattern: /^(L)(?:(?:\w+|`[^`\r\n]*`)\/)+/, + lookbehind: true, + inside: { + 'punctuation': /\// + } + }, + 'builtin': /^L/ + } + }, + 'builtin': [ + { + // Reference: https://github.com/JesusFreke/smali/wiki/TypesMethodsAndFields#types + pattern: /([();\[])[BCDFIJSVZ]+/, + lookbehind: true + }, + { + // e.g. .field mWifiOnUid:I + pattern: /([\w$>]:)[BCDFIJSVZ]/, + lookbehind: true + } + ], + 'keyword': [ + { + pattern: /(\.end\s+)[\w-]+/, + lookbehind: true + }, + { + pattern: /(^|[^\w.-])\.(?!\d)[\w-]+/, + lookbehind: true + }, + { + pattern: /(^|[^\w.-])(?:abstract|annotation|bridge|constructor|enum|final|interface|private|protected|public|runtime|static|synthetic|system|transient)(?![\w.-])/, + lookbehind: true + } + ], + 'function': { + pattern: /(^|[^\w.-])(?:\w+|<[\w$-]+>)(?=\()/, + lookbehind: true + }, + + 'field': { + pattern: /[\w$]+(?=:)/, + alias: 'variable' + }, + 'register': { + pattern: /(^|[^\w.-])[vp]\d(?![\w.-])/, + lookbehind: true, + alias: 'variable' + }, + + 'boolean': { + pattern: /(^|[^\w.-])(?:true|false)(?![\w.-])/, + lookbehind: true + }, + 'number': { + pattern: /(^|[^/\w.-])-?(?:NAN|INFINITY|0x(?:[\dA-F]+(?:\.[\dA-F]*)?|\.[\dA-F]+)(?:p[+-]?[\dA-F]+)?|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)[dflst]?(?![\w.-])/i, + lookbehind: true + }, + + 'label': { + pattern: /(:)\w+/, + lookbehind: true, + alias: 'property' + }, + + 'operator': /->|\.\.|[\[=]/, + 'punctuation': /[{}(),;:]/ +}; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-solidity.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-solidity.js index 4b041dba3b..e35af92bba 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-solidity.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-solidity.js @@ -20,4 +20,6 @@ Prism.languages.insertBefore('solidity', 'number', { } }); +Prism.languages.sol = Prism.languages.solidity; + return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-sql.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-sql.js index ea7943e76c..0795aeed49 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-sql.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-sql.js @@ -17,7 +17,7 @@ Prism.languages.sql = { lookbehind: true }, 'function': /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, // Should we highlight user defined functions too? - 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, + 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, 'boolean': /\b(?:TRUE|FALSE|NULL)\b/i, 'number': /\b0x[\da-f]+\b|\b\d+\.?\d*|\B\.\d+\b/i, 'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-stylus.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-stylus.js index a7df322903..96fcde562b 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-stylus.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-stylus.js @@ -1,7 +1,24 @@ define(["prism/prism"], function () { (function (Prism) { + var unit = { + pattern: /(\b\d+)(?:%|[a-z]+)/, + lookbehind: true + }; + // 123 -123 .123 -.123 12.3 -12.3 + var number = { + pattern: /(^|[^\w.-])-?\d*\.?\d+/, + lookbehind: true + }; + var inside = { - 'url': /url\((["']?).*?\1\)/i, + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, + lookbehind: true + }, + 'url': { + pattern: /url\((["']?).*?\1\)/i, + greedy: true + }, 'string': { pattern: /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/, greedy: true @@ -14,13 +31,27 @@ define(["prism/prism"], function () { lookbehind: true }, 'hexcode': /#[\da-f]{3,6}/i, - 'number': /\b\d+(?:\.\d+)?%?/, + 'color': [ + /\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i, + { + pattern: /\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i, + inside: { + 'unit': unit, + 'number': number, + 'function': /[\w-]+(?=\()/, + 'punctuation': /[(),]/ + } + } + ], + 'entity': /\\[\da-f]{1,8}/i, + 'unit': unit, 'boolean': /\b(?:true|false)\b/, 'operator': [ // We want non-word chars around "-" because it is // accepted in property names. - /~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.+|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/ + /~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/ ], + 'number': number, 'punctuation': /[{}()\[\];:,]/ }; @@ -44,10 +75,6 @@ define(["prism/prism"], function () { }; Prism.languages.stylus = { - 'comment': { - pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, - lookbehind: true - }, 'atrule-declaration': { pattern: /(^\s*)@.+/m, lookbehind: true, @@ -100,12 +127,18 @@ define(["prism/prism"], function () { lookbehind: true, inside: { 'interpolation': inside.interpolation, + 'comment': inside.comment, 'punctuation': /[{},]/ } }, 'func': inside.func, 'string': inside.string, + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, + lookbehind: true, + greedy: true + }, 'interpolation': inside.interpolation, 'punctuation': /[{}()\[\];:.]/ }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-t4-vb.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-t4-vb.js index f0a16395d3..e2f1339b39 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-t4-vb.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-t4-vb.js @@ -1,4 +1,4 @@ -define(["prism/prism","prism/components/prism-t4-templating","prism/components/prism-visual-basic"], function () { -Prism.languages['t4-vb'] = Prism.languages['t4-templating'].createT4('visual-basic'); +define(["prism/prism","prism/components/prism-t4-templating","prism/components/prism-vbnet"], function () { +Prism.languages['t4-vb'] = Prism.languages['t4-templating'].createT4('vbnet'); return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-textile.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-textile.js index 59431489b4..b83e7e4cce 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-textile.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-textile.js @@ -2,7 +2,22 @@ define(["prism/prism","prism/components/prism-markup"], function () { (function (Prism) { // We don't allow for pipes inside parentheses // to not break table pattern |(. foo |). bar | - var modifierRegex = /(?:\([^|)]+\)|\[[^\]]+\]|\{[^}]+\})+/.source; + var modifierRegex = /\([^|()\n]+\)|\[[^\]\n]+\]|\{[^}\n]+\}/.source; + // Opening and closing parentheses which are not a modifier + // This pattern is necessary to prevent exponential backtracking + var parenthesesRegex = /\)|\((?![^|()\n]+\))/.source; + /** + * @param {string} source + * @param {string} [flags] + */ + function withModifier(source, flags) { + return RegExp( + source + .replace(//g, function () { return '(?:' + modifierRegex + ')'; }) + .replace(//g, function () { return '(?:' + parenthesesRegex + ')'; }), + flags || ''); + } + var modifierTokens = { 'css': { pattern: /\{[^}]+\}/, @@ -33,10 +48,10 @@ define(["prism/prism","prism/components/prism-markup"], function () { // h1. Header 1 'block-tag': { - pattern: RegExp('^[a-z]\\w*(?:' + modifierRegex + '|[<>=()])*\\.'), + pattern: withModifier(/^[a-z]\w*(?:||[<>=])*\./.source), inside: { 'modifier': { - pattern: RegExp('(^[a-z]\\w*)(?:' + modifierRegex + '|[<>=()])+(?=\\.)'), + pattern: withModifier(/(^[a-z]\w*)(?:||[<>=])+(?=\.)/.source), lookbehind: true, inside: modifierTokens }, @@ -48,10 +63,10 @@ define(["prism/prism","prism/components/prism-markup"], function () { // # List item // * List item 'list': { - pattern: RegExp('^[*#]+(?:' + modifierRegex + ')?\\s+.+', 'm'), + pattern: withModifier(/^[*#]+*\s+.+/.source, 'm'), inside: { 'modifier': { - pattern: RegExp('(^[*#]+)' + modifierRegex), + pattern: withModifier(/(^[*#]+)+/.source), lookbehind: true, inside: modifierTokens }, @@ -63,12 +78,12 @@ define(["prism/prism","prism/components/prism-markup"], function () { 'table': { // Modifiers can be applied to the row: {color:red}.|1|2|3| // or the cell: |{color:red}.1|2|3| - pattern: RegExp('^(?:(?:' + modifierRegex + '|[<>=()^~])+\\.\\s*)?(?:\\|(?:(?:' + modifierRegex + '|[<>=()^~_]|[\\\\/]\\d+)+\\.)?[^|]*)+\\|', 'm'), + pattern: withModifier(/^(?:(?:||[<>=^~])+\.\s*)?(?:\|(?:(?:||[<>=^~_]|[\\/]\d+)+\.)?[^|]*)+\|/.source, 'm'), inside: { 'modifier': { // Modifiers for rows after the first one are // preceded by a pipe and a line feed - pattern: RegExp('(^|\\|(?:\\r?\\n|\\r)?)(?:' + modifierRegex + '|[<>=()^~_]|[\\\\/]\\d+)+(?=\\.)'), + pattern: withModifier(/(^|\|(?:\r?\n|\r)?)(?:||[<>=^~_]|[\\/]\d+)+(?=\.)/.source), lookbehind: true, inside: modifierTokens }, @@ -77,56 +92,57 @@ define(["prism/prism","prism/components/prism-markup"], function () { }, 'inline': { - pattern: RegExp('(\\*\\*|__|\\?\\?|[*_%@+\\-^~])(?:' + modifierRegex + ')?.+?\\1'), + pattern: withModifier(/(^|[^a-zA-Z\d])(\*\*|__|\?\?|[*_%@+\-^~])*.+?\2(?![a-zA-Z\d])/.source), + lookbehind: true, inside: { // Note: superscripts and subscripts are not handled specifically // *bold*, **bold** 'bold': { - pattern: RegExp('(^(\\*\\*?)(?:' + modifierRegex + ')?).+?(?=\\2)'), + pattern: withModifier(/(^(\*\*?)*).+?(?=\2)/.source), lookbehind: true }, // _italic_, __italic__ 'italic': { - pattern: RegExp('(^(__?)(?:' + modifierRegex + ')?).+?(?=\\2)'), + pattern: withModifier(/(^(__?)*).+?(?=\2)/.source), lookbehind: true }, // ??cite?? 'cite': { - pattern: RegExp('(^\\?\\?(?:' + modifierRegex + ')?).+?(?=\\?\\?)'), + pattern: withModifier(/(^\?\?*).+?(?=\?\?)/.source), lookbehind: true, alias: 'string' }, // @code@ 'code': { - pattern: RegExp('(^@(?:' + modifierRegex + ')?).+?(?=@)'), + pattern: withModifier(/(^@*).+?(?=@)/.source), lookbehind: true, alias: 'keyword' }, // +inserted+ 'inserted': { - pattern: RegExp('(^\\+(?:' + modifierRegex + ')?).+?(?=\\+)'), + pattern: withModifier(/(^\+*).+?(?=\+)/.source), lookbehind: true }, // -deleted- 'deleted': { - pattern: RegExp('(^-(?:' + modifierRegex + ')?).+?(?=-)'), + pattern: withModifier(/(^-*).+?(?=-)/.source), lookbehind: true }, // %span% 'span': { - pattern: RegExp('(^%(?:' + modifierRegex + ')?).+?(?=%)'), + pattern: withModifier(/(^%*).+?(?=%)/.source), lookbehind: true }, 'modifier': { - pattern: RegExp('(^\\*\\*|__|\\?\\?|[*_%@+\\-^~])' + modifierRegex), + pattern: withModifier(/(^\*\*|__|\?\?|[*_%@+\-^~])+/.source), lookbehind: true, inside: modifierTokens }, @@ -153,14 +169,14 @@ define(["prism/prism","prism/components/prism-markup"], function () { // "text":http://example.com // "text":link-ref 'link': { - pattern: RegExp('"(?:' + modifierRegex + ')?[^"]+":.+?(?=[^\\w/]?(?:\\s|$))'), + pattern: withModifier(/"*[^"]+":.+?(?=[^\w/]?(?:\s|$))/.source), inside: { 'text': { - pattern: RegExp('(^"(?:' + modifierRegex + ')?)[^"]+(?=")'), + pattern: withModifier(/(^"*)[^"]+(?=")/.source), lookbehind: true }, 'modifier': { - pattern: RegExp('(^")' + modifierRegex), + pattern: withModifier(/(^")+/.source), lookbehind: true, inside: modifierTokens }, @@ -175,15 +191,15 @@ define(["prism/prism","prism/components/prism-markup"], function () { // !image.jpg! // !image.jpg(Title)!:http://example.com 'image': { - pattern: RegExp('!(?:' + modifierRegex + '|[<>=()])*[^!\\s()]+(?:\\([^)]+\\))?!(?::.+?(?=[^\\w/]?(?:\\s|$)))?'), + pattern: withModifier(/!(?:||[<>=])*[^!\s()]+(?:\([^)]+\))?!(?::.+?(?=[^\w/]?(?:\s|$)))?/.source), inside: { 'source': { - pattern: RegExp('(^!(?:' + modifierRegex + '|[<>=()])*)[^!\\s()]+(?:\\([^)]+\\))?(?=!)'), + pattern: withModifier(/(^!(?:||[<>=])*)[^!\s()]+(?:\([^)]+\))?(?=!)/.source), lookbehind: true, alias: 'url' }, 'modifier': { - pattern: RegExp('(^!)(?:' + modifierRegex + '|[<>=()])+'), + pattern: withModifier(/(^!)(?:||[<>=])+/.source), lookbehind: true, inside: modifierTokens }, diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-toml.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-toml.js index 484cf192b5..b11cc34bcc 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-toml.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-toml.js @@ -1,8 +1,14 @@ define(["prism/prism"], function () { (function (Prism) { - // pattern: /(?:[\w-]+|'[^'\n\r]*'|"(?:\.|[^\\"\r\n])*")/ - var key = "(?:[\\w-]+|'[^'\n\r]*'|\"(?:\\.|[^\\\\\"\r\n])*\")"; + var key = /(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source; + + /** + * @param {string} pattern + */ + function insertKey(pattern) { + return pattern.replace(/__/g, function () { return key; }); + } Prism.languages.toml = { 'comment': { @@ -10,13 +16,13 @@ define(["prism/prism"], function () { greedy: true }, 'table': { - pattern: RegExp("(^\\s*\\[\\s*(?:\\[\\s*)?)" + key + "(?:\\s*\\.\\s*" + key + ")*(?=\\s*\\])", "m"), + pattern: RegExp(insertKey(/(^\s*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source), 'm'), lookbehind: true, greedy: true, alias: 'class-name' }, 'key': { - pattern: RegExp("(^\\s*|[{,]\\s*)" + key + "(?:\\s*\\.\\s*" + key + ")*(?=\\s*=)", "m"), + pattern: RegExp(insertKey(/(^\s*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source), 'm'), lookbehind: true, greedy: true, alias: 'property' @@ -28,16 +34,16 @@ define(["prism/prism"], function () { 'date': [ { // Offset Date-Time, Local Date-Time, Local Date - pattern: /\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?/i, + pattern: /\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i, alias: 'number' }, { // Local Time - pattern: /\d{2}:\d{2}:\d{2}(?:\.\d+)?/i, + pattern: /\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/, alias: 'number' } ], - 'number': /(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?(?:inf|nan)\b/, + 'number': /(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/, 'boolean': /\b(?:true|false)\b/, 'punctuation': /[.,=[\]{}]/ }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-tt2.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-tt2.js index 9053ed9910..713365dfd3 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-tt2.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-tt2.js @@ -10,7 +10,7 @@ define(["prism/prism","prism/components/prism-clike","prism/components/prism-mar Prism.languages.insertBefore('tt2', 'number', { 'operator': /=[>=]?|!=?|<=?|>=?|&&|\|\|?|\b(?:and|or|not)\b/, 'variable': { - pattern: /[a-z]\w*(?:\s*\.\s*(?:\d+|\$?[a-z]\w*))*/i + pattern: /\b[a-z]\w*(?:\s*\.\s*(?:\d+|\$?[a-z]\w*))*\b/i } }); diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-turtle.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-turtle.js index 0690f1b67a..cb830e580c 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-turtle.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-turtle.js @@ -17,7 +17,7 @@ Prism.languages.turtle = { greedy: true }, 'url': { - pattern: /<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-f]{4}|U[\da-f]{8}))*>/i, + pattern: /<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-fA-F]{4}|U[\da-fA-F]{8}))*>/, greedy: true, inside: { 'punctuation': /[<>]/ diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-typescript.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-typescript.js index f799e7c662..2002ea03a1 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-typescript.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-typescript.js @@ -1,10 +1,45 @@ define(["prism/prism","prism/components/prism-javascript"], function () { -Prism.languages.typescript = Prism.languages.extend('javascript', { - // From JavaScript Prism keyword list and TypeScript language spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#221-reserved-words - 'keyword': /\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/, - 'builtin': /\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/, -}); +(function (Prism) { -Prism.languages.ts = Prism.languages.typescript; + Prism.languages.typescript = Prism.languages.extend('javascript', { + 'class-name': { + pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/, + lookbehind: true, + greedy: true, + inside: null // see below + }, + // From JavaScript Prism keyword list and TypeScript language spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#221-reserved-words + 'keyword': /\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/, + 'builtin': /\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/, + }); + + // doesn't work with TS because TS is too complex + delete Prism.languages.typescript['parameter']; + + // a version of typescript specifically for highlighting types + var typeInside = Prism.languages.extend('typescript', {}); + delete typeInside['class-name']; + + Prism.languages.typescript['class-name'].inside = typeInside; + + Prism.languages.insertBefore('typescript', 'function', { + 'generic-function': { + // e.g. foo( ... + pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/, + greedy: true, + inside: { + 'function': /^#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*/, + 'generic': { + pattern: /<[\s\S]+/, // everything after the first < + alias: 'class-name', + inside: typeInside + } + } + } + }); + + Prism.languages.ts = Prism.languages.typescript; + +}(Prism)); return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-unrealscript.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-unrealscript.js new file mode 100644 index 0000000000..4f3d895088 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-unrealscript.js @@ -0,0 +1,45 @@ +define(["prism/prism"], function () { +Prism.languages.unrealscript = { + 'comment': /\/\/.*|\/\*[\s\S]*?\*\//, + 'string': { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + 'category': { + pattern: /(\b(?:(?:autoexpand|hide|show)categories|var)\s*\()[^()]+(?=\))/, + lookbehind: true, + greedy: true, + alias: 'property' + }, + 'metadata': { + pattern: /(\w\s*)<\s*\w+\s*=[^<>|=\r\n]+(?:\|\s*\w+\s*=[^<>|=\r\n]+)*>/, + lookbehind: true, + greedy: true, + inside: { + 'property': /\w+(?=\s*=)/, + 'operator': /=/, + 'punctuation': /[<>|]/ + } + }, + 'macro': { + pattern: /`\w+/, + alias: 'property' + }, + 'class-name': { + pattern: /(\b(?:class|enum|extends|interface|state(?:\(\))?|struct|within)\s+)\w+/, + lookbehind: true + }, + + 'keyword': /\b(?:abstract|actor|array|auto|autoexpandcategories|bool|break|byte|case|class|classgroup|client|coerce|collapsecategories|config|const|continue|default|defaultproperties|delegate|dependson|deprecated|do|dontcollapsecategories|editconst|editinlinenew|else|enum|event|exec|export|extends|final|float|for|forcescriptorder|foreach|function|goto|guid|hidecategories|hidedropdown|if|ignores|implements|inherits|input|int|interface|iterator|latent|local|material|name|native|nativereplication|noexport|nontransient|noteditinlinenew|notplaceable|operator|optional|out|pawn|perobjectconfig|perobjectlocalized|placeable|postoperator|preoperator|private|protected|reliable|replication|return|server|showcategories|simulated|singular|state|static|string|struct|structdefault|structdefaultproperties|switch|texture|transient|travel|unreliable|until|var|vector|while|within)\b/, + 'function': /[a-z_]\w*(?=\s*\()/i, + + 'boolean': /\b(?:false|true)\b/, + 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, + // https://docs.unrealengine.com/udk/Three/UnrealScriptExpressions.html + 'operator': />>|<<|--|\+\+|\*\*|[-+*/~!=<>$@]=?|&&?|\|\|?|\^\^?|[?:%]|\b(?:Cross|Dot|ClockwiseFrom)\b/, + 'punctuation': /[()[\]{};,.]/ +}; + +Prism.languages.uc = Prism.languages.uscript = Prism.languages.unrealscript; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-visual-basic.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-visual-basic.js index 50b3fac87b..6f8ce736e3 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-visual-basic.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-visual-basic.js @@ -16,12 +16,12 @@ Prism.languages['visual-basic'] = { greedy: true }, 'date': { - pattern: /#[^\S\r\n]*(?:\d+([/-])\d+\1\d+(?:[^\S\r\n]+(?:\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?))?|(?:\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?))[^\S\r\n]*#/i, + pattern: /#[^\S\r\n]*(?:\d+([/-])\d+\1\d+(?:[^\S\r\n]+(?:\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?))?|\d+[^\S\r\n]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[^\S\r\n]*(?:AM|PM))?)[^\S\r\n]*#/i, alias: 'builtin' }, 'number': /(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:U?[ILS]|[FRD])?/i, 'boolean': /\b(?:True|False|Nothing)\b/i, - 'keyword': /\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|TypeOf|U(?:Integer|Long|Short)|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Xor)\b/i, + 'keyword': /\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Until|Xor)\b/i, 'operator': [ /[+\-*/\\^<=>&#@$%!]/, { @@ -33,5 +33,6 @@ Prism.languages['visual-basic'] = { }; Prism.languages.vb = Prism.languages['visual-basic']; +Prism.languages.vba = Prism.languages['visual-basic']; return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-warpscript.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-warpscript.js new file mode 100644 index 0000000000..3d736496b4 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-warpscript.js @@ -0,0 +1,24 @@ +define(["prism/prism"], function () { +Prism.languages.warpscript = { + 'comment': /#.*|\/\/.*|\/\*[\s\S]*?\*\//, + 'string': { + pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'|<'(?:[^\\']|'(?!>)|\\.)*'>/, + greedy: true + }, + 'variable': /\$\S+/, + 'macro': { + pattern: /@\S+/, + alias: 'property' + }, + // WarpScript doesn't have any keywords, these are all functions under the control category + // https://www.warp10.io/tags/control + 'keyword': /\b(?:BREAK|CHECKMACRO|CONTINUE|CUDF|DEFINED|DEFINEDMACRO|EVAL|FAIL|FOR|FOREACH|FORSTEP|IFT|IFTE|MSGFAIL|NRETURN|RETHROW|RETURN|SWITCH|TRY|UDF|UNTIL|WHILE)\b/, + 'number': /[+-]?\b(?:NaN|Infinity|\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?|0x[\da-fA-F]+|0b[01]+)\b/, + 'boolean': /\b(?:false|true|F|T)\b/, + 'punctuation': /<%|%>|[{}[\]()]/, + // Some operators from the "operators" category + // https://www.warp10.io/tags/operators + 'operator': /==|&&?|\|\|?|\*\*?|>>>?|<<|==|[<>!~]=?|[-/%^]|\+!?|\b(?:AND|NOT|OR)\b/ +}; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-xml-doc.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-xml-doc.js new file mode 100644 index 0000000000..09092f3a33 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-xml-doc.js @@ -0,0 +1,43 @@ +define(["prism/prism","prism/components/prism-markup"], function () { +(function (Prism) { + + /** + * If the given language is present, it will insert the given doc comment grammar token into it. + * + * @param {string} lang + * @param {any} docComment + */ + function insertDocComment(lang, docComment) { + if (Prism.languages[lang]) { + Prism.languages.insertBefore(lang, 'comment', { + 'doc-comment': docComment + }); + } + } + + var tag = Prism.languages.markup.tag; + + var slashDocComment = { + pattern: /\/\/\/.*/, + greedy: true, + alias: 'comment', + inside: { + 'tag': tag + } + }; + var tickDocComment = { + pattern: /'''.*/, + greedy: true, + alias: 'comment', + inside: { + 'tag': tag + } + }; + + insertDocComment('csharp', slashDocComment); + insertDocComment('fsharp', slashDocComment); + insertDocComment('vbnet', tickDocComment); + +}(Prism)); + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-xquery.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-xquery.js index 8d8c894d76..241794839b 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/components/prism-xquery.js +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-xquery.js @@ -56,12 +56,12 @@ define(["prism/prism","prism/components/prism-markup"], function () { 'punctuation': /[[\](){},;:/]/ }); - Prism.languages.xquery.tag.pattern = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i; - Prism.languages.xquery['tag'].inside['attr-value'].pattern = /=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}|(?!\1)[^\\])*\1|[^\s'">=]+)/i; + Prism.languages.xquery.tag.pattern = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^{}]*}|[^{}])*}|[^{}])+}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i; + Prism.languages.xquery['tag'].inside['attr-value'].pattern = /=(?:("|')(?:\\[\s\S]|{(?!{)(?:{(?:{[^{}]*}|[^{}])*}|[^{}])+}|(?!\1)[^\\])*\1|[^\s'">=]+)/i; Prism.languages.xquery['tag'].inside['attr-value'].inside['punctuation'] = /^="|"$/; Prism.languages.xquery['tag'].inside['attr-value'].inside['expression'] = { // Allow for two levels of nesting - pattern: /{(?!{)(?:{(?:{[^}]*}|[^}])*}|[^}])+}/, + pattern: /{(?!{)(?:{(?:{[^{}]*}|[^{}])*}|[^{}])+}/, inside: Prism.languages.xquery, alias: 'language-xquery' }; diff --git a/wcfsetup/install/files/js/3rdParty/prism/components/prism-yang.js b/wcfsetup/install/files/js/3rdParty/prism/components/prism-yang.js new file mode 100644 index 0000000000..abd262240e --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/prism/components/prism-yang.js @@ -0,0 +1,23 @@ +define(["prism/prism"], function () { +Prism.languages.yang = { + // https://tools.ietf.org/html/rfc6020#page-34 + // http://www.yang-central.org/twiki/bin/view/Main/YangExamples + 'comment': /\/\*[\s\S]*?\*\/|\/\/.*/, + 'string': { + pattern: /"(?:[^\\"]|\\.)*"|'[^']*'/, + greedy: true + }, + 'keyword': { + pattern: /(^|[{};\r\n][ \t]*)[a-z_][\w.-]*/i, + lookbehind: true + }, + 'namespace': { + pattern: /(\s)[a-z_][\w.-]*(?=:)/i, + lookbehind: true + }, + 'boolean': /\b(?:false|true)\b/, + 'operator': /\+/, + 'punctuation': /[{};:]/ +}; + +return Prism; }) \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/prism-meta.js b/wcfsetup/install/files/js/3rdParty/prism/prism-meta.js index 66299c2357..6284a3543a 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/prism-meta.js +++ b/wcfsetup/install/files/js/3rdParty/prism/prism-meta.js @@ -1 +1 @@ -define([],function(){return /*START*/{"markup":{"title":"Markup","file":"markup"},"html":{"title":"HTML","file":"markup"},"xml":{"title":"XML","file":"markup"},"svg":{"title":"SVG","file":"markup"},"mathml":{"title":"MathML","file":"markup"},"css":{"title":"CSS","file":"css"},"clike":{"title":"C-like","file":"clike"},"javascript":{"title":"JavaScript","file":"javascript"},"abap":{"title":"ABAP","file":"abap"},"abnf":{"title":"Augmented Backus–Naur form","file":"abnf"},"actionscript":{"title":"ActionScript","file":"actionscript"},"ada":{"title":"Ada","file":"ada"},"antlr4":{"title":"ANTLR4","file":"antlr4"},"apacheconf":{"title":"Apache Configuration","file":"apacheconf"},"apl":{"title":"APL","file":"apl"},"applescript":{"title":"AppleScript","file":"applescript"},"aql":{"title":"AQL","file":"aql"},"arduino":{"title":"Arduino","file":"arduino"},"arff":{"title":"ARFF","file":"arff"},"asciidoc":{"title":"AsciiDoc","file":"asciidoc"},"asm6502":{"title":"6502 Assembly","file":"asm6502"},"aspnet":{"title":"ASP.NET (C#)","file":"aspnet"},"autohotkey":{"title":"AutoHotkey","file":"autohotkey"},"autoit":{"title":"AutoIt","file":"autoit"},"bash":{"title":"Bash","file":"bash"},"basic":{"title":"BASIC","file":"basic"},"batch":{"title":"Batch","file":"batch"},"bbcode":{"title":"BBcode","file":"bbcode"},"bison":{"title":"Bison","file":"bison"},"bnf":{"title":"Backus–Naur form","file":"bnf"},"brainfuck":{"title":"Brainfuck","file":"brainfuck"},"brightscript":{"title":"BrightScript","file":"brightscript"},"bro":{"title":"Bro","file":"bro"},"c":{"title":"C","file":"c"},"concurnas":{"title":"Concurnas","file":"concurnas"},"csharp":{"title":"C#","file":"csharp"},"cpp":{"title":"C++","file":"cpp"},"cil":{"title":"CIL","file":"cil"},"coffeescript":{"title":"CoffeeScript","file":"coffeescript"},"cmake":{"title":"CMake","file":"cmake"},"clojure":{"title":"Clojure","file":"clojure"},"crystal":{"title":"Crystal","file":"crystal"},"csp":{"title":"Content-Security-Policy","file":"csp"},"css-extras":{"title":"CSS Extras","file":"css-extras"},"d":{"title":"D","file":"d"},"dart":{"title":"Dart","file":"dart"},"dax":{"title":"DAX","file":"dax"},"diff":{"title":"Diff","file":"diff"},"django":{"title":"Django/Jinja2","file":"django"},"dns-zone-file":{"title":"DNS zone file","file":"dns-zone-file"},"docker":{"title":"Docker","file":"docker"},"ebnf":{"title":"Extended Backus–Naur form","file":"ebnf"},"eiffel":{"title":"Eiffel","file":"eiffel"},"ejs":{"title":"EJS","file":"ejs"},"elixir":{"title":"Elixir","file":"elixir"},"elm":{"title":"Elm","file":"elm"},"etlua":{"title":"Embedded Lua templating","file":"etlua"},"erb":{"title":"ERB","file":"erb"},"erlang":{"title":"Erlang","file":"erlang"},"excel-formula":{"title":"Excel Formula","file":"excel-formula"},"fsharp":{"title":"F#","file":"fsharp"},"factor":{"title":"Factor","file":"factor"},"firestore-security-rules":{"title":"Firestore security rules","file":"firestore-security-rules"},"flow":{"title":"Flow","file":"flow"},"fortran":{"title":"Fortran","file":"fortran"},"ftl":{"title":"FreeMarker Template Language","file":"ftl"},"gcode":{"title":"G-code","file":"gcode"},"gdscript":{"title":"GDScript","file":"gdscript"},"gedcom":{"title":"GEDCOM","file":"gedcom"},"gherkin":{"title":"Gherkin","file":"gherkin"},"git":{"title":"Git","file":"git"},"glsl":{"title":"GLSL","file":"glsl"},"gml":{"title":"GameMaker Language","file":"gml"},"go":{"title":"Go","file":"go"},"graphql":{"title":"GraphQL","file":"graphql"},"groovy":{"title":"Groovy","file":"groovy"},"haml":{"title":"Haml","file":"haml"},"handlebars":{"title":"Handlebars","file":"handlebars"},"haskell":{"title":"Haskell","file":"haskell"},"haxe":{"title":"Haxe","file":"haxe"},"hcl":{"title":"HCL","file":"hcl"},"http":{"title":"HTTP","file":"http"},"hpkp":{"title":"HTTP Public-Key-Pins","file":"hpkp"},"hsts":{"title":"HTTP Strict-Transport-Security","file":"hsts"},"ichigojam":{"title":"IchigoJam","file":"ichigojam"},"icon":{"title":"Icon","file":"icon"},"inform7":{"title":"Inform 7","file":"inform7"},"ini":{"title":"Ini","file":"ini"},"io":{"title":"Io","file":"io"},"j":{"title":"J","file":"j"},"java":{"title":"Java","file":"java"},"javadoc":{"title":"JavaDoc","file":"javadoc"},"javadoclike":{"title":"JavaDoc-like","file":"javadoclike"},"javastacktrace":{"title":"Java stack trace","file":"javastacktrace"},"jolie":{"title":"Jolie","file":"jolie"},"jq":{"title":"JQ","file":"jq"},"jsdoc":{"title":"JSDoc","file":"jsdoc"},"js-extras":{"title":"JS Extras","file":"js-extras"},"js-templates":{"title":"JS Templates","file":"js-templates"},"json":{"title":"JSON","file":"json"},"jsonp":{"title":"JSONP","file":"jsonp"},"json5":{"title":"JSON5","file":"json5"},"julia":{"title":"Julia","file":"julia"},"keyman":{"title":"Keyman","file":"keyman"},"kotlin":{"title":"Kotlin","file":"kotlin"},"latex":{"title":"LaTeX","file":"latex"},"tex":{"title":"TeX","file":"latex"},"context":{"title":"ConTeXt","file":"latex"},"latte":{"title":"Latte","file":"latte"},"less":{"title":"Less","file":"less"},"lilypond":{"title":"LilyPond","file":"lilypond"},"liquid":{"title":"Liquid","file":"liquid"},"lisp":{"title":"Lisp","file":"lisp"},"livescript":{"title":"LiveScript","file":"livescript"},"llvm":{"title":"LLVM IR","file":"llvm"},"lolcode":{"title":"LOLCODE","file":"lolcode"},"lua":{"title":"Lua","file":"lua"},"makefile":{"title":"Makefile","file":"makefile"},"markdown":{"title":"Markdown","file":"markdown"},"markup-templating":{"title":"Markup templating","file":"markup-templating"},"matlab":{"title":"MATLAB","file":"matlab"},"mel":{"title":"MEL","file":"mel"},"mizar":{"title":"Mizar","file":"mizar"},"monkey":{"title":"Monkey","file":"monkey"},"moonscript":{"title":"MoonScript","file":"moonscript"},"n1ql":{"title":"N1QL","file":"n1ql"},"n4js":{"title":"N4JS","file":"n4js"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","file":"nand2tetris-hdl"},"nasm":{"title":"NASM","file":"nasm"},"neon":{"title":"NEON","file":"neon"},"nginx":{"title":"nginx","file":"nginx"},"nim":{"title":"Nim","file":"nim"},"nix":{"title":"Nix","file":"nix"},"nsis":{"title":"NSIS","file":"nsis"},"objectivec":{"title":"Objective-C","file":"objectivec"},"ocaml":{"title":"OCaml","file":"ocaml"},"opencl":{"title":"OpenCL","file":"opencl"},"oz":{"title":"Oz","file":"oz"},"parigp":{"title":"PARI/GP","file":"parigp"},"parser":{"title":"Parser","file":"parser"},"pascal":{"title":"Pascal","file":"pascal"},"pascaligo":{"title":"Pascaligo","file":"pascaligo"},"pcaxis":{"title":"PC-Axis","file":"pcaxis"},"perl":{"title":"Perl","file":"perl"},"php":{"title":"PHP","file":"php"},"phpdoc":{"title":"PHPDoc","file":"phpdoc"},"php-extras":{"title":"PHP Extras","file":"php-extras"},"plsql":{"title":"PL/SQL","file":"plsql"},"powerquery":{"title":"PowerQuery","file":"powerquery"},"powershell":{"title":"PowerShell","file":"powershell"},"processing":{"title":"Processing","file":"processing"},"prolog":{"title":"Prolog","file":"prolog"},"properties":{"title":".properties","file":"properties"},"protobuf":{"title":"Protocol Buffers","file":"protobuf"},"pug":{"title":"Pug","file":"pug"},"puppet":{"title":"Puppet","file":"puppet"},"pure":{"title":"Pure","file":"pure"},"python":{"title":"Python","file":"python"},"q":{"title":"Q (kdb+ database)","file":"q"},"qml":{"title":"QML","file":"qml"},"qore":{"title":"Qore","file":"qore"},"r":{"title":"R","file":"r"},"jsx":{"title":"React JSX","file":"jsx"},"tsx":{"title":"React TSX","file":"tsx"},"renpy":{"title":"Ren'py","file":"renpy"},"reason":{"title":"Reason","file":"reason"},"regex":{"title":"Regex","file":"regex"},"rest":{"title":"reST (reStructuredText)","file":"rest"},"rip":{"title":"Rip","file":"rip"},"roboconf":{"title":"Roboconf","file":"roboconf"},"robotframework":{"title":"Robot Framework","file":"robotframework"},"ruby":{"title":"Ruby","file":"ruby"},"rust":{"title":"Rust","file":"rust"},"sas":{"title":"SAS","file":"sas"},"sass":{"title":"Sass (Sass)","file":"sass"},"scss":{"title":"Sass (Scss)","file":"scss"},"scala":{"title":"Scala","file":"scala"},"scheme":{"title":"Scheme","file":"scheme"},"shell-session":{"title":"Shell session","file":"shell-session"},"smalltalk":{"title":"Smalltalk","file":"smalltalk"},"smarty":{"title":"Smarty","file":"smarty"},"solidity":{"title":"Solidity (Ethereum)","file":"solidity"},"solution-file":{"title":"Solution file","file":"solution-file"},"soy":{"title":"Soy (Closure Template)","file":"soy"},"sparql":{"title":"SPARQL","file":"sparql"},"splunk-spl":{"title":"Splunk SPL","file":"splunk-spl"},"sqf":{"title":"SQF: Status Quo Function (Arma 3)","file":"sqf"},"sql":{"title":"SQL","file":"sql"},"stylus":{"title":"Stylus","file":"stylus"},"swift":{"title":"Swift","file":"swift"},"tap":{"title":"TAP","file":"tap"},"tcl":{"title":"Tcl","file":"tcl"},"textile":{"title":"Textile","file":"textile"},"toml":{"title":"TOML","file":"toml"},"tt2":{"title":"Template Toolkit 2","file":"tt2"},"turtle":{"title":"Turtle","file":"turtle"},"twig":{"title":"Twig","file":"twig"},"typescript":{"title":"TypeScript","file":"typescript"},"t4-cs":{"title":"T4 Text Templates (C#)","file":"t4-cs"},"t4-vb":{"title":"T4 Text Templates (VB)","file":"t4-vb"},"t4-templating":{"title":"T4 templating","file":"t4-templating"},"vala":{"title":"Vala","file":"vala"},"vbnet":{"title":"VB.Net","file":"vbnet"},"velocity":{"title":"Velocity","file":"velocity"},"verilog":{"title":"Verilog","file":"verilog"},"vhdl":{"title":"VHDL","file":"vhdl"},"vim":{"title":"vim","file":"vim"},"visual-basic":{"title":"Visual Basic","file":"visual-basic"},"wasm":{"title":"WebAssembly","file":"wasm"},"wiki":{"title":"Wiki markup","file":"wiki"},"xeora":{"title":"Xeora","file":"xeora"},"xojo":{"title":"Xojo (REALbasic)","file":"xojo"},"xquery":{"title":"XQuery","file":"xquery"},"yaml":{"title":"YAML","file":"yaml"},"zig":{"title":"Zig","file":"zig"}}/*END*/;}); \ No newline at end of file +define([],function(){return /*START*/{"markup":{"title":"Markup","file":"markup"},"html":{"title":"HTML","file":"markup"},"xml":{"title":"XML","file":"markup"},"svg":{"title":"SVG","file":"markup"},"mathml":{"title":"MathML","file":"markup"},"ssml":{"title":"SSML","file":"markup"},"atom":{"title":"Atom","file":"markup"},"rss":{"title":"RSS","file":"markup"},"css":{"title":"CSS","file":"css"},"clike":{"title":"C-like","file":"clike"},"javascript":{"title":"JavaScript","file":"javascript"},"abap":{"title":"ABAP","file":"abap"},"abnf":{"title":"ABNF","file":"abnf"},"actionscript":{"title":"ActionScript","file":"actionscript"},"ada":{"title":"Ada","file":"ada"},"agda":{"title":"Agda","file":"agda"},"al":{"title":"AL","file":"al"},"antlr4":{"title":"ANTLR4","file":"antlr4"},"apacheconf":{"title":"Apache Configuration","file":"apacheconf"},"apl":{"title":"APL","file":"apl"},"applescript":{"title":"AppleScript","file":"applescript"},"aql":{"title":"AQL","file":"aql"},"arduino":{"title":"Arduino","file":"arduino"},"arff":{"title":"ARFF","file":"arff"},"asciidoc":{"title":"AsciiDoc","file":"asciidoc"},"aspnet":{"title":"ASP.NET (C#)","file":"aspnet"},"asm6502":{"title":"6502 Assembly","file":"asm6502"},"autohotkey":{"title":"AutoHotkey","file":"autohotkey"},"autoit":{"title":"AutoIt","file":"autoit"},"bash":{"title":"Bash","file":"bash"},"basic":{"title":"BASIC","file":"basic"},"batch":{"title":"Batch","file":"batch"},"bbcode":{"title":"BBcode","file":"bbcode"},"bison":{"title":"Bison","file":"bison"},"bnf":{"title":"BNF","file":"bnf"},"brainfuck":{"title":"Brainfuck","file":"brainfuck"},"brightscript":{"title":"BrightScript","file":"brightscript"},"bro":{"title":"Bro","file":"bro"},"c":{"title":"C","file":"c"},"csharp":{"title":"C#","file":"csharp"},"cpp":{"title":"C++","file":"cpp"},"cil":{"title":"CIL","file":"cil"},"clojure":{"title":"Clojure","file":"clojure"},"cmake":{"title":"CMake","file":"cmake"},"coffeescript":{"title":"CoffeeScript","file":"coffeescript"},"concurnas":{"title":"Concurnas","file":"concurnas"},"csp":{"title":"Content-Security-Policy","file":"csp"},"crystal":{"title":"Crystal","file":"crystal"},"css-extras":{"title":"CSS Extras","file":"css-extras"},"cypher":{"title":"Cypher","file":"cypher"},"d":{"title":"D","file":"d"},"dart":{"title":"Dart","file":"dart"},"dax":{"title":"DAX","file":"dax"},"dhall":{"title":"Dhall","file":"dhall"},"diff":{"title":"Diff","file":"diff"},"django":{"title":"Django/Jinja2","file":"django"},"dns-zone-file":{"title":"DNS zone file","file":"dns-zone-file"},"docker":{"title":"Docker","file":"docker"},"ebnf":{"title":"EBNF","file":"ebnf"},"editorconfig":{"title":"EditorConfig","file":"editorconfig"},"eiffel":{"title":"Eiffel","file":"eiffel"},"ejs":{"title":"EJS","file":"ejs"},"elixir":{"title":"Elixir","file":"elixir"},"elm":{"title":"Elm","file":"elm"},"etlua":{"title":"Embedded Lua templating","file":"etlua"},"erb":{"title":"ERB","file":"erb"},"erlang":{"title":"Erlang","file":"erlang"},"excel-formula":{"title":"Excel Formula","file":"excel-formula"},"fsharp":{"title":"F#","file":"fsharp"},"factor":{"title":"Factor","file":"factor"},"firestore-security-rules":{"title":"Firestore security rules","file":"firestore-security-rules"},"flow":{"title":"Flow","file":"flow"},"fortran":{"title":"Fortran","file":"fortran"},"ftl":{"title":"FreeMarker Template Language","file":"ftl"},"gml":{"title":"GameMaker Language","file":"gml"},"gcode":{"title":"G-code","file":"gcode"},"gdscript":{"title":"GDScript","file":"gdscript"},"gedcom":{"title":"GEDCOM","file":"gedcom"},"gherkin":{"title":"Gherkin","file":"gherkin"},"git":{"title":"Git","file":"git"},"glsl":{"title":"GLSL","file":"glsl"},"go":{"title":"Go","file":"go"},"graphql":{"title":"GraphQL","file":"graphql"},"groovy":{"title":"Groovy","file":"groovy"},"haml":{"title":"Haml","file":"haml"},"handlebars":{"title":"Handlebars","file":"handlebars"},"haskell":{"title":"Haskell","file":"haskell"},"haxe":{"title":"Haxe","file":"haxe"},"hcl":{"title":"HCL","file":"hcl"},"hlsl":{"title":"HLSL","file":"hlsl"},"http":{"title":"HTTP","file":"http"},"hpkp":{"title":"HTTP Public-Key-Pins","file":"hpkp"},"hsts":{"title":"HTTP Strict-Transport-Security","file":"hsts"},"ichigojam":{"title":"IchigoJam","file":"ichigojam"},"icon":{"title":"Icon","file":"icon"},"ignore":{"title":".ignore","file":"ignore"},"gitignore":{"title":".gitignore","file":"ignore"},"hgignore":{"title":".hgignore","file":"ignore"},"npmignore":{"title":".npmignore","file":"ignore"},"inform7":{"title":"Inform 7","file":"inform7"},"ini":{"title":"Ini","file":"ini"},"io":{"title":"Io","file":"io"},"j":{"title":"J","file":"j"},"java":{"title":"Java","file":"java"},"javadoc":{"title":"JavaDoc","file":"javadoc"},"javadoclike":{"title":"JavaDoc-like","file":"javadoclike"},"javastacktrace":{"title":"Java stack trace","file":"javastacktrace"},"jolie":{"title":"Jolie","file":"jolie"},"jq":{"title":"JQ","file":"jq"},"jsdoc":{"title":"JSDoc","file":"jsdoc"},"js-extras":{"title":"JS Extras","file":"js-extras"},"json":{"title":"JSON","file":"json"},"json5":{"title":"JSON5","file":"json5"},"jsonp":{"title":"JSONP","file":"jsonp"},"jsstacktrace":{"title":"JS stack trace","file":"jsstacktrace"},"js-templates":{"title":"JS Templates","file":"js-templates"},"julia":{"title":"Julia","file":"julia"},"keyman":{"title":"Keyman","file":"keyman"},"kotlin":{"title":"Kotlin","file":"kotlin"},"kts":{"title":"Kotlin Script","file":"kotlin"},"latex":{"title":"LaTeX","file":"latex"},"tex":{"title":"TeX","file":"latex"},"context":{"title":"ConTeXt","file":"latex"},"latte":{"title":"Latte","file":"latte"},"less":{"title":"Less","file":"less"},"lilypond":{"title":"LilyPond","file":"lilypond"},"liquid":{"title":"Liquid","file":"liquid"},"lisp":{"title":"Lisp","file":"lisp"},"livescript":{"title":"LiveScript","file":"livescript"},"llvm":{"title":"LLVM IR","file":"llvm"},"lolcode":{"title":"LOLCODE","file":"lolcode"},"lua":{"title":"Lua","file":"lua"},"makefile":{"title":"Makefile","file":"makefile"},"markdown":{"title":"Markdown","file":"markdown"},"markup-templating":{"title":"Markup templating","file":"markup-templating"},"matlab":{"title":"MATLAB","file":"matlab"},"mel":{"title":"MEL","file":"mel"},"mizar":{"title":"Mizar","file":"mizar"},"monkey":{"title":"Monkey","file":"monkey"},"moonscript":{"title":"MoonScript","file":"moonscript"},"n1ql":{"title":"N1QL","file":"n1ql"},"n4js":{"title":"N4JS","file":"n4js"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","file":"nand2tetris-hdl"},"nasm":{"title":"NASM","file":"nasm"},"neon":{"title":"NEON","file":"neon"},"nginx":{"title":"nginx","file":"nginx"},"nim":{"title":"Nim","file":"nim"},"nix":{"title":"Nix","file":"nix"},"nsis":{"title":"NSIS","file":"nsis"},"objectivec":{"title":"Objective-C","file":"objectivec"},"ocaml":{"title":"OCaml","file":"ocaml"},"opencl":{"title":"OpenCL","file":"opencl"},"oz":{"title":"Oz","file":"oz"},"parigp":{"title":"PARI/GP","file":"parigp"},"parser":{"title":"Parser","file":"parser"},"pascal":{"title":"Pascal","file":"pascal"},"pascaligo":{"title":"Pascaligo","file":"pascaligo"},"pcaxis":{"title":"PC-Axis","file":"pcaxis"},"peoplecode":{"title":"PeopleCode","file":"peoplecode"},"perl":{"title":"Perl","file":"perl"},"php":{"title":"PHP","file":"php"},"phpdoc":{"title":"PHPDoc","file":"phpdoc"},"php-extras":{"title":"PHP Extras","file":"php-extras"},"plsql":{"title":"PL/SQL","file":"plsql"},"powerquery":{"title":"PowerQuery","file":"powerquery"},"powershell":{"title":"PowerShell","file":"powershell"},"processing":{"title":"Processing","file":"processing"},"prolog":{"title":"Prolog","file":"prolog"},"properties":{"title":".properties","file":"properties"},"protobuf":{"title":"Protocol Buffers","file":"protobuf"},"pug":{"title":"Pug","file":"pug"},"puppet":{"title":"Puppet","file":"puppet"},"pure":{"title":"Pure","file":"pure"},"purebasic":{"title":"PureBasic","file":"purebasic"},"python":{"title":"Python","file":"python"},"q":{"title":"Q (kdb+ database)","file":"q"},"qml":{"title":"QML","file":"qml"},"qore":{"title":"Qore","file":"qore"},"r":{"title":"R","file":"r"},"racket":{"title":"Racket","file":"racket"},"jsx":{"title":"React JSX","file":"jsx"},"tsx":{"title":"React TSX","file":"tsx"},"reason":{"title":"Reason","file":"reason"},"regex":{"title":"Regex","file":"regex"},"renpy":{"title":"Ren'py","file":"renpy"},"rest":{"title":"reST (reStructuredText)","file":"rest"},"rip":{"title":"Rip","file":"rip"},"roboconf":{"title":"Roboconf","file":"roboconf"},"robotframework":{"title":"Robot Framework","file":"robotframework"},"ruby":{"title":"Ruby","file":"ruby"},"rust":{"title":"Rust","file":"rust"},"sas":{"title":"SAS","file":"sas"},"sass":{"title":"Sass (Sass)","file":"sass"},"scss":{"title":"Sass (Scss)","file":"scss"},"scala":{"title":"Scala","file":"scala"},"scheme":{"title":"Scheme","file":"scheme"},"shell-session":{"title":"Shell session","file":"shell-session"},"smali":{"title":"Smali","file":"smali"},"smalltalk":{"title":"Smalltalk","file":"smalltalk"},"smarty":{"title":"Smarty","file":"smarty"},"solidity":{"title":"Solidity (Ethereum)","file":"solidity"},"solution-file":{"title":"Solution file","file":"solution-file"},"soy":{"title":"Soy (Closure Template)","file":"soy"},"sparql":{"title":"SPARQL","file":"sparql"},"splunk-spl":{"title":"Splunk SPL","file":"splunk-spl"},"sqf":{"title":"SQF: Status Quo Function (Arma 3)","file":"sqf"},"sql":{"title":"SQL","file":"sql"},"iecst":{"title":"Structured Text (IEC 61131-3)","file":"iecst"},"stylus":{"title":"Stylus","file":"stylus"},"swift":{"title":"Swift","file":"swift"},"t4-templating":{"title":"T4 templating","file":"t4-templating"},"t4-cs":{"title":"T4 Text Templates (C#)","file":"t4-cs"},"t4-vb":{"title":"T4 Text Templates (VB)","file":"t4-vb"},"tap":{"title":"TAP","file":"tap"},"tcl":{"title":"Tcl","file":"tcl"},"tt2":{"title":"Template Toolkit 2","file":"tt2"},"textile":{"title":"Textile","file":"textile"},"toml":{"title":"TOML","file":"toml"},"turtle":{"title":"Turtle","file":"turtle"},"twig":{"title":"Twig","file":"twig"},"typescript":{"title":"TypeScript","file":"typescript"},"unrealscript":{"title":"UnrealScript","file":"unrealscript"},"vala":{"title":"Vala","file":"vala"},"vbnet":{"title":"VB.Net","file":"vbnet"},"velocity":{"title":"Velocity","file":"velocity"},"verilog":{"title":"Verilog","file":"verilog"},"vhdl":{"title":"VHDL","file":"vhdl"},"vim":{"title":"vim","file":"vim"},"visual-basic":{"title":"Visual Basic","file":"visual-basic"},"vba":{"title":"VBA","file":"visual-basic"},"warpscript":{"title":"WarpScript","file":"warpscript"},"wasm":{"title":"WebAssembly","file":"wasm"},"wiki":{"title":"Wiki markup","file":"wiki"},"xeora":{"title":"Xeora","file":"xeora"},"xml-doc":{"title":"XML doc (.net)","file":"xml-doc"},"xojo":{"title":"Xojo (REALbasic)","file":"xojo"},"xquery":{"title":"XQuery","file":"xquery"},"yaml":{"title":"YAML","file":"yaml"},"yang":{"title":"YANG","file":"yang"},"zig":{"title":"Zig","file":"zig"}}/*END*/;}); \ No newline at end of file diff --git a/wcfsetup/install/files/js/3rdParty/prism/prism.js b/wcfsetup/install/files/js/3rdParty/prism/prism.js index 40064e501e..24c3b77a1c 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/prism.js +++ b/wcfsetup/install/files/js/3rdParty/prism/prism.js @@ -3,6 +3,8 @@ Begin prism-core.js ********************************************** */ +/// + var _self = (typeof window !== 'undefined') ? window // if in browser : ( @@ -13,10 +15,12 @@ var _self = (typeof window !== 'undefined') /** * Prism: Lightweight, robust, elegant syntax highlighting - * MIT license http://www.opensource.org/licenses/mit-license.php/ - * @author Lea Verou http://lea.verou.me + * + * @license MIT + * @author Lea Verou + * @namespace + * @public */ - var Prism = (function (_self){ // Private helper vars @@ -25,8 +29,39 @@ var uniqueId = 0; var _ = { + /** + * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the + * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load + * additional languages or plugins yourself. + * + * By setting this value to `true`, Prism will not automatically highlight all code elements on the page. + * + * You obviously have to change this value before the automatic highlighting started. To do this, you can add an + * empty Prism object into the global scope before loading the Prism script like this: + * + * ```js + * window.Prism = window.Prism || {}; + * Prism.manual = true; + * // add a new