124 lines
2.9 KiB
JSON
124 lines
2.9 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
"name": "AiraLang",
|
|
"scopeName": "source.aira",
|
|
"patterns": [
|
|
{ "include": "#comments" },
|
|
{ "include": "#strings" },
|
|
{ "include": "#numbers" },
|
|
{ "include": "#keywords" },
|
|
{ "include": "#builtins" },
|
|
{ "include": "#operators" },
|
|
{ "include": "#functions" }
|
|
],
|
|
"repository": {
|
|
"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)\\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*(?=\\()"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|