From 5625931c4c47ecbee34d2e909e41bc90b9eddeac Mon Sep 17 00:00:00 2001 From: Andreas <38031952+AnHeuermann@users.noreply.github.com> Date: Fri, 15 Mar 2024 14:54:10 +0100 Subject: [PATCH] Simplify regex (#44) * Simplify regex - Fixes exponential grow of possible matches crashing long lines * Improve enumeration highlighting --- package-lock.json | 4 ++-- package.json | 2 +- syntaxes/metamodelica.tmGrammar.yaml | 8 ++++---- syntaxes/modelica.tmGrammar.yaml | 6 +++--- test/metamodelica/Enumeration.test.mo | 22 ++++++++++++++++++---- test/metamodelica/FunctionDoc.test.mo | 10 ++++++++++ 6 files changed, 38 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 874b3be..07dce7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "metamodelica", - "version": "1.3.1", + "version": "1.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "metamodelica", - "version": "1.3.1", + "version": "1.3.2", "license": "See LICENSE.txt", "devDependencies": { "@vscode/vsce": "^2.21.1", diff --git a/package.json b/package.json index e7425f8..64b90d8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "metamodelica", "displayName": "MetaModelica", "description": "MetaModelica, Susan and Modelica language support.", - "version": "1.3.1", + "version": "1.3.2", "publisher": "AnHeuermann", "license": "See LICENSE.txt", "engines": { diff --git a/syntaxes/metamodelica.tmGrammar.yaml b/syntaxes/metamodelica.tmGrammar.yaml index e9040d4..186ad32 100644 --- a/syntaxes/metamodelica.tmGrammar.yaml +++ b/syntaxes/metamodelica.tmGrammar.yaml @@ -67,7 +67,7 @@ patterns: name: keyword.operator.arithmetic - match: \=|\:\= name: keyword.operator.assignment - - match: \b(algorithm|equation|protected|public|end|external|in)\b + - match: \b(algorithm|equation|protected|public|end|external|in|encapsulated)\b name: keyword - match: \b(matchcontinue|match|local|case|try|end matchcontinue|end match|end try)\b name: keyword.control @@ -85,7 +85,7 @@ patterns: name: support.type # Class Type - - begin: \b(record|type|package|function|uniontype)\s+(\w+)\s*((?