From fe0a71cd88d211975227114cf966fff9d35e3cf6 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 28 Mar 2009 22:13:58 -0500 Subject: [PATCH] Fix an XMode bug exposed in the pastebin --- basis/xmode/code2html/code2html-tests.factor | 4 ++++ basis/xmode/marker/marker.factor | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/basis/xmode/code2html/code2html-tests.factor b/basis/xmode/code2html/code2html-tests.factor index 241ab7ff75..a35e6a2194 100644 --- a/basis/xmode/code2html/code2html-tests.factor +++ b/basis/xmode/code2html/code2html-tests.factor @@ -18,4 +18,8 @@ kernel io.streams.string xml.writer ; <" int x = "hi"; /* a comment */ "> htmlize-stream write-xml +] unit-test + +[ ": foo ;" ] [ + { ": foo ;" } "factor" htmlize-lines xml>string ] unit-test \ No newline at end of file diff --git a/basis/xmode/marker/marker.factor b/basis/xmode/marker/marker.factor index f584756f33..98b4f91f86 100755 --- a/basis/xmode/marker/marker.factor +++ b/basis/xmode/marker/marker.factor @@ -84,7 +84,7 @@ M: string-matcher text-matches? ] keep string>> length and ; M: regexp text-matches? - [ >string ] dip re-contains? ; + [ >string ] dip first-match to>> ; : rule-start-matches? ( rule -- match-count/f ) dup start>> tuck swap can-match-here? [ -- 2.34.1