From 2e5273df527426a56282133027035054b6470460 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 24 Sep 2008 22:22:36 -0500 Subject: [PATCH] xmodes now can't contain whitespace. [ factor { 1 2 3 }] prints literally instead of getting syntax-highlighted --- basis/farkup/farkup-tests.factor | 3 +++ basis/farkup/farkup.factor | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/basis/farkup/farkup-tests.factor b/basis/farkup/farkup-tests.factor index 9120ec97f9..f136ec91d4 100644 --- a/basis/farkup/farkup-tests.factor +++ b/basis/farkup/farkup-tests.factor @@ -141,3 +141,6 @@ link-no-follow? off [ "

Factor-rific!

" ] [ "[[Factor]]-rific!" convert-farkup ] unit-test + +[ "

[ factor { 1 2 3 }]

" ] +[ "[ factor { 1 2 3 }]" convert-farkup ] unit-test diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index ec49655d5a..37233447bc 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -38,6 +38,7 @@ TUPLE: line ; EBNF: parse-farkup nl = ("\r\n" | "\r" | "\n") => [[ drop "\n" ]] +whitespace = " " | "\t" | nl heading1 = "=" (!("=" | nl).)+ "=" => [[ second >string heading1 boa ]] @@ -133,7 +134,7 @@ line = '___' => [[ drop line new ]] -named-code = '[' (!('{' | nl | '[').)+ '{' (!("}]").)+ "}]" +named-code = '[' (!('{' | whitespace | '[').)+ '{' (!("}]").)+ "}]" => [[ [ second >string ] [ fourth >string ] bi code boa ]] simple-code