From b522732a6763a1e103e5287821ecb43dd8759908 Mon Sep 17 00:00:00 2001 From: liquidev Date: Mon, 25 Nov 2024 16:59:51 +0100 Subject: [PATCH] fix prefix `_` in Rust syntax it should be handled as the start of an identifier --- static/syntax/rust.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/static/syntax/rust.json b/static/syntax/rust.json index f317747..2e4d258 100644 --- a/static/syntax/rust.json +++ b/static/syntax/rust.json @@ -20,8 +20,7 @@ "regex": "0[xX][0-9a-fA-F_]+([uif](8|16|32|64|128))?", "is": "literal" }, - { "regex": "[0-9_]+n", "is": "literal" }, - { "regex": "[0-9_]+(\\.[0-9_]*([eE][-+]?[0-9_]+)?)?", "is": "literal" }, + { "regex": "[0-9][0-9]*(\\.[0-9_]*([eE][-+]?[0-9_]+)?)?", "is": "literal" }, { "regex": "[+=/*^%<>!~|&\\.?:@-]+", "is": "operator" }, { "regex": "#!\\[", "is": "default" }, { @@ -29,7 +28,7 @@ "is": { "default": "function", "captures": ["default"] } }, { "regex": "[a-zA-Z_][a-zA-Z0-9_]*!", "is": "function" }, - { "regex": "[A-Z_][a-zA-Z0-9_]*", "is": "keyword2" }, + { "regex": "[A-Z][a-zA-Z0-9_]*", "is": "keyword2" }, { "regex": "union\\s+([a-zA-Z_][a-zA-Z0-9_]*)", "is": {