Skip to content

Commit

Permalink
Игнорируем лексемы в квадратных скобках #146
Browse files Browse the repository at this point in the history
  • Loading branch information
lintest committed Dec 30, 2022
1 parent c5b9fd6 commit 44318b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/languages/turbo-gherkin/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export class KeywordMatcher {
.map(w => w.join("\\s+")).join("|") + ")" + postfix, "i");
}

public tokens = {
tokens = {
word: /\p{L}[\p{L}\p{N}]*/,
param: /"[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*'|<[^>\\]*(?:\\.[^>\\]*)*>/,
number: /-?(\d*\.)?\d+([eE][+-]?\d+)?[jJ]?[lL]?/,
};
param: /"[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*'|<[^>\\]*(?:\\.[^>\\]*)*>|\[[^\]\\]*(?:\\.[^\]\\]*)*\]/,
}

public getSnippet(text: string): string {
const source = [this.tokens.word, this.tokens.param].map((reg: RegExp) => "(" + reg.source + ")").join("|");
Expand Down

0 comments on commit 44318b6

Please sign in to comment.