This commit is contained in:
koniifer 2024-09-28 16:12:59 +01:00
parent a95e98a650
commit adaccda70b
2 changed files with 64 additions and 36 deletions

View file

@ -16,7 +16,6 @@
"Formatters"
],
"activationEvents": [
"onLanguage:hblang",
"onCommand:extension.formatDocument"
],
"contributes": {

View file

@ -19,10 +19,13 @@
"include": "#string"
},
{
"include": "#number"
"include": "#keyword"
},
{
"include": "#keyword"
"include": "#function"
},
{
"include": "#number"
},
{
"include": "#struct"
@ -33,9 +36,6 @@
{
"include": "#variable"
},
{
"include": "#function"
},
{
"include": "#operator"
},
@ -122,19 +122,23 @@
"patterns": [
{
"name": "storage.type.hblang",
"match": "\\buint|int|(u|i)(8|16|32)|void|bool|[A-Z]\\w+\\b"
"match": "\\b(uint|int|(u|i)(8|16|32)|void|bool|type|never|([A-Z]\\w+))\\b"
}
]
},
"variable": {
"patterns": [
{
"name": "variable.other.declaration.hblang",
"name": "variable.parameter.hblang",
"match": "\\b\\w+\\s*:=\\b"
},
{
"name": "variable.other.assignment.hblang",
"name": "variable.parameter.hblang",
"match": "\\b\\w+\\s*=\\b"
},
{
"name": "variable.parameter.hblang",
"match": "(?<=\\w+\\.)(\\w+)\\b"
}
]
},
@ -150,18 +154,44 @@
"patterns": [
{
"name": "entity.name.function.hblang",
"begin": "\\b\\w+\\s*\\(",
"begin": "(?<!\\w)fn\\s*\\(",
"end": "\\)",
"captures": {
"0": {
"name": "keyword.hblang"
}
},
"patterns": [
{
"include": "#all"
},
{
"include": "#parameter"
"name": "variable.parameter.hblang",
"match": "\\b\\w+\\b(\\s*,\\s*\\b\\w+\\b)*"
}
]
},
{
"name": "entity.name.function.hblang",
"begin": "(?:@)?\\b\\w+\\s*\\(",
"end": "\\)",
"captures": {
"0": {
"name": "entity.name.function.hblang"
}
},
"patterns": [
{
"include": "#all"
},
{
"name": "variable.parameter.hblang",
"match": "\\b\\w+\\b(\\s*,\\s*\\b\\w+\\b)*"
}
]
}
]
}
},
"struct": {
"patterns": [
@ -189,4 +219,3 @@
]
}
}
}