From 11b0bfc03813285c32192baf182adb3678f5e56a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 24 Oct 2019 18:38:23 -0500 Subject: [PATCH] modern: Fix :> and :: ::: etc --- extra/modern/modern-tests.factor | 5 +++++ extra/modern/modern.factor | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/extra/modern/modern-tests.factor b/extra/modern/modern-tests.factor index 317db6f57f..c5b5ce47e5 100644 --- a/extra/modern/modern-tests.factor +++ b/extra/modern/modern-tests.factor @@ -146,6 +146,8 @@ IN: modern.tests { t } [ "FOO:" strict-upper? ] unit-test { t } [ ":" strict-upper? ] unit-test +{ t } [ "::" strict-upper? ] unit-test +{ t } [ ":::" strict-upper? ] unit-test { f } [ "" strict-upper? ] unit-test @@ -157,6 +159,9 @@ IN: modern.tests { f } [ ";FOO" section-close? ] unit-test { f } [ "FOO" section-close? ] unit-test +{ f } [ ":>" section-close? ] unit-test +{ f } [ ":::>" section-close? ] unit-test + ! Strings { diff --git a/extra/modern/modern.factor b/extra/modern/modern.factor index 0955ad5ca9..820cb9a535 100644 --- a/extra/modern/modern.factor +++ b/extra/modern/modern.factor @@ -179,7 +179,7 @@ MACRO:: read-matched ( ch -- quot: ( string n tag -- string n' slice' ) ) } 1&& ; : strict-upper? ( string -- ? ) - { [ ":" sequence= ] [ (strict-upper?) ] } 1|| ; + { [ [ char: \: = ] all? ] [ (strict-upper?) ] } 1|| ; ! : section-open? ( string -- ? ) @@ -254,6 +254,7 @@ MACRO:: read-matched ( ch -- quot: ( string n tag -- string n' slice' ) ) [ length 2 >= ] [ "\\" head? not ] ! XXX: good? [ ">" tail? ] + [ but-last [ char: \: = ] all? not ] ! :> ::> :::> not section-close [ { [ but-last strict-upper? ]