Added support for UnrealScript (#2305)

This commit is contained in:
Michael Schmidt 2020-04-27 22:33:02 +02:00 committed by GitHub
parent bd4d8165fb
commit 1093ceb31d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 584 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -1068,6 +1068,11 @@
"title": "T4 templating",
"owner": "RunDevelopment"
},
"unrealscript": {
"title": "UnrealScript",
"alias": ["uscript", "uc"],
"owner": "RunDevelopment"
},
"vala": {
"title": "Vala",
"require": "clike",

View File

@ -0,0 +1,42 @@
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;

1
components/prism-unrealscript.min.js vendored Normal file
View File

@ -0,0 +1 @@
Prism.languages.unrealscript={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},category:{pattern:/(\b(?:(?:autoexpand|hide|show)categories|var)\s*\()[^()]+(?=\))/,lookbehind:!0,greedy:!0,alias:"property"},metadata:{pattern:/(\w\s*)<\s*\w+\s*=[^<>|=\r\n]+(?:\|\s*\w+\s*=[^<>|=\r\n]+)*>/,lookbehind:!0,greedy:!0,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:!0},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,operator:/>>|<<|--|\+\+|\*\*|[-+*/~!=<>$@]=?|&&?|\|\|?|\^\^?|[?:%]|\b(?:Cross|Dot|ClockwiseFrom)\b/,punctuation:/[()[\]{};,.]/},Prism.languages.uc=Prism.languages.uscript=Prism.languages.unrealscript;

View File

