Skip to content

Commit

Permalink
fix: Correctly highlight function type annotations in type vectors (#131
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ospencer committed Jul 26, 2022
1 parent 3dbf007 commit 5b025e9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions editor-extensions/vscode/syntaxes/grain.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
},
{
"begin": "(\\b[A-Z]\\w*\\b)\\s*(<)",
"end": "(>)",
"end": "((?<!-)>)",
"beginCaptures": {
"1": {
"name": "entity.name.type.grain"
Expand All @@ -179,8 +179,7 @@
"1": { "name": "punctuation.definition.parameters.grain" }
},
"patterns": [
{ "include": "#type-constructor" },
{ "include": "#type-var" },
{ "include": "#type" },
{
"match": ",",
"name": "punctuation.definition.parameters.grain"
Expand Down Expand Up @@ -239,28 +238,28 @@
"patterns": [{ "include": "#type" }]
},
{
"match": "(->)\\s*(\\w+(\\.\\w+)*(<.*?>)?)",
"match": "(->)\\s*(\\w+(\\.\\w+)*(<.*?(?<!-)>)?)",
"captures": {
"1": { "name": "keyword.operator.grain" },
"2": { "patterns": [{ "include": "#type" }] }
}
},
{
"match": "(:)\\s*(\\w+(\\.\\w+)*(<.*?>)?\\s*->\\s*\\w+(<.*?>)?)",
"match": "(:)\\s*(\\w+(\\.\\w+)*(<.*?(?<!-)>)?\\s*->\\s*\\w+(<.*?(?<!-)>)?)",
"captures": {
"1": { "name": "keyword.operator.grain" },
"2": { "patterns": [{ "include": "#type" }] }
}
},
{
"match": "(:)\\s*(\\w+(\\.\\w+)*(<.*?>)?\\s*->\\s*\\(.*\\))",
"match": "(:)\\s*(\\w+(\\.\\w+)*(<.*?(?<!-)>)?\\s*->\\s*\\(.*\\))",
"captures": {
"1": { "name": "keyword.operator.grain" },
"2": { "patterns": [{ "include": "#type" }] }
}
},
{
"match": "(:)\\s*(\\w+(\\.\\w+)*(<.*?>)?)",
"match": "(:)\\s*(\\w+(\\.\\w+)*(<.*?(?<!-)>)?)",
"captures": {
"1": { "name": "keyword.operator.grain" },
"2": { "patterns": [{ "include": "#type" }] }
Expand Down

0 comments on commit 5b025e9

Please sign in to comment.