Added PureScript language definition (#2526)
This commit is contained in:
parent
e023044c1b
commit
ad748a001e
File diff suppressed because one or more lines are too long
|
@ -913,6 +913,12 @@
|
|||
"alias": "pbfasm",
|
||||
"owner": "HeX0R101"
|
||||
},
|
||||
"purescript": {
|
||||
"title": "PureScript",
|
||||
"require": "haskell",
|
||||
"alias": "purs",
|
||||
"owner": "sriharshachilakapati"
|
||||
},
|
||||
"python": {
|
||||
"title": "Python",
|
||||
"alias": "py",
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Prism.languages.purescript = Prism.languages.extend('haskell', {
|
||||
'keyword': /\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,
|
||||
|
||||
'import-statement': {
|
||||
// The imported or hidden names are not included in this import
|
||||
// statement. This is because we want to highlight those exactly like
|
||||
// we do for the names in the program.
|
||||
pattern: /(^\s*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'keyword': /\b(?:import|as|hiding)\b/
|
||||
}
|
||||
},
|
||||
|
||||
// These are builtin functions only. Constructors are highlighted later as a constant.
|
||||
'builtin': /\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/,
|
||||
});
|
||||
|
||||
Prism.languages.purs = Prism.languages.purescript;
|
|
@ -0,0 +1 @@
|
|||
Prism.languages.purescript=Prism.languages.extend("haskell",{keyword:/\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,"import-statement":{pattern:/(^\s*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:import|as|hiding)\b/}},builtin:/\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/}),Prism.languages.purs=Prism.languages.purescript;
|
|
@ -0,0 +1,57 @@
|
|||
<h2>Comments</h2>
|
||||
<pre><code>-- Single line comment
|
||||
{- Multi-line
|
||||
comment -}</code></pre>
|
||||
|
||||
<h2>Strings and characters</h2>
|
||||
<pre><code>'a'
|
||||
'\n'
|
||||
'\^A'
|
||||
'\^]'
|
||||
'\NUL'
|
||||
'\23'
|
||||
'\o75'
|
||||
'\xFE'
|
||||
"Here is a backslant \\ as well as \137, \
|
||||
\a numeric escape character, and \^X, a control character."</code></pre>
|
||||
|
||||
<h2>Numbers</h2>
|
||||
<pre><code>42
|
||||
123.456
|
||||
123.456e-789
|
||||
1e+3
|
||||
0o74
|
||||
0XAF</code></pre>
|
||||
|
||||
<h2>Full example</h2>
|
||||
<pre><code>module Codewars.Kata.SumFracts (sumFracts) where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Data.Foldable (foldl)
|
||||
import Data.BigInt (BigInt, fromInt, toString)
|
||||
import Data.List (List, length)
|
||||
import Data.Tuple (Tuple(..))
|
||||
import Data.Maybe (Maybe(..))
|
||||
import Data.Ord (abs, signum)
|
||||
|
||||
reduce :: Tuple BigInt BigInt -> Tuple BigInt BigInt
|
||||
reduce (Tuple num den) =
|
||||
let gcd' = gcd num den
|
||||
den' = den / gcd'
|
||||
in Tuple (num / gcd' * (signum den')) (abs den')
|
||||
|
||||
sumFracts :: List (Tuple Int Int) -> Maybe String
|
||||
sumFracts fracts =
|
||||
let fracts' = fracts <#> (\(Tuple n d) -> Tuple (fromInt n) (fromInt d)) >>> reduce
|
||||
|
||||
den = foldl (\acc (Tuple _ d) -> lcm acc d) one fracts'
|
||||
num = foldl (\acc (Tuple n d) -> acc + n * (den / d)) zero fracts'
|
||||
|
||||
Tuple n d = reduce $ Tuple num den
|
||||
|
||||
in if length fracts == 0
|
||||
then Nothing
|
||||
else if d == one
|
||||
then Just $ toString n
|
||||
else Just $ (toString n) >< " " >< (toString d)</code></pre>
|
|
@ -99,6 +99,7 @@
|
|||
"javascript"
|
||||
],
|
||||
"purebasic": "clike",
|
||||
"purescript": "haskell",
|
||||
"qml": "javascript",
|
||||
"qore": "clike",
|
||||
"racket": "scheme",
|
||||
|
@ -197,6 +198,7 @@
|
|||
"pq": "powerquery",
|
||||
"mscript": "powerquery",
|
||||
"pbfasm": "purebasic",
|
||||
"purs": "purescript",
|
||||
"py": "python",
|
||||
"rkt": "racket",
|
||||
"rpy": "renpy",
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var n={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",gml:"clike",glsl:"c",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",hlsl:"c",java:"clike",javadoc:["markup","java","javadoclike"],jolie:"clike",jsdoc:["javascript","javadoclike","typescript"],"js-extras":"javascript",json5:"json",jsonp:"json","js-templates":"javascript",kotlin:"clike",latte:["clike","markup-templating","php"],less:"css",lilypond:"scheme",markdown:"markup","markup-templating":"markup",mongodb:"javascript",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"],purebasic:"clike",qml:"javascript",qore:"clike",racket:"scheme",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","t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","vbnet"],tap:"yaml",tt2:["clike","markup-templating"],textile:"markup",twig:"markup",typescript:"javascript",vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup","xml-doc":"markup",xquery:"markup"},l={html:"markup",xml:"markup",svg:"markup",mathml:"markup",ssml:"markup",atom:"markup",rss:"markup",js:"javascript",g4:"antlr4",adoc:"asciidoc",shell:"bash",shortcode:"bbcode",rbnf:"bnf",oscript:"bsl",cs:"csharp",dotnet:"csharp",coffee:"coffeescript",conc:"concurnas",jinja2:"django","dns-zone":"dns-zone-file",dockerfile:"docker",eta:"ejs",xlsx:"excel-formula",xls:"excel-formula",gamemakerlanguage:"gml",hs:"haskell",gitignore:"ignore",hgignore:"ignore",npmignore:"ignore",webmanifest:"json",kt:"kotlin",kts:"kotlin",tex:"latex",context:"latex",ly:"lilypond",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",moon:"moonscript",n4jsd:"n4js",nani:"naniscript",objc:"objectivec",objectpascal:"pascal",px:"pcaxis",pcode:"peoplecode",pq:"powerquery",mscript:"powerquery",pbfasm:"purebasic",py:"python",rkt:"racket",rpy:"renpy",robot:"robotframework",rb:"ruby",sol:"solidity",sln:"solution-file",rq:"sparql",t4:"t4-cs",trig:"turtle",ts:"typescript",tsconfig:"typoscript",uscript:"unrealscript",uc:"unrealscript",vb:"visual-basic",vba:"visual-basic",xeoracube:"xeora",yml:"yaml"},p={},e="components/",a=Prism.util.currentScript();if(a){var r=/\bplugins\/autoloader\/prism-autoloader\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,t=/(^|\/)[\w-]+\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,i=a.getAttribute("data-autoloader-path");if(null!=i)e=i.trim().replace(/\/?$/,"/");else{var s=a.src;r.test(s)?e=s.replace(r,"components/"):t.test(s)&&(e=s.replace(t,"$1components/"))}}var o=Prism.plugins.autoloader={languages_path:e,use_minified:!0,loadLanguages:m};Prism.hooks.add("complete",function(e){var a=e.element,r=e.language;if(a&&r&&"none"!==r){var t=function(e){var a=(e.getAttribute("data-dependencies")||"").trim();if(!a){var r=e.parentElement;r&&"pre"===r.tagName.toLowerCase()&&(a=(r.getAttribute("data-dependencies")||"").trim())}return a?a.split(/\s*,\s*/g):[]}(a);t.push(r),t.every(u)||m(t,function(){Prism.highlightElement(a)})}})}function u(e){if(0<=e.indexOf("!"))return!1;if((e=l[e]||e)in Prism.languages)return!0;var a=p[e];return a&&!a.error&&!1===a.loading}function m(e,a,r){"string"==typeof e&&(e=[e]);var t=e.length,i=0,s=!1;function c(){s||++i===t&&a&&a(e)}0!==t?e.forEach(function(e){!function(a,r,t){var i=0<=a.indexOf("!");function e(){var e=p[a];e||(e=p[a]={callbacks:[]}),e.callbacks.push({success:r,error:t}),!i&&u(a)?k(a,"success"):!i&&e.error?k(a,"error"):!i&&e.loading||(e.loading=!0,e.error=!1,function(e,a,r){var t=document.createElement("script");t.src=e,t.async=!0,t.onload=function(){document.body.removeChild(t),a&&a()},t.onerror=function(){document.body.removeChild(t),r&&r()},document.body.appendChild(t)}(function(e){return o.languages_path+"prism-"+e+(o.use_minified?".min":"")+".js"}(a),function(){e.loading=!1,k(a,"success")},function(){e.loading=!1,e.error=!0,k(a,"error")}))}a=a.replace("!",""),a=l[a]||a;var s=n[a];s&&s.length?m(s,e,t):e()}(e,c,function(){s||(s=!0,r&&r(e))})}):a&&setTimeout(a,0)}function k(e,a){if(p[e]){for(var r=p[e].callbacks,t=0,i=r.length;t<i;t++){var s=r[t][a];s&&setTimeout(s,0)}r.length=0}}}();
|
||||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var l={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",gml:"clike",glsl:"c",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",hlsl:"c",java:"clike",javadoc:["markup","java","javadoclike"],jolie:"clike",jsdoc:["javascript","javadoclike","typescript"],"js-extras":"javascript",json5:"json",jsonp:"json","js-templates":"javascript",kotlin:"clike",latte:["clike","markup-templating","php"],less:"css",lilypond:"scheme",markdown:"markup","markup-templating":"markup",mongodb:"javascript",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"],purebasic:"clike",purescript:"haskell",qml:"javascript",qore:"clike",racket:"scheme",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","t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","vbnet"],tap:"yaml",tt2:["clike","markup-templating"],textile:"markup",twig:"markup",typescript:"javascript",vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup","xml-doc":"markup",xquery:"markup"},n={html:"markup",xml:"markup",svg:"markup",mathml:"markup",ssml:"markup",atom:"markup",rss:"markup",js:"javascript",g4:"antlr4",adoc:"asciidoc",shell:"bash",shortcode:"bbcode",rbnf:"bnf",oscript:"bsl",cs:"csharp",dotnet:"csharp",coffee:"coffeescript",conc:"concurnas",jinja2:"django","dns-zone":"dns-zone-file",dockerfile:"docker",eta:"ejs",xlsx:"excel-formula",xls:"excel-formula",gamemakerlanguage:"gml",hs:"haskell",gitignore:"ignore",hgignore:"ignore",npmignore:"ignore",webmanifest:"json",kt:"kotlin",kts:"kotlin",tex:"latex",context:"latex",ly:"lilypond",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",moon:"moonscript",n4jsd:"n4js",nani:"naniscript",objc:"objectivec",objectpascal:"pascal",px:"pcaxis",pcode:"peoplecode",pq:"powerquery",mscript:"powerquery",pbfasm:"purebasic",purs:"purescript",py:"python",rkt:"racket",rpy:"renpy",robot:"robotframework",rb:"ruby",sol:"solidity",sln:"solution-file",rq:"sparql",t4:"t4-cs",trig:"turtle",ts:"typescript",tsconfig:"typoscript",uscript:"unrealscript",uc:"unrealscript",vb:"visual-basic",vba:"visual-basic",xeoracube:"xeora",yml:"yaml"},p={},e="components/",a=Prism.util.currentScript();if(a){var r=/\bplugins\/autoloader\/prism-autoloader\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,t=/(^|\/)[\w-]+\.(?:min\.)js(?:\?[^\r\n/]*)?$/i,i=a.getAttribute("data-autoloader-path");if(null!=i)e=i.trim().replace(/\/?$/,"/");else{var s=a.src;r.test(s)?e=s.replace(r,"components/"):t.test(s)&&(e=s.replace(t,"$1components/"))}}var o=Prism.plugins.autoloader={languages_path:e,use_minified:!0,loadLanguages:m};Prism.hooks.add("complete",function(e){var a=e.element,r=e.language;if(a&&r&&"none"!==r){var t=function(e){var a=(e.getAttribute("data-dependencies")||"").trim();if(!a){var r=e.parentElement;r&&"pre"===r.tagName.toLowerCase()&&(a=(r.getAttribute("data-dependencies")||"").trim())}return a?a.split(/\s*,\s*/g):[]}(a);t.push(r),t.every(u)||m(t,function(){Prism.highlightElement(a)})}})}function u(e){if(0<=e.indexOf("!"))return!1;if((e=n[e]||e)in Prism.languages)return!0;var a=p[e];return a&&!a.error&&!1===a.loading}function m(e,a,r){"string"==typeof e&&(e=[e]);var t=e.length,i=0,s=!1;function c(){s||++i===t&&a&&a(e)}0!==t?e.forEach(function(e){!function(a,r,t){var i=0<=a.indexOf("!");function e(){var e=p[a];e||(e=p[a]={callbacks:[]}),e.callbacks.push({success:r,error:t}),!i&&u(a)?k(a,"success"):!i&&e.error?k(a,"error"):!i&&e.loading||(e.loading=!0,e.error=!1,function(e,a,r){var t=document.createElement("script");t.src=e,t.async=!0,t.onload=function(){document.body.removeChild(t),a&&a()},t.onerror=function(){document.body.removeChild(t),r&&r()},document.body.appendChild(t)}(function(e){return o.languages_path+"prism-"+e+(o.use_minified?".min":"")+".js"}(a),function(){e.loading=!1,k(a,"success")},function(){e.loading=!1,e.error=!0,k(a,"error")}))}a=a.replace("!",""),a=n[a]||a;var s=l[a];s&&s.length?m(s,e,t):e()}(e,c,function(){s||(s=!0,r&&r(e))})}):a&&setTimeout(a,0)}function k(e,a){if(p[e]){for(var r=p[e].callbacks,t=0,i=r.length;t<i;t++){var s=r[t][a];s&&setTimeout(s,0)}r.length=0}}}();
|
|
@ -150,6 +150,7 @@
|
|||
"protobuf": "Protocol Buffers",
|
||||
"purebasic": "PureBasic",
|
||||
"pbfasm": "PureBasic",
|
||||
"purs": "PureScript",
|
||||
"py": "Python",
|
||||
"q": "Q (kdb+ database)",
|
||||
"qml": "QML",
|
||||
|
|
|
@ -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",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",cmake:"CMake",coffee:"CoffeeScript",conc:"Concurnas",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:"EBNF",editorconfig:"EditorConfig",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",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",kts:"Kotlin Script",kt:"Kotlin",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",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",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",purebasic:"PureBasic",pbfasm:"PureBasic",py:"Python",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"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)",sol:"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",iecst:"Structured Text (IEC 61131-3)","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};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",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",arff:"ARFF",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cil:"CIL",cmake:"CMake",coffee:"CoffeeScript",conc:"Concurnas",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:"EBNF",editorconfig:"EditorConfig",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",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",kts:"Kotlin Script",kt:"Kotlin",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",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",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",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"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)",sol:"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",iecst:"Structured Text (IEC 61131-3)","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};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.")}();
|
|
@ -0,0 +1,109 @@
|
|||
when
|
||||
unless
|
||||
liftA1
|
||||
apply
|
||||
bind
|
||||
discard
|
||||
join
|
||||
ifM
|
||||
identity
|
||||
whenM
|
||||
unlessM
|
||||
liftM1
|
||||
ap
|
||||
compose
|
||||
otherwise
|
||||
top
|
||||
bottom
|
||||
recip
|
||||
eq
|
||||
notEq
|
||||
degree
|
||||
div
|
||||
mod
|
||||
lcm
|
||||
gcd
|
||||
flip
|
||||
const
|
||||
map
|
||||
void
|
||||
flap
|
||||
conj
|
||||
disj
|
||||
not
|
||||
mempty
|
||||
compare
|
||||
min
|
||||
max
|
||||
comparing
|
||||
clamp
|
||||
between
|
||||
sub
|
||||
negate
|
||||
append
|
||||
add
|
||||
zero
|
||||
mul
|
||||
one
|
||||
show
|
||||
unit
|
||||
absurd
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["builtin", "when"],
|
||||
["builtin", "unless"],
|
||||
["builtin", "liftA1"],
|
||||
["builtin", "apply"],
|
||||
["builtin", "bind"],
|
||||
["builtin", "discard"],
|
||||
["builtin", "join"],
|
||||
["builtin", "ifM"],
|
||||
["builtin", "identity"],
|
||||
["builtin", "whenM"],
|
||||
["builtin", "unlessM"],
|
||||
["builtin", "liftM1"],
|
||||
["builtin", "ap"],
|
||||
["builtin", "compose"],
|
||||
["builtin", "otherwise"],
|
||||
["builtin", "top"],
|
||||
["builtin", "bottom"],
|
||||
["builtin", "recip"],
|
||||
["builtin", "eq"],
|
||||
["builtin", "notEq"],
|
||||
["builtin", "degree"],
|
||||
["builtin", "div"],
|
||||
["builtin", "mod"],
|
||||
["builtin", "lcm"],
|
||||
["builtin", "gcd"],
|
||||
["builtin", "flip"],
|
||||
["builtin", "const"],
|
||||
["builtin", "map"],
|
||||
["builtin", "void"],
|
||||
["builtin", "flap"],
|
||||
["builtin", "conj"],
|
||||
["builtin", "disj"],
|
||||
["builtin", "not"],
|
||||
["builtin", "mempty"],
|
||||
["builtin", "compare"],
|
||||
["builtin", "min"],
|
||||
["builtin", "max"],
|
||||
["builtin", "comparing"],
|
||||
["builtin", "clamp"],
|
||||
["builtin", "between"],
|
||||
["builtin", "sub"],
|
||||
["builtin", "negate"],
|
||||
["builtin", "append"],
|
||||
["builtin", "add"],
|
||||
["builtin", "zero"],
|
||||
["builtin", "mul"],
|
||||
["builtin", "one"],
|
||||
["builtin", "show"],
|
||||
["builtin", "unit"],
|
||||
["builtin", "absurd"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for all builtin.
|
|
@ -0,0 +1,17 @@
|
|||
'a'
|
||||
'\n'
|
||||
'\23'
|
||||
'\xFE'
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["char", "'a'"],
|
||||
["char", "'\\n'"],
|
||||
["char", "'\\23'"],
|
||||
["char", "'\\xFE'"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for chars.
|
|
@ -0,0 +1,14 @@
|
|||
-- foo
|
||||
{- foo
|
||||
bar -}
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["comment", "-- foo"],
|
||||
["comment", "{- foo\r\nbar -}"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for single-line and multi-line comments.
|
|
@ -0,0 +1,15 @@
|
|||
Foo
|
||||
Foo.Bar
|
||||
Baz.Foobar_42
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["constant", "Foo"],
|
||||
["constant", "Foo.Bar"],
|
||||
["constant", "Baz.Foobar_42"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for constants.
|
|
@ -0,0 +1,15 @@
|
|||
foo
|
||||
Foo.bar
|
||||
Baz.foobar_42
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["hvariable", "foo"],
|
||||
["hvariable", "Foo.bar"],
|
||||
["hvariable", "Baz.foobar_42"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for hvariables.
|
|
@ -0,0 +1,37 @@
|
|||
import Foo
|
||||
import Foo_42.Bar as Foobar
|
||||
import Foo.Bar as Foo.Baz hiding
|
||||
import Foo.Bar (test)
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["import-statement", [
|
||||
["keyword", "import"],
|
||||
" Foo"
|
||||
]],
|
||||
["import-statement", [
|
||||
["keyword", "import"],
|
||||
" Foo_42.Bar ",
|
||||
["keyword", "as"],
|
||||
" Foobar"
|
||||
]],
|
||||
["import-statement", [
|
||||
["keyword", "import"],
|
||||
" Foo.Bar ",
|
||||
["keyword", "as"],
|
||||
" Foo.Baz ",
|
||||
["keyword", "hiding"]
|
||||
]],
|
||||
["import-statement", [
|
||||
["keyword", "import"],
|
||||
" Foo.Bar"
|
||||
]],
|
||||
["punctuation", "("],
|
||||
["hvariable", "test"],
|
||||
["punctuation", ")"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for import statement.
|
|
@ -0,0 +1,49 @@
|
|||
ado
|
||||
case
|
||||
class
|
||||
data
|
||||
derive
|
||||
do
|
||||
else
|
||||
if
|
||||
in
|
||||
infixl
|
||||
infixr
|
||||
instance
|
||||
let
|
||||
module
|
||||
newtype
|
||||
of
|
||||
primitive
|
||||
then
|
||||
type
|
||||
where
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "ado"],
|
||||
["keyword", "case"],
|
||||
["keyword", "class"],
|
||||
["keyword", "data"],
|
||||
["keyword", "derive"],
|
||||
["keyword", "do"],
|
||||
["keyword", "else"],
|
||||
["keyword", "if"],
|
||||
["keyword", "in"],
|
||||
["keyword", "infixl"],
|
||||
["keyword", "infixr"],
|
||||
["keyword", "instance"],
|
||||
["keyword", "let"],
|
||||
["keyword", "module"],
|
||||
["keyword", "newtype"],
|
||||
["keyword", "of"],
|
||||
["keyword", "primitive"],
|
||||
["keyword", "then"],
|
||||
["keyword", "type"],
|
||||
["keyword", "where"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for all keywords.
|
|
@ -0,0 +1,23 @@
|
|||
42
|
||||
3.14159
|
||||
2E3
|
||||
1.2e-4
|
||||
0.9e+1
|
||||
0o47
|
||||
0xBadFace
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["number", "42"],
|
||||
["number", "3.14159"],
|
||||
["number", "2E3"],
|
||||
["number", "1.2e-4"],
|
||||
["number", "0.9e+1"],
|
||||
["number", "0o47"],
|
||||
["number", "0xBadFace"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for decimal, octal and hexadecimal numbers.
|
|
@ -0,0 +1,61 @@
|
|||
..
|
||||
reverse <<< sort
|
||||
`foo`
|
||||
`Foo.bar`
|
||||
+ - * /
|
||||
^ ^^ **
|
||||
&& ||
|
||||
< <= == /=
|
||||
>= > \ |
|
||||
++ : !!
|
||||
\\ <- ->
|
||||
= :: =>
|
||||
>> >>= >@>
|
||||
~ ! @
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["operator", ".."],
|
||||
["hvariable", "reverse"],
|
||||
["operator", "<<<"],
|
||||
["hvariable", "sort"],
|
||||
["operator", "`foo`"],
|
||||
["operator", "`Foo.bar`"],
|
||||
["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", "@"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for operators.
|
|
@ -0,0 +1,19 @@
|
|||
""
|
||||
"fo\"o"
|
||||
"foo \
|
||||
\ bar"
|
||||
"foo -- comment lookalike \
|
||||
\ bar"
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["string", "\"\""],
|
||||
["string", "\"fo\\\"o\""],
|
||||
["string", "\"foo \\\r\n \\ bar\""],
|
||||
["string", "\"foo -- comment lookalike \\\r\n \\ bar\""]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for strings.
|
Loading…
Reference in New Issue