Skip to content

Commit

Permalink
feat: Basic syntax highlighting for type aliases (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
ospencer committed Oct 26, 2021
1 parent 5080b2c commit 8af29fd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions editor-extensions/vscode/syntaxes/grain.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@
},
"data-declarations": {
"patterns": [
{
"match": "\\b(type)\\b\\s+([A-Z]\\w*\\s*(<.*>\\s*)?)\\s*(=)\\s*(.*)",
"captures": {
"1": { "name": "storage.type.grain" },
"2": { "name": "entity.name.type.grain" },
"3": { "patterns": [{ "include": "#type-vector" }] },
"4": { "name": "keyword.operator.grain" },
"5": { "patterns": [{ "include": "#type" }] }
}
},
{
"begin": "\\b(enum)\\b\\s+([A-Z]\\w*\\s*(<.*>\\s*)?)\\s*(\\{)",
"end": "(\\})",
Expand Down Expand Up @@ -333,7 +343,7 @@
]
},
{
"match": "(record|enum)\\s+([A-Z]\\w*)(<.*>)?",
"match": "(type|record|enum)\\s+([A-Z]\\w*)(<.*>)?",
"captures": {
"1": { "name": "storage.type.grain" },
"2": { "name": "entity.name.type.grain" },
Expand Down Expand Up @@ -830,7 +840,7 @@
"name": "keyword.control.grain"
},
{
"match": "\\b(let|rec|mut|record|enum|foreign|primitive)\\b",
"match": "\\b(let|rec|mut|record|type|enum|foreign|primitive)\\b",
"name": "storage.type.grain"
}
]
Expand Down

0 comments on commit 8af29fd

Please sign in to comment.