highlightjs-func
Version:
highlight.js syntax definition for TON's FunC language
17 lines • 3.68 kB
JavaScript
/*! `fift` grammar compiled for Highlight.js 11.6.0 */
(()=>{var e=(()=>{"use strict";const e=/[0-9A-Za-z$_-]+/,i=/(::_|::|:_|=:|:)/
;return t=>({name:"Fift",aliases:["fift"],case_insensitive:!1,keywords:{
keyword:["-roll","-rot|10","-trailing","-trailing0","2constant|10","2drop|10","2dup|10","2over|10","2swap|10","abort","abs","allot","and","anon","atom","bbitrefs","bbits","bl","box","brefs","brembitrefs","brembits","bremrefs","bye","cadr","caddr","car","cddr","cdr","char","chr","cmp","cond","cons","constant","count","cr","create","drop","depth","dictmap","dictmerge","dictnew","does","drop","dup","ed25519_chksign","ed25519_sign","ed25519_sign_uint","emit","exch","exch2|10","execute","explode","find","first","fits","forget","gasrunvm","gasrunvmcode","gasrunvmctx","gasrunvmdict","halt","hash","hashB","hashu","hold","hole","if","ifnot","include","list","minmax","max","min","mod","negate","newkeypair","nil","nip","nop","not","now","null","or","over","pair","pick","quit","remaining","reverse","roll","rot","runvm","runvmcode","runvmctx","runvmdict","sbitrefs","sbits","second","sgn","sign","shash","space","swap","single","skipspc","srefs","ten","third","times","triple","tuck","tuple","type","ufits","uncons","unpair","unsingle","until","untriple","untuple","variable","while","word","words","xor"],
literal:["true","false"],type:[],built_in:[]},contains:[{scope:"comment",
variants:[t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE],relevance:0},{
match:[/\s/,/2?constant/,/\s+/,e],scope:{2:"keyword",4:"variable.constant"}},{
match:[/\s/,/variable/,/\s+/,e],scope:{2:"keyword",4:"variable"}},{
match:[/}/,/\s+/,i,/\s+/,e],scope:{1:"punctuation",3:"operator",5:"function"}},{
scope:"operator",
match:t.regex.either(/!/,/#>/,/#s/,/\$#/,/#/,/\$\+/,/\$,/,/\$\d/,/\$=/,/\$(?=\()/,/\$>smca/,/\$>s/,/\$@\+/,/\$@\?\+/,/\$@\?/,/\$@/,/\$cmp/,/\$len/,/\$pos/,/\$reverse/,/%1<</,/\('\)/,/\(-trailing\)/,/\(\.\)/,/\(atom\)/,/\(b\.\)/,/\(compile\)/,/\(create\)/,/\(def\?\)/,/\(dump\)/,/\(execute\)/,/\(forget\)/,/\(number\)/,/\(x\.\)/,/\(\{\)/,/\(\}\)/,/\*\/cmod/,/\*\/c/,/\*\/mod/,/\*\/rmod/,/\*\/r/,/\*\//,/\*>>c/,/\*>>r/,/\*>>/,/\*mod/,/\*/,/\+!/,/\+/,/,/,/-!/,/-/,/-1<</,/\._/,/\.dump/,/\.l/,/\.sl/,/\.s/,/\.tc/,/\//,/\/\*/,/\/cmod/,/\/c/,/\/mod/,/\/rmod/,/\/r/,/0!/,/0<=/,/0<>/,/0</,/0=/,/0>=/,/0>/,/1\+!/,/1\+/,/1-!/,/1-/,/1<</,/1<<1-/,/2\*/,/2\+/,/2-/,/2\//,/2=:/,i,/<#/,/<<\/c/,/<<\/r/,/<=/,/<>/,/<b/,/<s/,/<<\//,/<</,/</,/=/,/>=/,/>>c/,/>>r/,/>>/,/>/,/\?dup/,/@'/,/@/,/B\+/,/B,/,/B=/,/B>Li@\+/,/B>Li@/,/B>Lu@\+/,/B>Lu@/,/B>boc/,/B>file/,/B>i@\+/,/B>i@/,/B>u@\+/,/B>u@/,/B@\?\+/,/B@\+/,/B@\?/,/B@/,/Bcmp/,/BhashB/,/Bhashu/,/Bhash/,/Blen/,/Bx\./,/B\|/,/Li>B/,/Lu>B/,/\[\]/,/\[compile\]/,/\[/,/\]/,/atom\?/,/b\+/,/b\._/,/b\./,/b>idict!\+/,/b>idict!/,/b>sdict!\+/,/b>sdict!/,/b>udict!\+/,/b>udict!/,/b>/,/boc+>B/,/boc>B/,/csr\./,/def\?/,/empty\?/,/eq\?/,/file-exists\?/,/file>B/,/i,/,/i>B/,/i@\+/,/i@/,/i@\?\+/,/i@\?/,/idict!\+/,/idict!/,/idict-/,/idict@-/,/idict@/,/null!/,/null\?/,/pfxdict!\+/,/pfxdict!/,/pfxdict@/,/priv>pub/,/ref@\+/,/ref@/,/ref@\?\+/,/ref@\?/,/s,/,/s>c/,/s>/,/sdict!\+/,/sdict!/,/sdict-/,/sdict@-/,/sdict@/,/smca>\$/,/sr,/,/tuple\?/,/u,/,/u>B/,/u@\+/,/u@\?\+/,/u@\?/,/udict!\+/,/udict!/,/udict-/,/udict@-/,/udict@/,/undef\?/,/x\._/,/x\./,/\|\+/,/\|/,/\|_/,/(?<=\s)\.(?=\s)/)
},{scope:"number",
match:t.regex.either(/(0[xX][0-9a-fA-F]+)/,/(0[bB][01]+)/,/(-?[0-9]+(\/-?[0-9]+)?)/)
},{scope:"string",match:/"([^"\r\n\\]|\\.)*"/},{scope:"symbol",
match:/[xX]\{[0-9a-fA-F_]*}/,relevance:10},{scope:"symbol",match:/[bB]\{[01]*}/,
relevance:10},{scope:"symbol",match:/'[^\s]+/},{scope:"punctuation",
match:/[\[\{\}\],]/}]})})();hljs.registerLanguage("fift",e)})();