From 06a23eb6e2b149efc7bfb54876fc25031563220b Mon Sep 17 00:00:00 2001 From: Matthias Bodenbenner <m.bodenbenner@wzl-mq.rwth-aachen.de> Date: Thu, 16 May 2024 08:34:57 +0200 Subject: [PATCH] fixed some more issues in syntax highlighting --- .../SoilTextEditor/SoilHighlight.ts | 22 ++++++++++++------- .../soil-editor/SoilTextEditor/styles.css | 12 +++++----- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/features/soil-editor/SoilTextEditor/SoilHighlight.ts b/src/features/soil-editor/SoilTextEditor/SoilHighlight.ts index 1deb49c..4ac6fd7 100644 --- a/src/features/soil-editor/SoilTextEditor/SoilHighlight.ts +++ b/src/features/soil-editor/SoilTextEditor/SoilHighlight.ts @@ -15,7 +15,7 @@ export const soilHighlight = { }, 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, 'punctuation': /[{}[\],]/, - 'operator': /:/, + // 'operator': /:/, 'boolean': /\b(?:false|true)\b/, 'null': { pattern: /\bnull\b/, @@ -27,8 +27,14 @@ export const soilHighlight = { "modifier": { pattern: /\b(constant|dynamic|fixed|update)\b/ }, - "datatype": { - pattern: /\b(boolean|enum|float|int|string|time)\b/ + "datatype-full": { + pattern: /:\s?(boolean|enum|float|int|string|time)\b/, + inside: { + "datatype": { + pattern: /\b(boolean|enum|float|int|string|time)\b/ + } + } + }, "event": { pattern: /\b(critical|debug|error|if|info|warning)\b/ @@ -53,10 +59,10 @@ export const soilHighlight = { } } }, - // "semantics": { - // pattern: /<\w+:\w+>/, - // greedy: true, - // lookbehind: true - // } + "semantics": { + pattern: /<\w+:\w+>/, + greedy: true, + lookbehind: true + } }; \ No newline at end of file diff --git a/src/features/soil-editor/SoilTextEditor/styles.css b/src/features/soil-editor/SoilTextEditor/styles.css index 532fa4c..233dffb 100644 --- a/src/features/soil-editor/SoilTextEditor/styles.css +++ b/src/features/soil-editor/SoilTextEditor/styles.css @@ -119,7 +119,7 @@ body { } .dark-theme .token.event { - color: #c7c724 + color: #e748a5 } .dark-theme .token.warning { @@ -131,7 +131,7 @@ body { } .light-theme .token.event { - color: #0d931a + color: #e748a5 } .token.selector, @@ -143,7 +143,7 @@ body { color: #4caf50; } -.token.operator, +/* .token.operator, */ .token.entity, .token.url, .language-css .token.string, @@ -153,8 +153,7 @@ body { .token.atrule, .token.attr-value, -.token.keyword, -.token.prefix { +.token.keyword { color: #ff9800; } @@ -172,7 +171,8 @@ body { color: #4d854f; } -.token.semantics { +.token.semantics, +.token.prefix { color: #bb3030; } -- GitLab