Skip to content

Commit 87c0dca

Browse files
committed
Fix floating-point literals. Fixes #2.
1 parent f111285 commit 87c0dca

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

grammars/hlsl.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,21 @@
2323
"end": "$"
2424
},
2525
{
26-
"name": "constant.numeric.hlsl",
27-
"match": "\\b([0-9]+\\.?[0-9]*)\\b"
28-
},
29-
{
30-
"name": "constant.numeric.hlsl",
31-
"match": "\\b(\\.[0-9]+)\\b"
32-
},
33-
{
34-
"name": "constant.numeric.hex.hlsl",
35-
"match": "\\b(0x[0-9A-F]+)\\b"
36-
},
26+
"name": "constant.numeric.decimal.hlsl",
27+
"match": "\\b[0-9]+\\.[0-9]*(F|f)?\\b"
28+
},
29+
{
30+
"name": "constant.numeric.decimal.hlsl",
31+
"match": "(\\.([0-9]+)(F|f)?)\\b"
32+
},
33+
{
34+
"name": "constant.numeric.decimal.hlsl",
35+
"match": "\\b([0-9]+(F|f)?)\\b"
36+
},
37+
{
38+
"name": "constant.numeric.hex.hlsl",
39+
"match": "\\b(0(x|X)[0-9a-fA-F]+)\\b"
40+
},
3741
{
3842
"name": "constant.language.hlsl",
3943
"match": "\\b(false|true)\\b"

0 commit comments

Comments
 (0)