Skip to content

Commit a981bcb

Browse files
committed
editor/pybricksMicroPython: fix numeric literal highlighting
This was picking up leading underscores, e.g. the first `__` in `__name__`.
1 parent 2f14fde commit a981bcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/editor/pybricksMicroPython.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export const language = <monaco.languages.IMonarchLanguage>{
224224
[/\b0[bB](0|1|_)+/, 'constant.numeric.bin'],
225225
[/\b0[oO]([0-7]|_)+/, 'constant.numeric.oct'],
226226
[/\b0[xX]([abcdef]|[ABCDEF]|\d|_)+/, 'constant.numeric.hex'],
227-
[/\b([\d_]*\.)?[\d_]+([eE][+-]?[\d_]+)?[jJ]?/, 'constant.numeric'],
227+
[/\b(\d[\d_]*\.|\.)?\d[\d_]*([eE][+-]?[\d_]+)?[jJ]?/, 'constant.numeric'],
228228
],
229229

230230
// Recognize strings, including those broken across lines with \ (but not without)

0 commit comments

Comments
 (0)