Skip to content

Commit

Permalink
feat: some syntax highlighting improvements (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite authored Jan 8, 2025
1 parent cf4b161 commit ed74a75
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions syntaxes/noir.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@
},
"patterns": [
{
"match": "[a-zA-Z_(::)][a-zA-Z0-9_]*",
"name": "support.type.nr"
"include": "#code"
}
]
},
Expand Down Expand Up @@ -233,7 +232,7 @@
},
{
"name": "keyword.nr",
"match": "\\b(global|comptime|quote|unsafe|unconstrained|pub|&mut|mut|self|in|as|let)\\b"
"match": "\\b(global|comptime|quote|unsafe|unconstrained|pub|crate|&mut|mut|self|in|as|let)\\b"
}
]
},
Expand All @@ -248,11 +247,18 @@
"match": "\\b(_*[A-Z][a-zA-Z0-9_]*|[a-zA-Z_][a-zA-Z0-9_]*::)\\b"
},
{
"begin": "\\b([a-z_][a-zA-Z0-9_]*)\\s*\\(",
"begin": "\\b([a-z_][a-zA-Z0-9_]*)\\s*(::<(.*)>\\s*)?\\(",
"end": "\\)",
"beginCaptures": {
"1": {
"name": "support.function.nr"
},
"2": {
"patterns": [
{
"include": "#code"
}
]
}
},
"patterns": [
Expand All @@ -270,15 +276,15 @@
"--struct-content": {
"patterns": [
{
"begin": "[a-zA-Z_][a-zA-Z0-9_]*",
"end": "([a-zA-Z_][a-zA-Z0-9_]*)|,",
"beginCaptures": {
"0": {
"name": "support.type.property-name.nr"
}
},
"endCaptures": {
"match": "(pub|pub\\(crate\\))?\\s*([a-zA-Z_][a-zA-Z0-9_]*)\\s*:\\s*([a-zA-Z_][a-zA-Z0-9_]*)",
"captures": {
"1": {
"name": "keyword.nr"
},
"2": {
"name": "support.type.property-name.nr"
},
"3": {
"name": "support.type.nr"
}
},
Expand Down

0 comments on commit ed74a75

Please sign in to comment.