Files
libprisma/components/prism-tlb.js
Novus Nota bd15682b7b Added Tact, FunC, Fift, TL-B support (#13)
* Added Tact, FunC, Fift, TL-B support

Whose are the common languages of [TON](https://ton.org).

* chore: Updated list of supported languages

* feat: support Tact 1.3.0
2024-05-28 17:19:54 +04:00

44 lines
1.1 KiB
JavaScript

/**
* @file Prism.js definition for TL-B
* @link https://docs.ton.org/develop/data-formats/tl-b-language
* @author Nikita Sobolev (https://github.com/sobolevn)
* @license MIT
*/
Prism.languages.tlb = {
'builtin': /\b(?:Bool|Both|Cell|Either|Maybe|Type|Unit|bits256|bits512|int16|int32|int64|int8|uint15|uint16|uint32|uint63|uint64|uint8)\b/,
'keyword': /\b(?:BoolFalse|BoolTrue|False|Null|True)\b/,
'comment': {
pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
greedy: true
},
'comment-multiline': [
{
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
lookbehind: true,
greedy: true,
alias: 'comment'
},
{
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true,
greedy: true,
alias: 'comment'
}
],
'symbol': [
/#[0-9a-f]*_?/,
/\$[01]*_?/,
/\b(?:##|#<|#<=)\b/,
],
'variable': /[a-zA-Z_]\w*/,
'operator': [
/\+/, /-/, /\*/, /\//,
/!=/, /==/, /=/,
/\?/, /~/, /\./, /\^/,
/<=/, />=/, /</, />/,
],
'number': /\d+/,
'punctuation': /[;\(\):\[\]\{\}]/,
};