Skip to content

Commit

Permalink
Update: Syntax highlighter extensions now recognizes built-in-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
KennyOliver committed Jan 19, 2025
1 parent b8597d2 commit 10b1547
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 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.5.0",
"version": "1.6.0",
"publisher": "KennyOliver",
"repository": {
"type": "git",
Expand Down
13 changes: 11 additions & 2 deletions vscode-extension/syntaxes/flavorlang.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{ "include": "#comments" },
{ "include": "#strings" },
{ "include": "#keywords" },
{ "include": "#builtin-functions" },
{ "include": "#functions" },
{ "include": "#numbers" },
{ "include": "#operators" },
Expand Down Expand Up @@ -40,14 +41,22 @@
"patterns": [
{
"name": "keyword.control.flavorlang",
"match": "\\b(let|const|if|elif|else|for|in|while|create|burn|deliver|check|is|rescue|try|rescue|finish|break|continue|import|export|cimport|floor|ceil|round|abs)\\b"
"match": "\\b(let|const|if|elif|else|for|in|while|create|burn|deliver|check|is|rescue|try|finish|break|continue)\\b"
},
{
"name": "keyword.other.flavorlang",
"match": "\\b(True|False|None)\\b"
}
]
},
"builtin-functions": {
"patterns": [
{
"name": "support.function.builtin.flavorlang",
"match": "\\b(?:sample|serve|burn|random|floor|ceil|round|abs|get_time|taste_file|plate_file|garnish_file|length|sleep|cimport)\\b(?=\\()"
}
]
},
"functions": {
"patterns": [
{
Expand All @@ -56,7 +65,7 @@
},
{
"name": "entity.name.function.call.flavorlang",
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b(?=\\()"
"match": "\\b(?!sample\\b|serve\\b|burn\\b|random\\b|floor\\b|ceil\\b|round\\b|abs\\b|get_time\\b|taste_file\\b|plate_file\\b|garnish_file\\b|length\\b|sleep\\b|cimport\\b)[a-zA-Z_][a-zA-Z0-9_]*\\b(?=\\()"
}
]
},
Expand Down

0 comments on commit 10b1547

Please sign in to comment.