Add better crosslang

This commit is contained in:
2026-01-22 02:27:36 -06:00
parent 3af3f08395
commit d5906e552c
3 changed files with 150 additions and 2 deletions

View File

@@ -17,7 +17,14 @@
"aliases": ["CrossLang", "crosslang"],
"extensions": [".tcross"],
"configuration": "./language-configuration.json"
},{
},
{
"id": "bcrosslang",
"aliases": ["CrossLang", "better-crosslang"],
"extensions": [".btcross"],
"configuration": "./language-configuration.json"
}
,{
"id": "crossasm",
"aliases": ["CrossAsm", "crossasm"],
"extensions": [".tcasm"],
@@ -27,6 +34,10 @@
"language": "crosslang",
"scopeName": "source.crosslang",
"path": "./syntaxes/crosslang.tmLanguage.json"
},{
"language": "bcrosslang",
"scopeName": "source.bcrosslang",
"path": "./syntaxes/bcrosslang.tmLanguage.json"
},{
"language": "crossasm",
"scopeName": "source.crossasm",

View File

@@ -0,0 +1,137 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Better CrossLang",
"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.bcrosslang",
"begin": "//",
"end": "\\n"
},
{
"name": "comment.block.bcrosslang",
"begin": "\\/\\*",
"end": "\\*\\/"
},
{
"name": "comment.line.bcrosslang",
"begin": "#",
"end": "\\n"
},
{
"name":"comment.block.documentation.bcrosslang",
"begin": "\\/\\^",
"end": "\\^\\/"
}
]
},
"strings": {
"name": "string.quoted.double.bcrosslang",
"begin": "\\\"",
"end": "\\\"",
"patterns": [
{
"name": "constant.character.escape.bcrosslang",
"match": "\\\\."
}
]
},
"operators": {
"patterns": [{
"name": "keyword.operator",
"match": "(\\+|\\-|\\*|\\\/|\\%|\\!|\\||\\&|\\^|\\<\\<|\\>\\>|\\<|\\>|\\=)"
}]
},
"function": {
"patterns": [{
"name": "entity.name.function.bcrosslang",
"match": "\\b[_a-zA-Z\\x80-\\xFF\\$][_a-zA-Z0-9\\x80-\\xFF\\$]*\\("
}]
},
"identifier": {
"patterns": [{
"name": "entity.name.bcrosslang",
"match": "\\b[_a-zA-Z\\x80-\\xFF\\$][_a-zA-Z0-9\\x80-\\xFF\\$]*"
}]
},
"double": {
"name": "constant.numeric.bcrosslang",
"match": "\\b[0-9][0-9]*\\.[0-9]*\\b"
},
"long": {
"patterns": [
{
"name": "constant.numeric.bcrosslang",
"match": "\\b[0-9][0-9]*\\b"
}
]
},
"keywords": {
"patterns": [
{
"name": "constant.language.bcrosslang",
"match": "\\b(true|false|null|undefined|this)\\b"
},
{
"name": "keyword.operator.new.bcrosslang",
"match": "\\bnew\\b"
},
{
"name": "keyword.control.bcrosslang",
"match": "\\b(if|else|while|for|do|return|each|break|try|catch|finally|defer|enumerable|yield|switch|case|default|await|breakpoint|throw)\\b"
},
{
"name": "keyword.bcrosslang",
"match": "\\b(Double|Long|ByteArray|List|Dictionary|Object|String|Char|Callable|Path|Filesystem|Regex|Variant|Boolean|as|var|of|in|interface|delegate|extern|namespace|use|const|func|class|public|private|protected|static|operator|embed|embeddir|embedstrm|comptime|async)\\b"
}
]
},
"chars": {
"name": "constant.character.bcrosslang",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.bcrosslang",
"match": "\\\\."
}
]
}
},
"scopeName": "source.bcrosslang"
}

View File

@@ -112,7 +112,7 @@
},
{
"name": "keyword.control.crosslang",
"match": "\\b(if|else|while|for|do|return|each|break|try|catch|finally|defer|enumerable|yield|switch|case|default|await|breakpoint|throw)\\b"
"match": "\\b(if|else|while|for|do|return|each|in|break|try|catch|finally|defer|enumerable|yield|switch|case|default|await|breakpoint|throw)\\b"
},
{
"name": "keyword.crosslang",