Fix bug with slow regex matcher
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm
2020-10-28 02:00:35 +01:00
parent a6e6a01cd0
commit 9674807093
2 changed files with 20 additions and 1 deletions

View File

@ -54,7 +54,6 @@ function regexMatcher(regex: string | RegExp, type: TokenTypes): Matcher {
const matcher = [
regexMatcher(/^\s+/, "space"),
regexMatcher(/^(\/\*)(.|\s)*?(\*\/)/g, "comment"),
regexMatcher(/^\/\/.+/, "comment"),
regexMatcher(/^#.+/, "comment"),
regexMatcher(/^".*?"/, "string"),