diff --git a/vs code extension/server/src/server.ts b/vs code extension/server/src/server.ts index 2409a725..ec039d0b 100644 --- a/vs code extension/server/src/server.ts +++ b/vs code extension/server/src/server.ts @@ -188,13 +188,23 @@ async function validateTextDocument(textDocument: TextDocument): Promise { let text = textDocument.getText(); let m: RegExpExecArray | null; - // Find unclosed delimiters of each type. - //TODO: Make regex exclude keywords inside quotes. //TODO: Make regex' more efficient. Somewhat slow on large files. - const delimiters = - [[/(? [ + new RegExp(`${sixDigitsFollowedByAsterisk}${notInSingleQuotes}${notInDoubleQuotes}${start}`), + new RegExp(`${sixDigitsFollowedByAsterisk}${notInSingleQuotes}${notInDoubleQuotes}${end}`) + ]; + + const delimiters: RegexPair[] = [ + createRegexPair("BEFORE(-| )EACH", "END-BEFORE"), + createRegexPair("(?