phi-lang/vscode/phi/syntaxes/phi.tmLanguage.json
2025-09-10 09:57:36 +02:00

79 lines
1.4 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "phi",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#operators"
},
{
"include": "#numbers"
},
{
"include": "#strings"
},
{
"include": "#idents"
}
],
"repository": {
"keywords": {
"patterns": [
{
"name": "keyword.control.phi",
"match": "\\b(fn|call|return|loop|break|if|let|do)\\b"
},
{
"name": "keyword.operator.phi",
"match": "\\b(and|or|not)\\b"
},
{
"name": "constant.phi",
"match": "\\b(null|true|false)\\b"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.phi",
"match": "\\+|\\-|\\*|\\/|=|(\\+=)|(\\-=)|(==)|(!=)|<|>|(<=)|(>=)"
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.phi",
"match": "\\b0\\b"
},
{
"name": "constant.numeric.phi",
"match": "\\b[1-9][0-9]*(\\.[0-9]+)?\\b"
}
]
},
"strings": {
"name": "string.quoted.double.phi",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.phi",
"match": "\\\\."
}
]
},
"idents": {
"patterns": [
{
"name": "variable.phi",
"match": "\\b[a-zA-Z0-9_]+\\b"
}
]
}
},
"scopeName": "source.phi"
}