phi-lang/vscode/phi/syntaxes/phi.tmLanguage.json
2025-09-10 15:43:53 +02:00

83 lines
1.7 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "phi",
"patterns": [
{ "include": "#comments" },
{ "include": "#keywords" },
{ "include": "#operators" },
{ "include": "#numbers" },
{ "include": "#strings" },
{ "include": "#idents" }
],
"repository": {
"comments": {
"patterns": [
{
"name": "comment.line.phi",
"begin": "//",
"end": "\\n"
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.control.phi",
"match": "\\b(fn|return|loop|for|break|if|do|call)\\b"
},
{
"name": "storage.type.phi",
"match": "\\b(let)\\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"
}