From 68394b0ce17cbf00c35ed7a75c8168ffe319480c Mon Sep 17 00:00:00 2001 From: Capital-Ex Date: Tue, 6 Sep 2022 11:09:26 -0400 Subject: [PATCH] Account For Character Escapes Additionally, precompute and store the regexp to avoid slowdowns from added complexity of expression. --- extra/lint/vocabs/vocabs.factor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extra/lint/vocabs/vocabs.factor b/extra/lint/vocabs/vocabs.factor index 8b692cc1c0..031f5df814 100644 --- a/extra/lint/vocabs/vocabs.factor +++ b/extra/lint/vocabs/vocabs.factor @@ -9,6 +9,11 @@ IN: lint.vocabs +LINT-VOCABS-REGEX set-global : save-dictionary ( -- ) dictionary get clone @@ -35,7 +40,7 @@ SYMBOL: old-dictionary "USING: [^;]+ ;|USE: \\S+" all-matching-subseqs ; : clean-up-source ( string -- string ) - "\"(\\\\\"|[^\"])*\"|R/ (\\\\/|[^/])*/|\\\\\\s+(USE:|USING:)|POSTPONE:\\s+(USE:|USING:)|! [^\n]*|CHAR:\\s+\\S+\\s+" "" re-replace ; + LINT-VOCABS-REGEX get-global "" re-replace ; : strip-syntax ( seq -- seq ) [ "USING: | ;|USE: " " " re-replace ] map ; -- 2.34.1