Skip to content

Commit

Permalink
feat: update grammar (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Nov 18, 2023
1 parent 3e25c19 commit 85d3d4d
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions syntaxes/noir.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@
"name": "token.error-token.nr",
"match": "(\\-)?\\d+\\.\\d+(\\.|[a-zA-Z])"
},
{
"name": "constant.numeric.nr",
"match": "(\\-)?0x[0-9a-fA-F]+"
},
{
"name": "constant.numeric.nr",
"match": "(\\-)?\\d+(\\.\\d+)?"
},
{
"name": "constant.language.nr",
"match": "\\b(true|false)\\b"
}
]
},
Expand Down Expand Up @@ -119,12 +127,15 @@
}
},
{
"match": "\\b(let)\\s+([a-zA-Z_][a-zA-Z0-9_]*)",
"match": "\\b(let)\\s+(mut\\s+)?([a-zA-Z_][a-zA-Z0-9_]*)",
"captures": {
"1": {
"name": "keyword.nr"
},
"2": {
"name": "keyword.nr"
},
"3": {
"name": "variable.nr"
}
}
Expand Down Expand Up @@ -218,19 +229,19 @@
"patterns": [
{
"name": "keyword.control.nr",
"match": "\\b(fn|mod|use|struct|if|else|for|constrain)\\b"
"match": "\\b(fn|impl|trait|type|mod|use|struct|if|else|for|constrain)\\b"
},
{
"name": "keyword.nr",
"match": "\\b(global|comptime|pub|in|as|let|true|false)\\b"
"match": "\\b(global|comptime|unconstrained|distinct|pub|&mut|mut|self|in|as|let)\\b"
}
]
},
"input": {
"patterns": [
{
"name": "support.type.nr",
"match": "\\b((u|i)\\d+|str|bool|Field|Witness)\\b"
"match": "\\b((u|i)\\d+|str|bool|Field)\\b"
},
{
"name": "support.type.nr",
Expand Down Expand Up @@ -313,4 +324,4 @@
}
},
"scopeName": "source.nr"
}
}

0 comments on commit 85d3d4d

Please sign in to comment.