Skip to content

Commit

Permalink
Improve: Function highlighting of extension & error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
KennyOliver committed Jan 5, 2025
1 parent 7fcd11b commit 17204d9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "flavorlang-vscode",
"displayName": "FlavorLang Support",
"description": "Syntax highlighting for FlavorLang programming language.",
"version": "1.2.3",
"version": "1.3.0",
"publisher": "KennyOliver",
"repository": {
"type": "git",
Expand Down
34 changes: 28 additions & 6 deletions vscode-extension/syntaxes/flavorlang.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
{ "include": "#functions" },
{ "include": "#numbers" },
{ "include": "#operators" },
{ "include": "#variables" }
{ "include": "#variables" },
{ "include": "#ranges" },
{ "include": "#error-handling" }
],
"repository": {
"comments": {
Expand Down Expand Up @@ -38,7 +40,7 @@
"patterns": [
{
"name": "keyword.control.flavorlang",
"match": "\\b(let|const|if|elif|else|for|in|while|create|burn|deliver|check|is|rescue|try|break|continue)\\b"
"match": "\\b(let|const|if|elif|else|for|in|while|create|burn|deliver|check|is|rescue|try|rescue|finish|break|continue)\\b"
},
{
"name": "keyword.other.flavorlang",
Expand All @@ -49,20 +51,24 @@
"functions": {
"patterns": [
{
"name": "entity.name.function.flavorlang",
"match": "\\b(serve|burn|deliver|sample|plate_file|garnish_file|taste_file|create|check|rescue|string|int|float|get_time)\\b(?=\\()"
"name": "entity.name.function.create.flavorlang",
"match": "\\bcreate\\b\\s+[a-zA-Z_][a-zA-Z0-9_]*\\b"
},
{
"name": "entity.name.function.call.flavorlang",
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b(?=\\()"
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.integer.flavorlang",
"match": "\\b\\d+\\b"
"match": "\\b-?\\d+\\b"
},
{
"name": "constant.numeric.float.flavorlang",
"match": "\\b\\d+\\.\\d+\\b"
"match": "\\b-?\\d+\\.\\d+\\b"
}
]
},
Expand All @@ -85,6 +91,22 @@
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
}
]
},
"ranges": {
"patterns": [
{
"name": "meta.range.flavorlang",
"match": "\\b\\d+\\.\\.=?\\d+\\b"
}
]
},
"error-handling": {
"patterns": [
{
"name": "keyword.control.error-handling.flavorlang",
"match": "\\b(burn|rescue|try|deliver)\\b"
}
]
}
},
"scopeName": "source.flavorlang"
Expand Down

0 comments on commit 17204d9

Please sign in to comment.