From e47092f0114f159cc2255a1d328c5b9b16eaca10 Mon Sep 17 00:00:00 2001 From: Huell Date: Wed, 2 Oct 2024 16:51:48 +0200 Subject: [PATCH 1/3] Feat: Change port name delimiter from _ to ; --- src/features/dfdElements/outputPortBehaviorValidation.ts | 4 ++-- src/features/dfdElements/outputPortEditUi.ts | 2 +- src/features/dfdElements/ports.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/features/dfdElements/outputPortBehaviorValidation.ts b/src/features/dfdElements/outputPortBehaviorValidation.ts index b2736e5..d59a749 100644 --- a/src/features/dfdElements/outputPortBehaviorValidation.ts +++ b/src/features/dfdElements/outputPortBehaviorValidation.ts @@ -23,11 +23,11 @@ export class PortBehaviorValidator { // Regex that validates a set statement. // Has the label type and label value that should be set as capturing groups. private static readonly SET_REGEX = - /^set +([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*) *= *(?: +|!|TRUE|FALSE|\|\||&&|\(|\)|[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*){2})+$/; + /^set +([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*) *= *(?: +|!|TRUE|FALSE|\|\||&&|\(|\)|[A-Za-z][A-Za-z0-9_;]*(?:\.[A-Za-z][A-Za-z0-9_;]*){2})+$/; // Regex that is used to extract all inputs, their label types and label values from a set statement. // Each input is a match with the input name, label type and label value as capturing groups. private static readonly SET_REGEX_EXPRESSION_INPUTS = - /([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*)/g; + /([A-Za-z][A-Za-z0-9_;]*)\.([A-Za-z][A-Za-z0-9_;]*)\.([A-Za-z][A-Za-z0-9_;]*)/g; // Regex matching alphanumeric characters. public static readonly REGEX_ALPHANUMERIC = /[A-Za-z0-9_]+/; diff --git a/src/features/dfdElements/outputPortEditUi.ts b/src/features/dfdElements/outputPortEditUi.ts index ee4c493..cb2552f 100644 --- a/src/features/dfdElements/outputPortEditUi.ts +++ b/src/features/dfdElements/outputPortEditUi.ts @@ -103,7 +103,7 @@ const dfdBehaviorLanguageMonarchDefinition: monaco.languages.IMonarchLanguage = root: [ // keywords and identifiers [ - /[a-zA-Z_$][\w$]*/, + /[a-zA-Z_;$][\w$]*/, { cases: { "@keywords": "keyword", diff --git a/src/features/dfdElements/ports.tsx b/src/features/dfdElements/ports.tsx index a61e740..f45f10c 100644 --- a/src/features/dfdElements/ports.tsx +++ b/src/features/dfdElements/ports.tsx @@ -54,7 +54,7 @@ export class DfdInputPortImpl extends SPortImpl { if (edgeNames.length === 0) { return undefined; } else { - return edgeNames.sort().join("_"); + return edgeNames.sort().join(";"); } } From f5be7ec11e81d5674a975b9cb69c00704d12df8d Mon Sep 17 00:00:00 2001 From: Huell Date: Wed, 2 Oct 2024 20:21:15 +0200 Subject: [PATCH 2/3] Feat: Change delimiter --- src/features/dfdElements/outputPortBehaviorValidation.ts | 6 +++--- src/features/dfdElements/outputPortEditUi.ts | 2 +- src/features/dfdElements/ports.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/features/dfdElements/outputPortBehaviorValidation.ts b/src/features/dfdElements/outputPortBehaviorValidation.ts index d59a749..768ab29 100644 --- a/src/features/dfdElements/outputPortBehaviorValidation.ts +++ b/src/features/dfdElements/outputPortBehaviorValidation.ts @@ -23,13 +23,13 @@ export class PortBehaviorValidator { // Regex that validates a set statement. // Has the label type and label value that should be set as capturing groups. private static readonly SET_REGEX = - /^set +([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*) *= *(?: +|!|TRUE|FALSE|\|\||&&|\(|\)|[A-Za-z][A-Za-z0-9_;]*(?:\.[A-Za-z][A-Za-z0-9_;]*){2})+$/; + /^set +([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*) *= *(?: +|!|TRUE|FALSE|\|\||&&|\(|\)|[A-Za-z][A-Za-z0-9_\|]*(?:\.[A-Za-z][A-Za-z0-9_\|]*){2})+$/; // Regex that is used to extract all inputs, their label types and label values from a set statement. // Each input is a match with the input name, label type and label value as capturing groups. private static readonly SET_REGEX_EXPRESSION_INPUTS = - /([A-Za-z][A-Za-z0-9_;]*)\.([A-Za-z][A-Za-z0-9_;]*)\.([A-Za-z][A-Za-z0-9_;]*)/g; + /([A-Za-z][A-Za-z0-9_\|]*)\.([A-Za-z][A-Za-z0-9_\|]*)\.([A-Za-z][A-Za-z0-9_\|]*)/g; // Regex matching alphanumeric characters. - public static readonly REGEX_ALPHANUMERIC = /[A-Za-z0-9_]+/; + public static readonly REGEX_ALPHANUMERIC = /[A-Za-z0-9_\|]+/; constructor(@inject(LabelTypeRegistry) @optional() private readonly labelTypeRegistry?: LabelTypeRegistry) {} diff --git a/src/features/dfdElements/outputPortEditUi.ts b/src/features/dfdElements/outputPortEditUi.ts index cb2552f..6d7a28e 100644 --- a/src/features/dfdElements/outputPortEditUi.ts +++ b/src/features/dfdElements/outputPortEditUi.ts @@ -103,7 +103,7 @@ const dfdBehaviorLanguageMonarchDefinition: monaco.languages.IMonarchLanguage = root: [ // keywords and identifiers [ - /[a-zA-Z_;$][\w$]*/, + /[a-zA-Z_\|$][\w$]*/, { cases: { "@keywords": "keyword", diff --git a/src/features/dfdElements/ports.tsx b/src/features/dfdElements/ports.tsx index f45f10c..6d0f5e6 100644 --- a/src/features/dfdElements/ports.tsx +++ b/src/features/dfdElements/ports.tsx @@ -54,7 +54,7 @@ export class DfdInputPortImpl extends SPortImpl { if (edgeNames.length === 0) { return undefined; } else { - return edgeNames.sort().join(";"); + return edgeNames.sort().join("|"); } } From 2459eb08536f2cf25a6725d3edbe0cac6cf8082c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20H=C3=BCller?= <62952208+01Parzival10@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:59:51 +0200 Subject: [PATCH 3/3] Fix: outputPortBehaviorValidation.ts Regex --- src/features/dfdElements/outputPortBehaviorValidation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/dfdElements/outputPortBehaviorValidation.ts b/src/features/dfdElements/outputPortBehaviorValidation.ts index 768ab29..023b74d 100644 --- a/src/features/dfdElements/outputPortBehaviorValidation.ts +++ b/src/features/dfdElements/outputPortBehaviorValidation.ts @@ -23,11 +23,11 @@ export class PortBehaviorValidator { // Regex that validates a set statement. // Has the label type and label value that should be set as capturing groups. private static readonly SET_REGEX = - /^set +([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*) *= *(?: +|!|TRUE|FALSE|\|\||&&|\(|\)|[A-Za-z][A-Za-z0-9_\|]*(?:\.[A-Za-z][A-Za-z0-9_\|]*){2})+$/; + /^set +([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*) *= *(?: +|!|TRUE|FALSE|\|\||&&|\(|\)|[A-Za-z][A-Za-z0-9_\|]*(?:\.[A-Za-z][A-Za-z0-9_]*){2})+$/; // Regex that is used to extract all inputs, their label types and label values from a set statement. // Each input is a match with the input name, label type and label value as capturing groups. private static readonly SET_REGEX_EXPRESSION_INPUTS = - /([A-Za-z][A-Za-z0-9_\|]*)\.([A-Za-z][A-Za-z0-9_\|]*)\.([A-Za-z][A-Za-z0-9_\|]*)/g; + /([A-Za-z][A-Za-z0-9_\|]*)\.([A-Za-z][A-Za-z0-9_]*)\.([A-Za-z][A-Za-z0-9_]*)/g; // Regex matching alphanumeric characters. public static readonly REGEX_ALPHANUMERIC = /[A-Za-z0-9_\|]+/;