From: Capital-Ex Date: Tue, 6 Sep 2022 15:09:26 +0000 (-0400) Subject: Account For Character Escapes X-Git-Tag: 0.99~1096 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=68394b0ce17cbf00c35ed7a75c8168ffe319480c Account For Character Escapes Additionally, precompute and store the regexp to avoid slowdowns from added complexity of expression. --- 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 ;