From 6ccd58f2787a8367bdbbd73debce71f38fcc7306 Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Mon, 9 Mar 2009 17:29:32 -0500 Subject: [PATCH] Making all the regexp words compile --- basis/regexp/compiler/compiler.factor | 14 ++++++++------ basis/regexp/regexp-tests.factor | 5 ++--- 2 files changed, 10 insertions(+), 9 deletions(-) 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