Files
crosslangextras/vscode-extension/syntaxes/crossasm.tmLanguage.json
2025-12-23 16:54:07 -06:00

134 lines
2.8 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "CrossAsm",
"patterns": [
{
"include": "#comment"
},
{
"include": "#keywords"
},
{
"include": "#chars"
},
{
"include": "#operators"
},
{
"include": "#function"
},
{
"include": "#identifier"
},
{
"include": "#consts"
},
{
"include": "#double"
},
{
"include": "#long"
},
{
"include": "#strings"
}
],
"repository": {
"comment": {
"patterns": [{
"name": "comment.line.double-slash.crossasm",
"begin": "//",
"end": "\\n"
},
{
"name": "comment.block.crossasm",
"begin": "\\/\\*",
"end": "\\*\\/"
},
{
"name": "comment.line.crossasm",
"begin": "#",
"end": "\\n"
},
{
"name":"comment.block.documentation.crossasm",
"begin": "\\/\\^",
"end": "\\^\\/"
}
]
},
"strings": {
"name": "string.quoted.double.crossasm",
"begin": "\\\"",
"end": "\\\"",
"patterns": [
{
"name": "constant.character.escape.crossasm",
"match": "\\\\."
}
]
},
"operators": {
"patterns": [{
"name": "keyword.operator",
"match": "(\\+|\\-|\\*|\\\/|\\%|\\!|\\||\\&|\\^|\\<\\<|\\>\\>|\\<|\\>|\\=)"
}]
},
"function": {
"patterns": [{
"name": "entity.name.function.crossasm",
"match": "\\b[_a-zA-Z\\x80-\\xFF\\$][_a-zA-Z0-9\\x80-\\xFF\\$]*\\("
}]
},
"identifier": {
"patterns": [{
"name": "entity.name.crossasm",
"match": "\\b[_a-zA-Z\\x80-\\xFF\\$][_a-zA-Z0-9\\x80-\\xFF\\$]*"
}]
},
"double": {
"name": "constant.numeric.crossasm",
"match": "\\b[0-9][0-9]*\\.[0-9]*\\b"
},
"long": {
"patterns": [
{
"name": "constant.numeric.crossasm",
"match": "\\b[0-9][0-9]*\\b"
}
]
},
"keywords": {
"patterns": [
{
"name": "constant.language.crossasm",
"match": "\\b(true|false|null|undefined|this)\\b"
},
{
"name": "keyword.control.crossasm",
"match": "\\b(add|sub|mul|div|mod|lsh|rsh|bor|band|bnot|lt|gt|lte|gte|eq|neq|not|neg|xor|pop|dup|nop|lineinfo|embeddir|pushclosure|createdict|createarray|appendlist|appenddict|embed|embedstrm|push|scopebegin|scopeend|scopeendtimes|setvariable|getvariable|declarevariable|declareconstvariable|setfield|getfield|callfunction|callmethod|ret|jmpc|jmp|jmpundefined|defer|trycatch|throw|pushscopelessclosure|yield|breakpoint|jmpifbreak|jmpifcontinue|jmpifdefined|lbl)\\b"
},
{
"name": "keyword.crossasm",
"match": "\\b(root|func|class|public|private|protected|static)\\b"
}
]
},
"chars": {
"name": "constant.character.crossasm",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.crossasm",
"match": "\\\\."
}
]
}
},
"scopeName": "source.crossasm"
}