Skip to content

Commit

Permalink
Lex numbers before identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
samestep committed Jan 2, 2024
1 parent 1ab9911 commit cc3f966
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions packages/vscode/syntaxes/rose.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"include": "#keywords"
},
{
"include": "#identifiers"
"include": "#literals"
},
{
"include": "#literals"
"include": "#identifiers"
},
{
"include": "#punctuation"
Expand All @@ -39,43 +39,43 @@
},
{
"name": "keyword.other.rose",
"match": "\\b(and|in|or)\\b"
"match": "\\b(and|do|in|or)\\b"
},
{
"name": "storage.type.rose",
"match": "\\b(class|def|infix|infixl|infixr|instance|let|type|val)\\b"
}
]
},
"identifiers": {
"literals": {
"patterns": [
{
"name": "support.type.primitive.rose",
"match": "\\b(bool|f32|f64|i32|i64|u32|u64)\\b"
"name": "constant.numeric.rose",
"match": "\\b[0-9]+(\\.[0-9]+)?\\b"
},
{
"name": "entity.name.type.rose",
"match": "\\b([A-Z]\\w*)\\b"
"name": "string.quoted.double.rose",
"match": "\"([^\"\\\\]|\\\\.)*\""
},
{
"name": "constant.language.rose",
"match": "\\b(false|true)\\b"
},
{
"name": "variable.other.rose",
"match": "\\b(\\w+)\\b"
}
]
},
"literals": {
"identifiers": {
"patterns": [
{
"name": "constant.numeric.rose",
"match": "\\b[0-9]+\\b"
"name": "support.type.primitive.rose",
"match": "\\b(bool|f32|f64|i32|i64|u32|u64)\\b"
},
{
"name": "string.quoted.double.rose",
"match": "\"([^\"\\\\]|\\\\.)*\""
"name": "entity.name.type.rose",
"match": "\\b([A-Z]\\w*)\\b"
},
{
"name": "variable.other.rose",
"match": "\\b(\\w+)\\b"
}
]
},
Expand Down

0 comments on commit cc3f966

Please sign in to comment.