-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
prism-tact.min.js
1 lines (1 loc) · 1.64 KB
/
prism-tact.min.js
1
!function(t){t.languages.tact={keyword:[{pattern:/\b(?:abstract|as|const|contract(?!:)|do|else|extend|extends|fun|get|if|import|initOf|inline|let|message(?!:)|mutates|native|override|primitive|public|repeat|return|self|struct(?!:)|trait(?!:)|until|virtual|while|with)\b/},{pattern:/(\bas\s+)\w+/,lookbehind:!0,greedy:!0},{pattern:/\b(?:bounced|external|init|receive)\b/}],builtin:{pattern:/\b(?:Address|Bool|Builder|Cell|Int|Slice|String|StringBuilder)\b/},constant:[{pattern:/\bnull\b/},{pattern:/\b[A-Z][A-Z0-9_]*\b/}],"class-name":{pattern:/\b[A-Z]\w*\b/},attribute:[{pattern:/@name/,inside:{function:/.+/}},{pattern:/@interface/,inside:{function:/.+/}}],function:{pattern:/\b\w+(?=\()/},boolean:{pattern:/\b(?:false|true)\b/},number:[{pattern:/\b0x[0-9a-f](?:_?[0-9a-f])*\b/i},{pattern:/\b0o[0-7](?:_?[0-7])*\b/i},{pattern:/\b0b[01](?:_?[01])*\b/i},{pattern:/\b0\d*\b/},{pattern:/\b[1-9](?:_?\d)*\b/}],string:void 0,punctuation:{pattern:/[{}[\]();,.:?]/},comment:[{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0}],operator:{pattern:/![!=]?|[+\-*/%=]=?|[<>]=|<<?|>>?|\|\|?|&&?/}},t.languages.insertBefore("tact","string",{"string-literal":{pattern:/(?:(")(?:\\.|(?!\1)[^\\\r\n])*\1(?!\1))/,greedy:!0,inside:{string:{pattern:/[\s\S]+/}}}}),t.languages.insertBefore("tact","keyword",{generics:{pattern:/(?:\b(?:bounced|map)\b<[^\\\r\n]*>)/,greedy:!0,inside:{builtin:[t.languages.tact.builtin,{pattern:/\b(?:bounced(?=<)|map(?=<))\b/}],"class-name":t.languages.tact["class-name"],punctuation:{pattern:/[<>(),.?]/},keyword:[{pattern:/\bas\b/},{pattern:/(\bas\s+)\w+/,lookbehind:!0,greedy:!0}]}}})}(Prism);