Added support for Magma (CAS) (#3055)
This commit is contained in:
parent
23cd9b655b
commit
a1b67ce342
File diff suppressed because one or more lines are too long
|
@ -783,6 +783,10 @@
|
|||
"title": "Lua",
|
||||
"owner": "Golmote"
|
||||
},
|
||||
"magma": {
|
||||
"title": "Magma (CAS)",
|
||||
"owner": "RunDevelopment"
|
||||
},
|
||||
"makefile": {
|
||||
"title": "Makefile",
|
||||
"owner": "Golmote"
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
Prism.languages.magma = {
|
||||
'output': {
|
||||
pattern: /^(>.*(?:\r(?:\n|(?!\n))|\n))(?!>)(?:.+|(?:\r(?:\n|(?!\n))|\n)(?!>).*)(?:(?:\r(?:\n|(?!\n))|\n)(?!>).*)*/m,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
|
||||
'comment': {
|
||||
pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
|
||||
greedy: true
|
||||
},
|
||||
'string': {
|
||||
pattern: /(^|[^\\"])"(?:[^\r\n\\"]|\\.)*"/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
|
||||
// http://magma.maths.usyd.edu.au/magma/handbook/text/82
|
||||
'keyword': /\b(?:_|adj|and|assert|assert2|assert3|assigned|break|by|case|cat|catch|clear|cmpeq|cmpne|continue|declare|default|delete|diff|div|do|elif|else|end|eq|error|eval|exists|exit|for|forall|forward|fprintf|freeze|function|ge|gt|if|iload|import|in|intrinsic|is|join|le|load|local|lt|meet|mod|ne|not|notadj|notin|notsubset|or|print|printf|procedure|quit|random|read|readi|repeat|require|requirege|requirerange|restore|return|save|sdiff|select|subset|then|time|to|try|until|vprint|vprintf|vtime|when|where|while|xor)\b/,
|
||||
'boolean': /\b(?:false|true)\b/,
|
||||
|
||||
'generator': {
|
||||
pattern: /\b[a-z_]\w*(?=\s*<)/i,
|
||||
alias: 'class-name'
|
||||
},
|
||||
'function': /\b[a-z_]\w*(?=\s*\()/i,
|
||||
|
||||
'number': {
|
||||
pattern: /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,
|
||||
lookbehind: true
|
||||
},
|
||||
|
||||
'operator': /->|[-+*/^~!|#=]|:=|\.\./,
|
||||
'punctuation': /[()[\]{}<>,;.:]/
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
Prism.languages.magma={output:{pattern:/^(>.*(?:\r(?:\n|(?!\n))|\n))(?!>)(?:.+|(?:\r(?:\n|(?!\n))|\n)(?!>).*)(?:(?:\r(?:\n|(?!\n))|\n)(?!>).*)*/m,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/(^|[^\\"])"(?:[^\r\n\\"]|\\.)*"/,lookbehind:!0,greedy:!0},keyword:/\b(?:_|adj|and|assert|assert2|assert3|assigned|break|by|case|cat|catch|clear|cmpeq|cmpne|continue|declare|default|delete|diff|div|do|elif|else|end|eq|error|eval|exists|exit|for|forall|forward|fprintf|freeze|function|ge|gt|if|iload|import|in|intrinsic|is|join|le|load|local|lt|meet|mod|ne|not|notadj|notin|notsubset|or|print|printf|procedure|quit|random|read|readi|repeat|require|requirege|requirerange|restore|return|save|sdiff|select|subset|then|time|to|try|until|vprint|vprintf|vtime|when|where|while|xor)\b/,boolean:/\b(?:false|true)\b/,generator:{pattern:/\b[a-z_]\w*(?=\s*<)/i,alias:"class-name"},function:/\b[a-z_]\w*(?=\s*\()/i,number:{pattern:/(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,lookbehind:!0},operator:/->|[-+*/^~!|#=]|:=|\.\./,punctuation:/[()[\]{}<>,;.:]/};
|
|
@ -0,0 +1,34 @@
|
|||
<h2>Full example</h2>
|
||||
<pre><code>// Source: http://magma.maths.usyd.edu.au/magma/handbook/text/115#963
|
||||
> D := Denominator;
|
||||
> N := Numerator;
|
||||
> farey := function(n)
|
||||
> f := [ RationalField() | 0, 1/n ];
|
||||
> p := 0;
|
||||
> q := 1;
|
||||
> while p/q lt 1 do
|
||||
> p := ( D(f[#f-1]) + n) div D(f[#f]) * N(f[#f]) - N(f[#f-1]);
|
||||
> q := ( D(f[#f-1]) + n) div D(f[#f]) * D(f[#f]) - D(f[#f-1]);
|
||||
> Append(~f, p/q);
|
||||
> end while;
|
||||
> return f;
|
||||
> end function;
|
||||
> function farey(n)
|
||||
> if n eq 1 then
|
||||
> return [RationalField() | 0, 1 ];
|
||||
> else
|
||||
> f := farey(n-1);
|
||||
> i := 0;
|
||||
> while i lt #f-1 do
|
||||
> i +:= 1;
|
||||
> if D(f[i]) + D(f[i+1]) eq n then
|
||||
> Insert( ~f, i+1, (N(f[i]) + N(f[i+1]))/(D(f[i]) + D(f[i+1])));
|
||||
> end if;
|
||||
> end while;
|
||||
> return f;
|
||||
> end if;
|
||||
> end function;
|
||||
> farey := func< n |
|
||||
> Sort(Setseq({ a/b : a in { 0..n }, b in { 1..n } | a le b }))>;
|
||||
> farey(6);
|
||||
[ 0, 1/6, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 1 ]</code></pre>
|
|
@ -137,6 +137,7 @@
|
|||
"llvm": "LLVM IR",
|
||||
"log": "Log file",
|
||||
"lolcode": "LOLCODE",
|
||||
"magma": "Magma (CAS)",
|
||||
"md": "Markdown",
|
||||
"markup-templating": "Markup templating",
|
||||
"matlab": "MATLAB",
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document)if(Prism.plugins.toolbar){var i={none:"Plain text",plain:"Plain text",plaintext:"Plain text",text:"Plain text",txt:"Plain text",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","avro-idl":"Avro IDL",avdl:"Avro IDL",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cfscript:"CFScript",cfc:"CFScript",cil:"CIL",cmake:"CMake",cobol:"COBOL",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",csv:"CSV",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",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",gap:"GAP (CAS)",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gn:"GN",gni:"GN",graphql:"GraphQL",hbs:"Handlebars",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam","icu-message-format":"ICU Message Format",idr:"Idris",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",kumir:"KuMir (КуМир)",kum:"KuMir (КуМир)",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",log:"Log file",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",openqasm:"OpenQasm",qasm:"OpenQasm",parigp:"PARI/GP",objectpascal:"Object Pascal",psl:"PATROL Scripting Language",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",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",qsharp:"Q#",qs:"Q#",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","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",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)",systemd:"Systemd configuration file","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",uri:"URI",url:"URL",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",wolfram:"Wolfram language",nb:"Mathematica Notebook",wl:"Wolfram language",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,s=a.getAttribute("data-language")||i[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.")}();
|
||||
!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document)if(Prism.plugins.toolbar){var i={none:"Plain text",plain:"Plain text",plaintext:"Plain text",text:"Plain text",txt:"Plain text",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","avro-idl":"Avro IDL",avdl:"Avro IDL",basic:"BASIC",bbcode:"BBcode",bnf:"BNF",rbnf:"RBNF",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cfscript:"CFScript",cfc:"CFScript",cil:"CIL",cmake:"CMake",cobol:"COBOL",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",csv:"CSV",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",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",gap:"GAP (CAS)",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",glsl:"GLSL",gn:"GN",gni:"GN",graphql:"GraphQL",hbs:"Handlebars",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam","icu-message-format":"ICU Message Format",idr:"Idris",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",kumir:"KuMir (КуМир)",kum:"KuMir (КуМир)",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",log:"Log file",lolcode:"LOLCODE",magma:"Magma (CAS)",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",openqasm:"OpenQasm",qasm:"OpenQasm",parigp:"PARI/GP",objectpascal:"Object Pascal",psl:"PATROL Scripting Language",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",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",qsharp:"Q#",qs:"Q#",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","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",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)",systemd:"Systemd configuration file","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",uri:"URI",url:"URL",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",wolfram:"Wolfram language",nb:"Mathematica Notebook",wl:"Wolfram language",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,s=a.getAttribute("data-language")||i[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.")}();
|
|
@ -0,0 +1,9 @@
|
|||
true
|
||||
false
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["boolean", "true"],
|
||||
["boolean", "false"]
|
||||
]
|
|
@ -0,0 +1,13 @@
|
|||
// comment
|
||||
|
||||
/*
|
||||
comment
|
||||
*/
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["comment", "// comment"],
|
||||
|
||||
["comment", "/*\r\n comment\r\n */"]
|
||||
]
|
|
@ -0,0 +1,36 @@
|
|||
G<a, b> := Group<a, b | a^2 = b^3 = a^b*b^2>;
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["generator", "G"],
|
||||
["punctuation", "<"],
|
||||
"a",
|
||||
["punctuation", ","],
|
||||
" b",
|
||||
["punctuation", ">"],
|
||||
["operator", ":="],
|
||||
["generator", "Group"],
|
||||
["punctuation", "<"],
|
||||
"a",
|
||||
["punctuation", ","],
|
||||
" b ",
|
||||
["operator", "|"],
|
||||
" a",
|
||||
["operator", "^"],
|
||||
["number", "2"],
|
||||
["operator", "="],
|
||||
" b",
|
||||
["operator", "^"],
|
||||
["number", "3"],
|
||||
["operator", "="],
|
||||
" a",
|
||||
["operator", "^"],
|
||||
"b",
|
||||
["operator", "*"],
|
||||
"b",
|
||||
["operator", "^"],
|
||||
["number", "2"],
|
||||
["punctuation", ">"],
|
||||
["punctuation", ";"]
|
||||
]
|
|
@ -0,0 +1,177 @@
|
|||
_;
|
||||
adj;
|
||||
and;
|
||||
assert;
|
||||
assert2;
|
||||
assert3;
|
||||
assigned;
|
||||
break;
|
||||
by;
|
||||
case;
|
||||
cat;
|
||||
catch;
|
||||
clear;
|
||||
cmpeq;
|
||||
cmpne;
|
||||
continue;
|
||||
declare;
|
||||
default;
|
||||
delete;
|
||||
diff;
|
||||
div;
|
||||
do;
|
||||
elif;
|
||||
else;
|
||||
end;
|
||||
eq;
|
||||
error;
|
||||
eval;
|
||||
exists;
|
||||
exit;
|
||||
for;
|
||||
forall;
|
||||
forward;
|
||||
fprintf;
|
||||
freeze;
|
||||
function;
|
||||
ge;
|
||||
gt;
|
||||
if;
|
||||
iload;
|
||||
import;
|
||||
in;
|
||||
intrinsic;
|
||||
is;
|
||||
join;
|
||||
le;
|
||||
load;
|
||||
local;
|
||||
lt;
|
||||
meet;
|
||||
mod;
|
||||
ne;
|
||||
not;
|
||||
notadj;
|
||||
notin;
|
||||
notsubset;
|
||||
or;
|
||||
print;
|
||||
printf;
|
||||
procedure;
|
||||
quit;
|
||||
random;
|
||||
read;
|
||||
readi;
|
||||
repeat;
|
||||
require;
|
||||
requirege;
|
||||
requirerange;
|
||||
restore;
|
||||
return;
|
||||
save;
|
||||
sdiff;
|
||||
select;
|
||||
subset;
|
||||
then;
|
||||
time;
|
||||
to;
|
||||
try;
|
||||
until;
|
||||
vprint;
|
||||
vprintf;
|
||||
vtime;
|
||||
when;
|
||||
where;
|
||||
while;
|
||||
xor;
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "_"], ["punctuation", ";"],
|
||||
["keyword", "adj"], ["punctuation", ";"],
|
||||
["keyword", "and"], ["punctuation", ";"],
|
||||
["keyword", "assert"], ["punctuation", ";"],
|
||||
["keyword", "assert2"], ["punctuation", ";"],
|
||||
["keyword", "assert3"], ["punctuation", ";"],
|
||||
["keyword", "assigned"], ["punctuation", ";"],
|
||||
["keyword", "break"], ["punctuation", ";"],
|
||||
["keyword", "by"], ["punctuation", ";"],
|
||||
["keyword", "case"], ["punctuation", ";"],
|
||||
["keyword", "cat"], ["punctuation", ";"],
|
||||
["keyword", "catch"], ["punctuation", ";"],
|
||||
["keyword", "clear"], ["punctuation", ";"],
|
||||
["keyword", "cmpeq"], ["punctuation", ";"],
|
||||
["keyword", "cmpne"], ["punctuation", ";"],
|
||||
["keyword", "continue"], ["punctuation", ";"],
|
||||
["keyword", "declare"], ["punctuation", ";"],
|
||||
["keyword", "default"], ["punctuation", ";"],
|
||||
["keyword", "delete"], ["punctuation", ";"],
|
||||
["keyword", "diff"], ["punctuation", ";"],
|
||||
["keyword", "div"], ["punctuation", ";"],
|
||||
["keyword", "do"], ["punctuation", ";"],
|
||||
["keyword", "elif"], ["punctuation", ";"],
|
||||
["keyword", "else"], ["punctuation", ";"],
|
||||
["keyword", "end"], ["punctuation", ";"],
|
||||
["keyword", "eq"], ["punctuation", ";"],
|
||||
["keyword", "error"], ["punctuation", ";"],
|
||||
["keyword", "eval"], ["punctuation", ";"],
|
||||
["keyword", "exists"], ["punctuation", ";"],
|
||||
["keyword", "exit"], ["punctuation", ";"],
|
||||
["keyword", "for"], ["punctuation", ";"],
|
||||
["keyword", "forall"], ["punctuation", ";"],
|
||||
["keyword", "forward"], ["punctuation", ";"],
|
||||
["keyword", "fprintf"], ["punctuation", ";"],
|
||||
["keyword", "freeze"], ["punctuation", ";"],
|
||||
["keyword", "function"], ["punctuation", ";"],
|
||||
["keyword", "ge"], ["punctuation", ";"],
|
||||
["keyword", "gt"], ["punctuation", ";"],
|
||||
["keyword", "if"], ["punctuation", ";"],
|
||||
["keyword", "iload"], ["punctuation", ";"],
|
||||
["keyword", "import"], ["punctuation", ";"],
|
||||
["keyword", "in"], ["punctuation", ";"],
|
||||
["keyword", "intrinsic"], ["punctuation", ";"],
|
||||
["keyword", "is"], ["punctuation", ";"],
|
||||
["keyword", "join"], ["punctuation", ";"],
|
||||
["keyword", "le"], ["punctuation", ";"],
|
||||
["keyword", "load"], ["punctuation", ";"],
|
||||
["keyword", "local"], ["punctuation", ";"],
|
||||
["keyword", "lt"], ["punctuation", ";"],
|
||||
["keyword", "meet"], ["punctuation", ";"],
|
||||
["keyword", "mod"], ["punctuation", ";"],
|
||||
["keyword", "ne"], ["punctuation", ";"],
|
||||
["keyword", "not"], ["punctuation", ";"],
|
||||
["keyword", "notadj"], ["punctuation", ";"],
|
||||
["keyword", "notin"], ["punctuation", ";"],
|
||||
["keyword", "notsubset"], ["punctuation", ";"],
|
||||
["keyword", "or"], ["punctuation", ";"],
|
||||
["keyword", "print"], ["punctuation", ";"],
|
||||
["keyword", "printf"], ["punctuation", ";"],
|
||||
["keyword", "procedure"], ["punctuation", ";"],
|
||||
["keyword", "quit"], ["punctuation", ";"],
|
||||
["keyword", "random"], ["punctuation", ";"],
|
||||
["keyword", "read"], ["punctuation", ";"],
|
||||
["keyword", "readi"], ["punctuation", ";"],
|
||||
["keyword", "repeat"], ["punctuation", ";"],
|
||||
["keyword", "require"], ["punctuation", ";"],
|
||||
["keyword", "requirege"], ["punctuation", ";"],
|
||||
["keyword", "requirerange"], ["punctuation", ";"],
|
||||
["keyword", "restore"], ["punctuation", ";"],
|
||||
["keyword", "return"], ["punctuation", ";"],
|
||||
["keyword", "save"], ["punctuation", ";"],
|
||||
["keyword", "sdiff"], ["punctuation", ";"],
|
||||
["keyword", "select"], ["punctuation", ";"],
|
||||
["keyword", "subset"], ["punctuation", ";"],
|
||||
["keyword", "then"], ["punctuation", ";"],
|
||||
["keyword", "time"], ["punctuation", ";"],
|
||||
["keyword", "to"], ["punctuation", ";"],
|
||||
["keyword", "try"], ["punctuation", ";"],
|
||||
["keyword", "until"], ["punctuation", ";"],
|
||||
["keyword", "vprint"], ["punctuation", ";"],
|
||||
["keyword", "vprintf"], ["punctuation", ";"],
|
||||
["keyword", "vtime"], ["punctuation", ";"],
|
||||
["keyword", "when"], ["punctuation", ";"],
|
||||
["keyword", "where"], ["punctuation", ";"],
|
||||
["keyword", "while"], ["punctuation", ";"],
|
||||
["keyword", "xor"], ["punctuation", ";"]
|
||||
]
|
|
@ -0,0 +1,17 @@
|
|||
123
|
||||
-123
|
||||
|
||||
1.234
|
||||
|
||||
0..100
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["number", "123"],
|
||||
["operator", "-"], ["number", "123"],
|
||||
|
||||
["number", "1.234"],
|
||||
|
||||
["number", "0"], ["operator", ".."], ["number", "100"]
|
||||
]
|
|
@ -0,0 +1,25 @@
|
|||
+ - * / ^ ~ !
|
||||
=
|
||||
:= -> ..
|
||||
| #
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["operator", "+"],
|
||||
["operator", "-"],
|
||||
["operator", "*"],
|
||||
["operator", "/"],
|
||||
["operator", "^"],
|
||||
["operator", "~"],
|
||||
["operator", "!"],
|
||||
|
||||
["operator", "="],
|
||||
|
||||
["operator", ":="],
|
||||
["operator", "->"],
|
||||
["operator", ".."],
|
||||
|
||||
["operator", "|"],
|
||||
["operator", "#"]
|
||||
]
|
|
@ -0,0 +1,20 @@
|
|||
( ) [ ] { } < >
|
||||
, ; . :
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["punctuation", "("],
|
||||
["punctuation", ")"],
|
||||
["punctuation", "["],
|
||||
["punctuation", "]"],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "}"],
|
||||
["punctuation", "<"],
|
||||
["punctuation", ">"],
|
||||
|
||||
["punctuation", ","],
|
||||
["punctuation", ";"],
|
||||
["punctuation", "."],
|
||||
["punctuation", ":"]
|
||||
]
|
|
@ -0,0 +1,13 @@
|
|||
""
|
||||
"foo"
|
||||
"\""
|
||||
"\n\n"
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["string", "\"\""],
|
||||
["string", "\"foo\""],
|
||||
["string", "\"\\\"\""],
|
||||
["string", "\"\\n\\n\""]
|
||||
]
|
Loading…
Reference in New Issue