mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
editor/pybricksMicroPython: improve operator highlighting
This handles newer things like the := operator better.
This commit is contained in:
committed by
David Lechner
parent
1db0c48844
commit
5bef7e2637
+1
-1
@@ -5,7 +5,7 @@
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- Improved syntax highlighting for numeric literals.
|
||||
- Improved syntax highlighting for operators and numeric literals.
|
||||
|
||||
## [2.1.0-beta.2] - 2022-12-26
|
||||
|
||||
|
||||
@@ -180,13 +180,12 @@ export const language = <monaco.languages.IMonarchLanguage>{
|
||||
{ include: '@whitespace' },
|
||||
{ include: '@numbers' },
|
||||
{ include: '@strings' },
|
||||
{ include: '@operators' },
|
||||
|
||||
[/[,:;]/, 'delimiter'],
|
||||
[/[{}[\]()]/, '@brackets'],
|
||||
|
||||
[/@[a-zA-Z_]\w*/, 'tag'],
|
||||
|
||||
[/\.\.\./, 'keyword'],
|
||||
[/->/, 'delimiter'],
|
||||
{ include: '@operators' },
|
||||
[/[,:.;=]/, 'delimiter'],
|
||||
[/[{}[\]()]/, '@brackets'],
|
||||
[
|
||||
/[a-zA-Z_]\w*/,
|
||||
{
|
||||
@@ -249,7 +248,12 @@ export const language = <monaco.languages.IMonarchLanguage>{
|
||||
[/\\$/, 'string'],
|
||||
],
|
||||
|
||||
operators: [[/[=+\-*/%@&|<>!~^]/, 'keyword.operator']],
|
||||
operators: [
|
||||
[
|
||||
/(\*\*|\/\/|<<|>>|:=|<=|>=|==|!=|\+=|-=|\*-|\/=|\.\.=|%=|@=|&=|\|=|\^=|>>=|<<=|\*\*=|[+\-*/%@&|^~<>])/,
|
||||
'keyword.operator',
|
||||
],
|
||||
],
|
||||
|
||||
attributes: [
|
||||
[/\b/, '@pop'],
|
||||
|
||||
Reference in New Issue
Block a user