parent
6e0b20a41c
commit
c28d8c5e37
File diff suppressed because one or more lines are too long
|
@ -684,6 +684,10 @@
|
|||
"owner": "Golmote",
|
||||
"alias": "vb"
|
||||
},
|
||||
"wasm": {
|
||||
"title": "WebAssembly",
|
||||
"owner": "Golmote"
|
||||
},
|
||||
"wiki": {
|
||||
"title": "Wiki markup",
|
||||
"require": "markup",
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
Prism.languages.wasm = {
|
||||
'comment': [
|
||||
/\(;[\s\S]*?;\)/,
|
||||
{
|
||||
pattern: /;;.*/,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
'string': {
|
||||
pattern: /"(?:\\[\s\S]|[^"\\])*"/,
|
||||
greedy: true
|
||||
},
|
||||
'keyword': [
|
||||
{
|
||||
pattern: /\b(?:align|offset)=/,
|
||||
inside: {
|
||||
'operator': /=/
|
||||
}
|
||||
},
|
||||
{
|
||||
pattern: /\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,
|
||||
inside: {
|
||||
'punctuation': /\./
|
||||
}
|
||||
},
|
||||
/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/
|
||||
],
|
||||
'variable': /\$[\w!#$%&'*+\-./:<=>?@\\^_`|~]+/i,
|
||||
'number': /[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,
|
||||
'punctuation': /[()]/
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
Prism.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-.\/:<=>?@\\^_`|~]+/i,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};
|
|
@ -0,0 +1,43 @@
|
|||
<h2>Comments</h2>
|
||||
<pre><code>;; Single line comment
|
||||
(; Multi-line
|
||||
comment ;)</code></pre>
|
||||
|
||||
<h2>Strings</h2>
|
||||
<pre><code>""
|
||||
"Foobar"
|
||||
"Foo\"ba\\r"</code></pre>
|
||||
|
||||
<h2>Numbers</h2>
|
||||
<pre><code>42
|
||||
3.1415
|
||||
0.4E-4
|
||||
-3.1_41_5
|
||||
0xBADFACE
|
||||
0xB_adF_a_c_e
|
||||
+0x4E.F7
|
||||
0xFFp+4
|
||||
inf
|
||||
nan
|
||||
nan:0xf4</code></pre>
|
||||
|
||||
<h2>Keywords</h2>
|
||||
<pre><code>(func (param i32) (param f32) (local f64)
|
||||
get_local 0
|
||||
get_local 1
|
||||
get_local 2)</code></pre>
|
||||
|
||||
<h2>Identifiers</h2>
|
||||
<pre><code>$p
|
||||
$getAnswer
|
||||
$return_i32</code></pre>
|
||||
|
||||
<h2>Full example</h2>
|
||||
<pre><code>(module
|
||||
(import "js" "memory" (memory 1))
|
||||
(import "js" "table" (table 1 anyfunc))
|
||||
(elem (i32.const 0) $shared0func)
|
||||
(func $shared0func (result i32)
|
||||
i32.const 0
|
||||
i32.load)
|
||||
)</code></pre>
|
|
@ -11,7 +11,7 @@ if (!Prism.plugins.toolbar) {
|
|||
}
|
||||
|
||||
// The languages map is built automatically with gulp
|
||||
var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","arff":"ARFF","asciidoc":"AsciiDoc","asm6502":"6502 Assembly","aspnet":"ASP.NET (C#)","autohotkey":"AutoHotkey","autoit":"AutoIt","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","csp":"Content-Security-Policy","css-extras":"CSS Extras","django":"Django/Jinja2","erb":"ERB","fsharp":"F#","gedcom":"GEDCOM","glsl":"GLSL","graphql":"GraphQL","http":"HTTP","hpkp":"HTTP Public-Key-Pins","hsts":"HTTP Strict-Transport-Security","ichigojam":"IchigoJam","inform7":"Inform 7","json":"JSON","latex":"LaTeX","livescript":"LiveScript","lolcode":"LOLCODE","markup-templating":"Markup templating","matlab":"MATLAB","mel":"MEL","n4js":"N4JS","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","opencl":"OpenCL","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","plsql":"PL/SQL","powershell":"PowerShell","properties":".properties","protobuf":"Protocol Buffers","q":"Q (kdb+ database)","jsx":"React JSX","tsx":"React TSX","renpy":"Ren'py","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vbnet":"VB.Net","vhdl":"VHDL","vim":"vim","visual-basic":"Visual Basic","wiki":"Wiki markup","xojo":"Xojo (REALbasic)","yaml":"YAML"}/*]*/;
|
||||
var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","arff":"ARFF","asciidoc":"AsciiDoc","asm6502":"6502 Assembly","aspnet":"ASP.NET (C#)","autohotkey":"AutoHotkey","autoit":"AutoIt","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","csp":"Content-Security-Policy","css-extras":"CSS Extras","django":"Django/Jinja2","erb":"ERB","fsharp":"F#","gedcom":"GEDCOM","glsl":"GLSL","graphql":"GraphQL","http":"HTTP","hpkp":"HTTP Public-Key-Pins","hsts":"HTTP Strict-Transport-Security","ichigojam":"IchigoJam","inform7":"Inform 7","json":"JSON","latex":"LaTeX","livescript":"LiveScript","lolcode":"LOLCODE","markup-templating":"Markup templating","matlab":"MATLAB","mel":"MEL","n4js":"N4JS","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","opencl":"OpenCL","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","plsql":"PL/SQL","powershell":"PowerShell","properties":".properties","protobuf":"Protocol Buffers","q":"Q (kdb+ database)","jsx":"React JSX","tsx":"React TSX","renpy":"Ren'py","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vbnet":"VB.Net","vhdl":"VHDL","vim":"vim","visual-basic":"Visual Basic","wasm":"WebAssembly","wiki":"Wiki markup","xojo":"Xojo (REALbasic)","yaml":"YAML"}/*]*/;
|
||||
Prism.plugins.toolbar.registerButton('show-language', function(env) {
|
||||
var pre = env.element.parentNode;
|
||||
if (!pre || !/pre/i.test(pre.nodeName)) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){if(!Prism.plugins.toolbar)return console.warn("Show Languages plugin loaded before Toolbar plugin."),void 0;var e={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",arff:"ARFF",asciidoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript",csp:"Content-Security-Policy","css-extras":"CSS Extras",django:"Django/Jinja2",erb:"ERB",fsharp:"F#",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",inform7:"Inform 7",json:"JSON",latex:"LaTeX",livescript:"LiveScript",lolcode:"LOLCODE","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",n4js:"N4JS",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",php:"PHP","php-extras":"PHP Extras",plsql:"PL/SQL",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",q:"Q (kdb+ database)",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",wiki:"Wiki markup",xojo:"Xojo (REALbasic)",yaml:"YAML"};Prism.plugins.toolbar.registerButton("show-language",function(t){var a=t.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var s=a.getAttribute("data-language")||e[t.language]||t.language.substring(0,1).toUpperCase()+t.language.substring(1),i=document.createElement("span");return i.textContent=s,i}})}}();
|
||||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){if(!Prism.plugins.toolbar)return console.warn("Show Languages plugin loaded before Toolbar plugin."),void 0;var e={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",arff:"ARFF",asciidoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript",csp:"Content-Security-Policy","css-extras":"CSS Extras",django:"Django/Jinja2",erb:"ERB",fsharp:"F#",gedcom:"GEDCOM",glsl:"GLSL",graphql:"GraphQL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",inform7:"Inform 7",json:"JSON",latex:"LaTeX",livescript:"LiveScript",lolcode:"LOLCODE","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",n4js:"N4JS",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",php:"PHP","php-extras":"PHP Extras",plsql:"PL/SQL",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",q:"Q (kdb+ database)",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xojo:"Xojo (REALbasic)",yaml:"YAML"};Prism.plugins.toolbar.registerButton("show-language",function(t){var a=t.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var s=a.getAttribute("data-language")||e[t.language]||t.language.substring(0,1).toUpperCase()+t.language.substring(1),i=document.createElement("span");return i.textContent=s,i}})}}();
|
|
@ -0,0 +1,22 @@
|
|||
;;
|
||||
;; Foobar
|
||||
;; (; foobar ;)
|
||||
(;;)
|
||||
(;Foobar;)
|
||||
(;Foo ;;bar
|
||||
baz;)
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["comment", ";;"],
|
||||
["comment", ";; Foobar"],
|
||||
["comment", ";; (; foobar ;)"],
|
||||
["comment", "(;;)"],
|
||||
["comment", "(;Foobar;)"],
|
||||
["comment", "(;Foo ;;bar\r\nbaz;)"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for comments.
|
|
@ -0,0 +1,407 @@
|
|||
align=
|
||||
offset=
|
||||
|
||||
f32
|
||||
f64
|
||||
i32
|
||||
i64
|
||||
i32.load
|
||||
i64.load
|
||||
f32.load
|
||||
f64.load
|
||||
i32.load8_s
|
||||
i32.load8_u
|
||||
i32.load16_s
|
||||
i32.load16_u
|
||||
i64.load8_s
|
||||
i64.load8_u
|
||||
i64.load16_s
|
||||
i64.load16_u
|
||||
i64.load32_s
|
||||
i64.load32_u
|
||||
i32.store
|
||||
i64.store
|
||||
f32.store
|
||||
f64.store
|
||||
i32.store8
|
||||
i32.store16
|
||||
i64.store8
|
||||
i64.store16
|
||||
i64.store32
|
||||
i32.const
|
||||
i64.const
|
||||
f32.const
|
||||
f64.const
|
||||
i32.clz
|
||||
i32.ctz
|
||||
i32.popcnt
|
||||
i32.add
|
||||
i32.sub
|
||||
i32.mul
|
||||
i32.div_s
|
||||
i32.div_u
|
||||
i32.rem_s
|
||||
i32.rem_u
|
||||
i32.and
|
||||
i32.or
|
||||
i32.xor
|
||||
i32.shl
|
||||
i32.shr_s
|
||||
i32.shr_u
|
||||
i32.rotl
|
||||
i32.rotr
|
||||
i64.clz
|
||||
i64.ctz
|
||||
i64.popcnt
|
||||
i64.add
|
||||
i64.sub
|
||||
i64.mul
|
||||
i64.div_s
|
||||
i64.div_u
|
||||
i64.rem_s
|
||||
i64.rem_u
|
||||
i64.and
|
||||
i64.or
|
||||
i64.xor
|
||||
i64.shl
|
||||
i64.shr_s
|
||||
i64.shr_u
|
||||
i64.rotl
|
||||
i64.rotr
|
||||
f32.abs
|
||||
f32.neg
|
||||
f32.ceil
|
||||
f32.floor
|
||||
f32.trunc
|
||||
f32.nearest
|
||||
f32.sqrt
|
||||
f32.add
|
||||
f32.sub
|
||||
f32.mul
|
||||
f32.div
|
||||
f32.min
|
||||
f32.max
|
||||
f32.copysign
|
||||
f64.abs
|
||||
f64.neg
|
||||
f64.ceil
|
||||
f64.floor
|
||||
f64.trunc
|
||||
f64.nearest
|
||||
f64.sqrt
|
||||
f64.add
|
||||
f64.sub
|
||||
f64.mul
|
||||
f64.div
|
||||
f64.min
|
||||
f64.max
|
||||
f64.copysign
|
||||
i32.eqz
|
||||
i32.eq
|
||||
i32.ne
|
||||
i32.lt_s
|
||||
i32.lt_u
|
||||
i32.gt_s
|
||||
i32.gt_u
|
||||
i32.le_s
|
||||
i32.le_u
|
||||
i32.ge_s
|
||||
i32.ge_u
|
||||
i64.eqz
|
||||
i64.eq
|
||||
i64.ne
|
||||
i64.lt_s
|
||||
i64.lt_u
|
||||
i64.gt_s
|
||||
i64.gt_u
|
||||
i64.le_s
|
||||
i64.le_u
|
||||
i64.ge_s
|
||||
i64.ge_u
|
||||
f32.eq
|
||||
f32.ne
|
||||
f32.lt
|
||||
f32.gt
|
||||
f32.le
|
||||
f32.ge
|
||||
f64.eq
|
||||
f64.ne
|
||||
f64.lt
|
||||
f64.gt
|
||||
f64.le
|
||||
f64.ge
|
||||
i32.wrap/i64
|
||||
i32.trunc_s/f32
|
||||
i32.trunc_u/f32
|
||||
i32.trunc_s/f64
|
||||
i32.trunc_u/f64
|
||||
i64.extend_s/i32
|
||||
i64.extend_u/i32
|
||||
i64.trunc_s/f32
|
||||
i64.trunc_u/f32
|
||||
i64.trunc_s/f64
|
||||
i64.trunc_u/f64
|
||||
f32.convert_s/i32
|
||||
f32.convert_u/i32
|
||||
f32.convert_s/i64
|
||||
f32.convert_u/i64
|
||||
f32.demote/f64
|
||||
f64.convert_s/i32
|
||||
f64.convert_u/i32
|
||||
f64.convert_s/i64
|
||||
f64.convert_u/i64
|
||||
f64.promote/f32
|
||||
i32.reinterpret/f32
|
||||
i64.reinterpret/f64
|
||||
f32.reinterpret/i32
|
||||
f64.reinterpret/i64
|
||||
|
||||
memory.size
|
||||
memory.grow
|
||||
|
||||
anyfunc
|
||||
block
|
||||
br
|
||||
br_if
|
||||
br_table
|
||||
call
|
||||
call_indirect
|
||||
data
|
||||
drop
|
||||
elem
|
||||
else
|
||||
end
|
||||
export
|
||||
func
|
||||
get_global
|
||||
get_local
|
||||
global
|
||||
if
|
||||
import
|
||||
local
|
||||
loop
|
||||
memory
|
||||
module
|
||||
mut
|
||||
nop
|
||||
offset
|
||||
param
|
||||
result
|
||||
return
|
||||
select
|
||||
set_global
|
||||
set_local
|
||||
start
|
||||
table
|
||||
tee_local
|
||||
then
|
||||
type
|
||||
unreachable
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", ["align", ["operator", "="]]],
|
||||
["keyword", ["offset", ["operator", "="]]],
|
||||
|
||||
["keyword", ["f32"]],
|
||||
["keyword", ["f64"]],
|
||||
["keyword", ["i32"]],
|
||||
["keyword", ["i64"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "load"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "load"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "load"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "load"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "load8_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "load8_u"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "load16_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "load16_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "load8_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "load8_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "load16_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "load16_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "load32_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "load32_u"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "store"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "store"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "store"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "store"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "store8"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "store16"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "store8"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "store16"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "store32"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "const"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "const"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "const"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "const"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "clz"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "ctz"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "popcnt"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "add"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "sub"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "mul"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "div_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "div_u"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "rem_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "rem_u"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "and"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "or"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "xor"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "shl"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "shr_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "shr_u"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "rotl"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "rotr"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "clz"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "ctz"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "popcnt"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "add"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "sub"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "mul"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "div_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "div_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "rem_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "rem_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "and"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "or"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "xor"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "shl"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "shr_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "shr_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "rotl"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "rotr"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "abs"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "neg"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "ceil"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "floor"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "trunc"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "nearest"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "sqrt"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "add"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "sub"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "mul"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "div"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "min"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "max"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "copysign"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "abs"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "neg"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "ceil"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "floor"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "trunc"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "nearest"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "sqrt"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "add"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "sub"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "mul"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "div"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "min"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "max"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "copysign"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "eqz"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "eq"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "ne"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "lt_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "lt_u"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "gt_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "gt_u"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "le_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "le_u"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "ge_s"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "ge_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "eqz"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "eq"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "ne"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "lt_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "lt_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "gt_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "gt_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "le_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "le_u"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "ge_s"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "ge_u"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "eq"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "ne"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "lt"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "gt"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "le"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "ge"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "eq"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "ne"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "lt"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "gt"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "le"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "ge"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "wrap/i64"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "trunc_s/f32"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "trunc_u/f32"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "trunc_s/f64"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "trunc_u/f64"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "extend_s/i32"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "extend_u/i32"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "trunc_s/f32"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "trunc_u/f32"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "trunc_s/f64"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "trunc_u/f64"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "convert_s/i32"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "convert_u/i32"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "convert_s/i64"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "convert_u/i64"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "demote/f64"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "convert_s/i32"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "convert_u/i32"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "convert_s/i64"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "convert_u/i64"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "promote/f32"]],
|
||||
["keyword", ["i32", ["punctuation", "."], "reinterpret/f32"]],
|
||||
["keyword", ["i64", ["punctuation", "."], "reinterpret/f64"]],
|
||||
["keyword", ["f32", ["punctuation", "."], "reinterpret/i32"]],
|
||||
["keyword", ["f64", ["punctuation", "."], "reinterpret/i64"]],
|
||||
|
||||
["keyword", ["memory", ["punctuation", "."], "size"]],
|
||||
["keyword", ["memory", ["punctuation", "."], "grow"]],
|
||||
|
||||
["keyword", "anyfunc"],
|
||||
["keyword", "block"],
|
||||
["keyword", "br"],
|
||||
["keyword", "br_if"],
|
||||
["keyword", "br_table"],
|
||||
["keyword", "call"],
|
||||
["keyword", "call_indirect"],
|
||||
["keyword", "data"],
|
||||
["keyword", "drop"],
|
||||
["keyword", "elem"],
|
||||
["keyword", "else"],
|
||||
["keyword", "end"],
|
||||
["keyword", "export"],
|
||||
["keyword", "func"],
|
||||
["keyword", "get_global"],
|
||||
["keyword", "get_local"],
|
||||
["keyword", "global"],
|
||||
["keyword", "if"],
|
||||
["keyword", "import"],
|
||||
["keyword", "local"],
|
||||
["keyword", "loop"],
|
||||
["keyword", "memory"],
|
||||
["keyword", "module"],
|
||||
["keyword", "mut"],
|
||||
["keyword", "nop"],
|
||||
["keyword", "offset"],
|
||||
["keyword", "param"],
|
||||
["keyword", "result"],
|
||||
["keyword", "return"],
|
||||
["keyword", "select"],
|
||||
["keyword", "set_global"],
|
||||
["keyword", "set_local"],
|
||||
["keyword", "start"],
|
||||
["keyword", "table"],
|
||||
["keyword", "tee_local"],
|
||||
["keyword", "then"],
|
||||
["keyword", "type"],
|
||||
["keyword", "unreachable"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for all keywords.
|
|
@ -0,0 +1,61 @@
|
|||
0
|
||||
42_147
|
||||
+42
|
||||
+4_2
|
||||
-3.1415
|
||||
-3.1_41_5
|
||||
4e2
|
||||
4_7e2
|
||||
-7E+8
|
||||
-7E+1_8
|
||||
+8.004e-12
|
||||
+8.0_04e-12
|
||||
0xBadFace
|
||||
0xB_adF_a_c_e
|
||||
-0x4E.F8d
|
||||
-0x4_E.F8_d
|
||||
+0xff
|
||||
0xefp4
|
||||
0xe_fp4_2
|
||||
+0x5CP+12
|
||||
+0x5_CP+12
|
||||
-0xef.efp-7
|
||||
-0xef_14.00_0_Ap-1_7
|
||||
inf
|
||||
nan
|
||||
nan:0xF_4
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["number", "0"],
|
||||
["number", "42_147"],
|
||||
["number", "+42"],
|
||||
["number", "+4_2"],
|
||||
["number", "-3.1415"],
|
||||
["number", "-3.1_41_5"],
|
||||
["number", "4e2"],
|
||||
["number", "4_7e2"],
|
||||
["number", "-7E+8"],
|
||||
["number", "-7E+1_8"],
|
||||
["number", "+8.004e-12"],
|
||||
["number", "+8.0_04e-12"],
|
||||
["number", "0xBadFace"],
|
||||
["number", "0xB_adF_a_c_e"],
|
||||
["number", "-0x4E.F8d"],
|
||||
["number", "-0x4_E.F8_d"],
|
||||
["number", "+0xff"],
|
||||
["number", "0xefp4"],
|
||||
["number", "0xe_fp4_2"],
|
||||
["number", "+0x5CP+12"],
|
||||
["number", "+0x5_CP+12"],
|
||||
["number", "-0xef.efp-7"],
|
||||
["number", "-0xef_14.00_0_Ap-1_7"],
|
||||
["number", "inf"],
|
||||
["number", "nan"],
|
||||
["number", "nan:0xF_4"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for decimal and hexadecimal numbers.
|
|
@ -0,0 +1,22 @@
|
|||
""
|
||||
"Foo\"\\bar"
|
||||
"\t\n\r\"\'\\\u{004e}\u{0_0_4_e}"
|
||||
"foo
|
||||
bar"
|
||||
";; foo"
|
||||
"(; foo bar ;)"
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["string", "\"\""],
|
||||
["string", "\"Foo\\\"\\\\bar\""],
|
||||
["string", "\"\\t\\n\\r\\\"\\'\\\\\\u{004e}\\u{0_0_4_e}\""],
|
||||
["string", "\"foo\r\nbar\""],
|
||||
["string", "\";; foo\""],
|
||||
["string", "\"(; foo bar ;)\""]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for strings.
|
|
@ -0,0 +1,17 @@
|
|||
$Foo
|
||||
$foo_42!
|
||||
$$
|
||||
$!#$%&'*+-./:<=>?@\^_`|~
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["variable", "$Foo"],
|
||||
["variable", "$foo_42!"],
|
||||
["variable", "$$"],
|
||||
["variable", "$!#$%&'*+-./:<=>?@\\^_`|~"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for variables.
|
Loading…
Reference in New Issue