Fix bug with slow regex matcher
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a6e6a01cd0
commit
9674807093
20
.vscode/launch.json
vendored
Normal file
20
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "pwa-node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Program",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"program": "${workspaceFolder}\\lib\\index.js",
|
||||||
|
"outFiles": [
|
||||||
|
"${workspaceFolder}/**/*.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -54,7 +54,6 @@ function regexMatcher(regex: string | RegExp, type: TokenTypes): Matcher {
|
|||||||
|
|
||||||
const matcher = [
|
const matcher = [
|
||||||
regexMatcher(/^\s+/, "space"),
|
regexMatcher(/^\s+/, "space"),
|
||||||
regexMatcher(/^(\/\*)(.|\s)*?(\*\/)/g, "comment"),
|
|
||||||
regexMatcher(/^\/\/.+/, "comment"),
|
regexMatcher(/^\/\/.+/, "comment"),
|
||||||
regexMatcher(/^#.+/, "comment"),
|
regexMatcher(/^#.+/, "comment"),
|
||||||
regexMatcher(/^".*?"/, "string"),
|
regexMatcher(/^".*?"/, "string"),
|
||||||
|
Reference in New Issue
Block a user