mirror of
https://github.com/TelegramMessenger/libprisma.git
synced 2026-11-18 20:23:45 +00:00
* 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
44 lines
1.1 KiB
JavaScript
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': /[;\(\):\[\]\{\}]/,
|
|
}; |