Files
airalang/vscode-extension/syntaxes/airalang.tmLanguage.json
T

133 lines
3.1 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "AiraLang",
"scopeName": "source.aira",
"patterns": [
{ "include": "#comments" },
{ "include": "#directives" },
{ "include": "#strings" },
{ "include": "#numbers" },
{ "include": "#keywords" },
{ "include": "#builtins" },
{ "include": "#operators" },
{ "include": "#functions" }
],
"repository": {
"directives": {
"patterns": [
{
"name": "keyword.control.directive.aira",
"match": "(@airaai|@aira)"
}
]
},
"comments": {
"patterns": [
{
"name": "comment.line.number-sign.aira",
"match": "#.*$"
},
{
"name": "comment.line.double-slash.aira",
"match": "//.*$"
},
{
"name": "comment.block.aira",
"begin": "/\\*",
"end": "\\*/"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.aira",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.aira",
"match": "\\\\."
}
]
},
{
"name": "string.quoted.single.aira",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.aira",
"match": "\\\\."
}
]
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.aira",
"match": "\\b\\d+(\\.\\d+)?\\b"
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.control.aira",
"match": "\\b(if|else|while|for|in|return|break|continue)\\b"
},
{
"name": "keyword.declaration.aira",
"match": "\\b(let|fn|class|new|import|from)\\b"
},
{
"name": "keyword.other.say.aira",
"match": "\\b(say)\\b"
},
{
"name": "constant.language.aira",
"match": "\\b(true|false|null|this)\\b"
}
]
},
"builtins": {
"patterns": [
{
"name": "support.class.module.aira",
"match": "\\b(system|hardware|android|droidsec|ai|sec|proposal|http|file|os|math|time|json|crypto|string|sqlite|net|thread)\\b"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.arithmetic.aira",
"match": "(\\+|\\-|\\*|\\/|\\%)"
},
{
"name": "keyword.operator.comparison.aira",
"match": "(==|!=|≠|<=|>=|<|>)"
},
{
"name": "keyword.operator.logical.aira",
"match": "(&&|\\|\\||!|\\band\\b|\\bor\\b|\\bnot\\b)"
},
{
"name": "keyword.operator.assignment.aira",
"match": "(=)"
}
]
},
"functions": {
"patterns": [
{
"name": "entity.name.function.aira",
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?=\\()"
}
]
}
}
}