@ -0,0 +1,38 @@
<h2>Full example</h2>
<pre><code>// Source: https://github.com/Jusas/XCOM2_ReconSoldierClass/blob/master/ReconOperatorSoldierClass/Src/ReconSoldierClass/Classes/ReconOperator_AcademyUnlocks.uc
class ReconOperator_AcademyUnlocks extends X2StrategyElement;
static function array&lt;X2DataTemplate> CreateTemplates()
{
local array&lt;X2DataTemplate> Templates;
Templates.AddItem(AdrenalineUnlock());
return Templates;
}
static function X2SoldierAbilityUnlockTemplate AdrenalineUnlock()
{
local X2SoldierAbilityUnlockTemplate Template;
local ArtifactCost Resources;
`CREATE_X2TEMPLATE(class'X2SoldierAbilityUnlockTemplate', Template, 'ReconAdrenalineUnlock');
Template.AllowedClasses.AddItem('ReconSoldierClass');
Template.AbilityName = 'ReconAdrenalineSpike';
Template.strImage = "img:///UILibrary_ReconOperator.GTS.GTS_adrenaline";
// Requirements
Template.Requirements.RequiredHighestSoldierRank = 5;
Template.Requirements.RequiredSoldierClass = 'ReconSoldierClass';
Template.Requirements.RequiredSoldierRankClassCombo = true;
Template.Requirements.bVisibleIfSoldierRankGatesNotMet = true;
// Cost
Resources.ItemTemplateName = 'Supplies';
Resources.Quantity = 75;
Template.Cost.ResourceCosts.AddItem(Resources);
return Template;
}</code></pre>

View File

@ -187,6 +187,8 @@
"trig": "turtle",
"ts": "typescript",
"t4": "t4-cs",
"uscript": "unrealscript",
"uc": "unrealscript",
"vb": "visual-basic",
"xeoracube": "xeora",
"yml": "yaml"

View File

@ -1 +1 @@
!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var c={javascript:"clike",actionscript:"javascript",arduino:"cpp",aspnet:["markup","csharp"],bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",django:"markup-templating",ejs:["javascript","markup-templating"],etlua:["lua","markup-templating"],erb:["ruby","markup-templating"],fsharp:"clike","firestore-security-rules":"clike",flow:"javascript",ftl:"markup-templating",glsl:"clike",gml:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",java:"clike",javadoc:["markup","java","javadoclike"],jolie:"clike",jsdoc:["javascript","javadoclike"],"js-extras":"javascript","js-templates":"javascript",jsonp:"json",json5:"json",kotlin:"clike",latte:["clike","markup-templating","php"],less:"css",lilypond:"scheme",markdown:"markup","markup-templating":"markup",n4js:"javascript",nginx:"clike",objectivec:"c",opencl:"c",parser:"markup",php:["clike","markup-templating"],phpdoc:["php","javadoclike"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:["markup","javascript"],qml:"javascript",qore:"clike",jsx:["markup","javascript"],tsx:["jsx","typescript"],reason:"clike",ruby:"clike",sass:"css",scss:"css",scala:"java","shell-session":"bash",smarty:"markup-templating",solidity:"clike",soy:"markup-templating",sparql:"turtle",sqf:"clike",swift:"clike",tap:"yaml",textile:"markup",tt2:["clike","markup-templating"],twig:"markup",typescript:"javascript","t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","visual-basic"],vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup",xquery:"markup"},l={html:"markup",xml:"markup",svg:"markup",mathml:"markup",js:"javascript",g4:"antlr4",adoc:"asciidoc",shell:"bash",shortcode:"bbcode",rbnf:"bnf",conc:"concurnas",cs:"csharp",dotnet:"csharp",coffee:"coffeescript",jinja2:"django","dns-zone":"dns-zone-file",dockerfile:"docker",eta:"ejs",xlsx:"excel-formula",xls:"excel-formula",gamemakerlanguage:"gml",hs:"haskell",tex:"latex",context:"latex",ly:"lilypond",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",moon:"moonscript",n4jsd:"n4js",objc:"objectivec",objectpascal:"pascal",px:"pcaxis",pcode:"peoplecode",pq:"powerquery",mscript:"powerquery",py:"python",robot:"robotframework",rb:"ruby",sln:"solution-file",rq:"sparql",trig:"turtle",ts:"typescript",t4:"t4-cs",vb:"visual-basic",xeoracube:"xeora",yml:"yaml"},n={},e="components/",a=Prism.util.currentScript();if(a){var t=/\bplugins\/autoloader\/prism-autoloader\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,r=/(^|\/)[\w-]+\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,s=a.getAttribute("data-autoloader-path");if(null!=s)e=s.trim().replace(/\/?$/,"/");else{var i=a.src;t.test(i)?e=i.replace(t,"components/"):r.test(i)&&(e=i.replace(r,"$1components/"))}}var p=Prism.plugins.autoloader={languages_path:e,use_minified:!0,loadLanguages:o};Prism.hooks.add("complete",function(e){e.element&&e.language&&!e.grammar&&"none"!==e.language&&function(e,a){e in l&&(e=l[e]);var t=(a.getAttribute("data-dependencies")||"").trim();if(!t){var r=a.parentElement;r&&"pre"===r.tagName.toLowerCase()&&(t=(r.getAttribute("data-dependencies")||"").trim())}o(t?t.split(/\s*,\s*/g):[],function(){m(e,function(){Prism.highlightElement(a)})})}(e.language,e.element)})}function o(e,a,t){"string"==typeof e&&(e=[e]);var r=e.length,s=0,i=!1;function c(){i||++s===r&&a&&a(e)}0!==r?e.forEach(function(e){m(e,c,function(){i||(i=!0,t&&t(e))})}):a&&setTimeout(a,0)}function m(a,t,r){var s=0<=a.indexOf("!");a=a.replace("!",""),a=l[a]||a;var e=function(){var e=n[a];if(e||(e=n[a]={callbacks:[]}),e.callbacks.push({success:t,error:r}),!s&&Prism.languages[a])u(a,"success");else if(!s&&e.error)u(a,"error");else if(s||!e.loading){e.loading=!0,function(e,a,t){var r=document.createElement("script");r.src=e,r.async=!0,r.onload=function(){document.body.removeChild(r),a&&a()},r.onerror=function(){document.body.removeChild(r),t&&t()},document.body.appendChild(r)}(function(e){return p.languages_path+"prism-"+e+(p.use_minified?".min":"")+".js"}(a),function(){e.loading=!1,u(a,"success")},function(){e.loading=!1,e.error=!0,u(a,"error")})}},i=c[a];i&&i.length?o(i,e,r):e()}function u(e,a){if(n[e]){for(var t=n[e].callbacks,r=0,s=t.length;r<s;r++){var i=t[r][a];i&&setTimeout(i,0)}t.length=0}}}();
!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var c={javascript:"clike",actionscript:"javascript",arduino:"cpp",aspnet:["markup","csharp"],bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",django:"markup-templating",ejs:["javascript","markup-templating"],etlua:["lua","markup-templating"],erb:["ruby","markup-templating"],fsharp:"clike","firestore-security-rules":"clike",flow:"javascript",ftl:"markup-templating",glsl:"clike",gml:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",java:"clike",javadoc:["markup","java","javadoclike"],jolie:"clike",jsdoc:["javascript","javadoclike"],"js-extras":"javascript","js-templates":"javascript",jsonp:"json",json5:"json",kotlin:"clike",latte:["clike","markup-templating","php"],less:"css",lilypond:"scheme",markdown:"markup","markup-templating":"markup",n4js:"javascript",nginx:"clike",objectivec:"c",opencl:"c",parser:"markup",php:["clike","markup-templating"],phpdoc:["php","javadoclike"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:["markup","javascript"],qml:"javascript",qore:"clike",jsx:["markup","javascript"],tsx:["jsx","typescript"],reason:"clike",ruby:"clike",sass:"css",scss:"css",scala:"java","shell-session":"bash",smarty:"markup-templating",solidity:"clike",soy:"markup-templating",sparql:"turtle",sqf:"clike",swift:"clike",tap:"yaml",textile:"markup",tt2:["clike","markup-templating"],twig:"markup",typescript:"javascript","t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","visual-basic"],vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup",xquery:"markup"},l={html:"markup",xml:"markup",svg:"markup",mathml:"markup",js:"javascript",g4:"antlr4",adoc:"asciidoc",shell:"bash",shortcode:"bbcode",rbnf:"bnf",conc:"concurnas",cs:"csharp",dotnet:"csharp",coffee:"coffeescript",jinja2:"django","dns-zone":"dns-zone-file",dockerfile:"docker",eta:"ejs",xlsx:"excel-formula",xls:"excel-formula",gamemakerlanguage:"gml",hs:"haskell",tex:"latex",context:"latex",ly:"lilypond",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",moon:"moonscript",n4jsd:"n4js",objc:"objectivec",objectpascal:"pascal",px:"pcaxis",pcode:"peoplecode",pq:"powerquery",mscript:"powerquery",py:"python",robot:"robotframework",rb:"ruby",sln:"solution-file",rq:"sparql",trig:"turtle",ts:"typescript",t4:"t4-cs",uscript:"unrealscript",uc:"unrealscript",vb:"visual-basic",xeoracube:"xeora",yml:"yaml"},n={},e="components/",a=Prism.util.currentScript();if(a){var t=/\bplugins\/autoloader\/prism-autoloader\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,r=/(^|\/)[\w-]+\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,s=a.getAttribute("data-autoloader-path");if(null!=s)e=s.trim().replace(/\/?$/,"/");else{var i=a.src;t.test(i)?e=i.replace(t,"components/"):r.test(i)&&(e=i.replace(r,"$1components/"))}}var p=Prism.plugins.autoloader={languages_path:e,use_minified:!0,loadLanguages:o};Prism.hooks.add("complete",function(e){e.element&&e.language&&!e.grammar&&"none"!==e.language&&function(e,a){e in l&&(e=l[e]);var t=(a.getAttribute("data-dependencies")||"").trim();if(!t){var r=a.parentElement;r&&"pre"===r.tagName.toLowerCase()&&(t=(r.getAttribute("data-dependencies")||"").trim())}o(t?t.split(/\s*,\s*/g):[],function(){u(e,function(){Prism.highlightElement(a)})})}(e.language,e.element)})}function o(e,a,t){"string"==typeof e&&(e=[e]);var r=e.length,s=0,i=!1;function c(){i||++s===r&&a&&a(e)}0!==r?e.forEach(function(e){u(e,c,function(){i||(i=!0,t&&t(e))})}):a&&setTimeout(a,0)}function u(a,t,r){var s=0<=a.indexOf("!");a=a.replace("!",""),a=l[a]||a;var e=function(){var e=n[a];if(e||(e=n[a]={callbacks:[]}),e.callbacks.push({success:t,error:r}),!s&&Prism.languages[a])m(a,"success");else if(!s&&e.error)m(a,"error");else if(s||!e.loading){e.loading=!0,function(e,a,t){var r=document.createElement("script");r.src=e,r.async=!0,r.onload=function(){document.body.removeChild(r),a&&a()},r.onerror=function(){document.body.removeChild(r),t&&t()},document.body.appendChild(r)}(function(e){return p.languages_path+"prism-"+e+(p.use_minified?".min":"")+".js"}(a),function(){e.loading=!1,m(a,"success")},function(){e.loading=!1,e.error=!0,m(a,"error")})}},i=c[a];i&&i.length?o(i,e,r):e()}function m(e,a){if(n[e]){for(var t=n[e].callbacks,r=0,s=t.length;r<s;r++){var i=t[r][a];i&&setTimeout(i,0)}t.length=0}}}();

View File

@ -164,6 +164,8 @@
"t4": "T4 Text Templates (C#)",
"t4-vb": "T4 Text Templates (VB)",
"t4-templating": "T4 templating",
"uscript": "UnrealScript",
"uc": "UnrealScript",
"vbnet": "VB.Net",
"vhdl": "VHDL",
"vim": "vim",

View File

@ -1 +1 @@
!function(){if("undefined"!=typeof self&&self.Prism&&self.document)if(Prism.plugins.toolbar){var r={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"Augmented BackusNaur form",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"BackusNaur form",rbnf:"Routing BackusNaur form",conc:"Concurnas",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",coffee:"CoffeeScript",cmake:"CMake",csp:"Content-Security-Policy","css-extras":"CSS Extras",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",ebnf:"Extended BackusNaur form",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",iecst:"Structured Text (IEC 61131-3)",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras","js-templates":"JS Templates",json:"JSON",jsonp:"JSONP",json5:"JSON5",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",py:"Python",q:"Q (kdb+ database)",qml:"QML",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session",solidity:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",tap:"TAP",toml:"TOML",tt2:"Template Toolkit 2",trig:"TriG",ts:"TypeScript","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)","t4-templating":"T4 templating",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML"};Prism.plugins.toolbar.registerButton("show-language",function(e){var a=e.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,o=a.getAttribute("data-language")||r[e.language]||((t=e.language)?(t.substring(0,1).toUpperCase()+t.substring(1)).replace(/s(?=cript)/,"S"):t);if(o){var s=document.createElement("span");return s.textContent=o,s}}})}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}();
!function(){if("undefined"!=typeof self&&self.Prism&&self.document)if(Prism.plugins.toolbar){var r={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"Augmented BackusNaur form",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"BackusNaur form",rbnf:"Routing BackusNaur form",conc:"Concurnas",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",coffee:"CoffeeScript",cmake:"CMake",csp:"Content-Security-Policy","css-extras":"CSS Extras",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",ebnf:"Extended BackusNaur form",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",iecst:"Structured Text (IEC 61131-3)",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras","js-templates":"JS Templates",json:"JSON",jsonp:"JSONP",json5:"JSON5",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",lolcode:"LOLCODE",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",py:"Python",q:"Q (kdb+ database)",qml:"QML",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)","shell-session":"Shell session",solidity:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",tap:"TAP",toml:"TOML",tt2:"Template Toolkit 2",trig:"TriG",ts:"TypeScript","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)","t4-templating":"T4 templating",uscript:"UnrealScript",uc:"UnrealScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML"};Prism.plugins.toolbar.registerButton("show-language",function(e){var a=e.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,s=a.getAttribute("data-language")||r[e.language]||((t=e.language)?(t.substring(0,1).toUpperCase()+t.substring(1)).replace(/s(?=cript)/,"S"):t);if(s){var o=document.createElement("span");return o.textContent=s,o}}})}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}();

View File

@ -0,0 +1,13 @@
false
true
----------------------------------------------------
[
["boolean", "false"],
["boolean", "true"]
]
----------------------------------------------------
Checks for booleans.

View File

@ -0,0 +1,51 @@
class Foo extends Bar;
struct Baz {};
enum FooBar {};
interface IFoo extends IBar;
state Action {}
state() Defense {}
----------------------------------------------------
[
["keyword", "class"],
["class-name", "Foo"],
["keyword", "extends"],
["class-name", "Bar"],
["punctuation", ";"],
["keyword", "struct"],
["class-name", "Baz"],
["punctuation", "{"],
["punctuation", "}"],
["punctuation", ";"],
["keyword", "enum"],
["class-name", "FooBar"],
["punctuation", "{"],
["punctuation", "}"],
["punctuation", ";"],
["keyword", "interface"],
["class-name", "IFoo"],
["keyword", "extends"],
["class-name", "IBar"],
["punctuation", ";"],
["keyword", "state"],
["class-name", "Action"],
["punctuation", "{"],
["punctuation", "}"],
["keyword", "state"],
["punctuation", "("],
["punctuation", ")"],
["class-name", "Defense"],
["punctuation", "{"],
["punctuation", "}"]
]
----------------------------------------------------
Checks for class names.

View File

@ -0,0 +1,16 @@
// comment
/*
comment
*/
----------------------------------------------------
[
["comment", "// comment"],
["comment", "/*\r\n comment\r\n*/"]
]
----------------------------------------------------
Checks for comments.

View File

@ -0,0 +1,204 @@
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;
----------------------------------------------------
[
["keyword", "abstract"],
["keyword", "actor"],
["keyword", "array"],
["keyword", "auto"],
["keyword", "autoexpandcategories"],
["keyword", "bool"],
["keyword", "break"],
["keyword", "byte"],
["keyword", "case"],
["keyword", "class"],
["punctuation", ";"],
["keyword", "classgroup"],
["keyword", "client"],
["keyword", "coerce"],
["keyword", "collapsecategories"],
["keyword", "config"],
["keyword", "const"],
["keyword", "continue"],
["keyword", "default"],
["keyword", "defaultproperties"],
["keyword", "delegate"],
["keyword", "dependson"],
["keyword", "deprecated"],
["keyword", "do"],
["keyword", "dontcollapsecategories"],
["keyword", "editconst"],
["keyword", "editinlinenew"],
["keyword", "else"],
["keyword", "enum"],
["punctuation", ";"],
["keyword", "event"],
["keyword", "exec"],
["keyword", "export"],
["keyword", "extends"],
["punctuation", ";"],
["keyword", "final"],
["keyword", "float"],
["keyword", "for"],
["keyword", "forcescriptorder"],
["keyword", "foreach"],
["keyword", "function"],
["keyword", "goto"],
["keyword", "guid"],
["keyword", "hidecategories"],
["keyword", "hidedropdown"],
["keyword", "if"],
["keyword", "ignores"],
["keyword", "implements"],
["keyword", "inherits"],
["keyword", "input"],
["keyword", "int"],
["keyword", "interface"],
["punctuation", ";"],
["keyword", "iterator"],
["keyword", "latent"],
["keyword", "local"],
["keyword", "material"],
["keyword", "name"],
["keyword", "native"],
["keyword", "nativereplication"],
["keyword", "noexport"],
["keyword", "nontransient"],
["keyword", "noteditinlinenew"],
["keyword", "notplaceable"],
["keyword", "operator"],
["keyword", "optional"],
["keyword", "out"],
["keyword", "pawn"],
["keyword", "perobjectconfig"],
["keyword", "perobjectlocalized"],
["keyword", "placeable"],
["keyword", "postoperator"],
["keyword", "preoperator"],
["keyword", "private"],
["keyword", "protected"],
["keyword", "reliable"],
["keyword", "replication"],
["keyword", "return"],
["keyword", "server"],
["keyword", "showcategories"],
["keyword", "simulated"],
["keyword", "singular"],
["keyword", "state"],
["punctuation", ";"],
["keyword", "static"],
["keyword", "string"],
["keyword", "struct"],
["punctuation", ";"],
["keyword", "structdefault"],
["keyword", "structdefaultproperties"],
["keyword", "switch"],
["keyword", "texture"],
["keyword", "transient"],
["keyword", "travel"],
["keyword", "unreliable"],
["keyword", "until"],
["keyword", "var"],
["keyword", "vector"],
["keyword", "while"],
["keyword", "within"],
["punctuation", ";"]
]
----------------------------------------------------
Checks for keywords.

View File

@ -0,0 +1,15 @@
`log("foo");
----------------------------------------------------
[
["macro", "`log"],
["punctuation", "("],
["string", "\"foo\""],
["punctuation", ")"],
["punctuation", ";"]
]
----------------------------------------------------
Checks for macros.

View File

@ -0,0 +1,87 @@
var float MyVar<TAG=VALUE>;
enum EMyEnum
{
EME_ValA<TAG=VALUE>,
EME_ValB<TAG=VALUE>,
};
var() LinearColor DrawColor<DisplayName=Draw Color|EditCondition=bOverrideDrawColor>;
// not metadata
var array<class<Foo>> Bar;
----------------------------------------------------
[
["keyword", "var"],
["keyword", "float"],
" MyVar",
["metadata", [
["punctuation", "<"],
["property", "TAG"],
["operator", "="],
"VALUE",
["punctuation", ">"]
]],
["punctuation", ";"],
["keyword", "enum"],
["class-name", "EMyEnum"],
["punctuation", "{"],
"\r\n\tEME_ValA",
["metadata", [
["punctuation", "<"],
["property", "TAG"],
["operator", "="],
"VALUE",
["punctuation", ">"]
]],
["punctuation", ","],
"\r\n\tEME_ValB",
["metadata", [
["punctuation", "<"],
["property", "TAG"],
["operator", "="],
"VALUE",
["punctuation", ">"]
]],
["punctuation", ","],
["punctuation", "}"],
["punctuation", ";"],
["keyword", "var"],
["punctuation", "("],
["punctuation", ")"],
" LinearColor DrawColor",
["metadata", [
["punctuation", "<"],
["property", "DisplayName"],
["operator", "="],
"Draw Color",
["punctuation", "|"],
["property", "EditCondition"],
["operator", "="],
"bOverrideDrawColor",
["punctuation", ">"]
]],
["punctuation", ";"],
["comment", "// not metadata"],
["keyword", "var"],
["keyword", "array"],
["operator", "<"],
["keyword", "class"],
["operator", "<"],
"Foo",
["operator", ">>"],
" Bar",
["punctuation", ";"]
]
----------------------------------------------------
Checks for metadata.

View File

@ -0,0 +1,16 @@
123
123e+5
0xFFFF
----------------------------------------------------
[
["number", "123"],
["number", "123e+5"],
["number", "0xFFFF"]
]
----------------------------------------------------
Checks for numbers.

View File

@ -0,0 +1,70 @@
+ - * / % **
+= -= *= /=
++ --
~ && || ^^
! & | ^ << >>
> >= < <= == != ~=
$ $= @ @=
=
? :
Cross Dot ClockwiseFrom
----------------------------------------------------
[
["operator", "+"],
["operator", "-"],
["operator", "*"],
["operator", "/"],
["operator", "%"],
["operator", "**"],
["operator", "+="],
["operator", "-="],
["operator", "*="],
["operator", "/="],
["operator", "++"],
["operator", "--"],
["operator", "~"],
["operator", "&&"],
["operator", "||"],
["operator", "^^"],
["operator", "!"],
["operator", "&"],
["operator", "|"],
["operator", "^"],
["operator", "<<"],
["operator", ">>"],
["operator", ">"],
["operator", ">="],
["operator", "<"],
["operator", "<="],
["operator", "=="],
["operator", "!="],
["operator", "~="],
["operator", "$"],
["operator", "$="],
["operator", "@"],
["operator", "@="],
["operator", "="],
["operator", "?"],
["operator", ":"],
["operator", "Cross"],
["operator", "Dot"],
["operator", "ClockwiseFrom"]
]
----------------------------------------------------
Checks for operators.

View File

@ -0,0 +1,19 @@
""
"foo"
''
'foo'
----------------------------------------------------
[
["string", "\"\""],
["string", "\"foo\""],
["string", "''"],
["string", "'foo'"]
]
----------------------------------------------------
Checks for strings.