From ed43df35fbf4b5f3f5d0020497a98374b4cfdbc8 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 24 Dec 2017 15:14:03 -0800 Subject: [PATCH] modern: Allow FOO: FOO; again --- extra/modern/modern-tests.factor | 12 ++++++++++++ extra/modern/modern.factor | 1 + 2 files changed, 13 insertions(+) diff --git a/extra/modern/modern-tests.factor b/extra/modern/modern-tests.factor index a776d9e42b..91cfe4495c 100644 --- a/extra/modern/modern-tests.factor +++ b/extra/modern/modern-tests.factor @@ -183,6 +183,7 @@ IN: modern.tests } [ "" string>literals >strings ] unit-test +![[ { { { @@ -202,3 +203,14 @@ IN: modern.tests } } } [ "foo:: [ 0 ][ 1 ][ 2 ][ 3 ] " string>literals >strings ] unit-test +]] + +{ + { + { "foo::" { { "" } { "[" { "0" } "]" } } } + { "[" { "1" } "]" } + { "[" { "2" } "]" } + { "[" { "3" } "]" } + { "" } + } +} [ "foo:: [ 0 ] [ 1 ] [ 2 ] [ 3 ] " string>literals >strings ] unit-test diff --git a/extra/modern/modern.factor b/extra/modern/modern.factor index 0cceb209b3..597efda7bd 100644 --- a/extra/modern/modern.factor +++ b/extra/modern/modern.factor @@ -207,6 +207,7 @@ ERROR: unexpected-terminator n string slice ; ! Also in stack effects ( T: int -- ) can be ended by -- and ) dup ?last { { [ dup ";" sequence= ] [ drop unclip-last 3array ] } + { [ dup ";" tail? ] [ drop unclip-last 3array ] } { [ dup "--" sequence= ] [ drop unclip-last -rot 2array [ rewind-slice ] dip ] } { [ dup "]" sequence= ] [ drop unclip-last -rot 2array [ rewind-slice ] dip ] } { [ dup "}" sequence= ] [ drop unclip-last -rot 2array [ rewind-slice ] dip ] }