From a981bcbda24f1174edc10cd38b0e4d1e2ce7ab2c Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 28 Dec 2022 16:40:43 -0600 Subject: [PATCH] editor/pybricksMicroPython: fix numeric literal highlighting This was picking up leading underscores, e.g. the first `__` in `__name__`. --- src/editor/pybricksMicroPython.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/pybricksMicroPython.ts b/src/editor/pybricksMicroPython.ts index 185297f7..8e148c8f 100644 --- a/src/editor/pybricksMicroPython.ts +++ b/src/editor/pybricksMicroPython.ts @@ -224,7 +224,7 @@ export const language = { [/\b0[bB](0|1|_)+/, 'constant.numeric.bin'], [/\b0[oO]([0-7]|_)+/, 'constant.numeric.oct'], [/\b0[xX]([abcdef]|[ABCDEF]|\d|_)+/, 'constant.numeric.hex'], - [/\b([\d_]*\.)?[\d_]+([eE][+-]?[\d_]+)?[jJ]?/, 'constant.numeric'], + [/\b(\d[\d_]*\.|\.)?\d[\d_]*([eE][+-]?[\d_]+)?[jJ]?/, 'constant.numeric'], ], // Recognize strings, including those broken across lines with \ (but not without)