diff --git a/basis/regexp/compiler/compiler.factor b/basis/regexp/compiler/compiler.factor index 23171b4636..eedf05a81e 100644 --- a/basis/regexp/compiler/compiler.factor +++ b/basis/regexp/compiler/compiler.factor @@ -106,13 +106,15 @@ C: box transitions>quot ; : states>code ( words dfa -- ) - '[ + [ ! with-compilation-unit doesn't compile, so we need call( -- ) [ - dup _ word>quot - (( last-match index string -- ? )) - define-declared - ] each - ] with-compilation-unit ; + '[ + dup _ word>quot + (( last-match index string -- ? )) + define-declared + ] each + ] with-compilation-unit + ] call( words dfa -- ) ; : states>words ( dfa -- words dfa ) dup transitions>> keys [ gensym ] H{ } map>assoc diff --git a/basis/regexp/regexp-tests.factor b/basis/regexp/regexp-tests.factor index 0a448ed276..99cb8dbd22 100644 --- a/basis/regexp/regexp-tests.factor +++ b/basis/regexp/regexp-tests.factor @@ -5,9 +5,8 @@ eval strings multiline accessors regexp.matchers ; IN: regexp-tests \ must-infer -! the following don't compile because [ ] with-compilation-unit doesn't compile -! \ compile-regexp must-infer -! \ matches? must-infer +\ compile-regexp must-infer +\ matches? must-infer [ f ] [ "b" "a*" matches? ] unit-test [ t ] [ "" "a*" matches? ] unit-test