diff --git a/src/features/dfdElements/outputPortBehaviorValidation.ts b/src/features/dfdElements/outputPortBehaviorValidation.ts index a8377c1..f46f7ba 100644 --- a/src/features/dfdElements/outputPortBehaviorValidation.ts +++ b/src/features/dfdElements/outputPortBehaviorValidation.ts @@ -32,7 +32,8 @@ export class PortBehaviorValidator { // Regex that validates a term // Has the label type and label value that should be set as capturing groups. - private static readonly TERM_REGEX = /^(\s*|!|TRUE|FALSE|\|\||&&|\(|\)|([A-Za-z0-9_]+\.[A-Za-z0-9_]+))+$/; + private static readonly TERM_REGEX = + /^(\s*|!|TRUE|FALSE|\|\||&&|\(|\)|([A-Za-z0-9_]+\.[A-Za-z0-9_]+(?![A-Za-z0-9_]*\.[A-Za-z0-9_]*)))+$/g; private static readonly LABEL_REGEX = /([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)/g; @@ -335,6 +336,15 @@ export class PortBehaviorValidator { idx = line.indexOf(inputLabelValue, idx + 1); } } + + console.log(inputMatch); + + if (inputMatch[3] !== undefined) { + inputAccessErrors.push({ + line: lineNumber, + message: `invalid label definition`, + }); + } } const node = port.parent; @@ -451,6 +461,13 @@ export class PortBehaviorValidator { } } } + + if (typeValuePair.split(".")[2] !== undefined) { + inputAccessErrors.push({ + line: lineNumber, + message: `invalid label definition`, + }); + } } return inputAccessErrors.length > 0 ? inputAccessErrors : [];