diff --git a/extra/modern/modern-tests.factor b/extra/modern/modern-tests.factor index 8ec5fe1445..ae3989c46c 100644 --- a/extra/modern/modern-tests.factor +++ b/extra/modern/modern-tests.factor @@ -265,4 +265,20 @@ IN: modern.tests { } [ "REAL[5][5]" string>literals drop ] unit-test { 1 } [ "ABC\\DEF: 1" string>literals length ] unit-test -{ 2 } [ "ABC\\DEF: 1 2 3 B\\C: lol" string>literals length ] unit-test \ No newline at end of file +{ 2 } [ "ABC\\DEF: 1 2 3 B\\C: lol" string>literals length ] unit-test + +{ } [ + "{ B: 1 } D: 3" string>literals drop +] unit-test + +{ } [ + "{ B: 1 -- C: 2 } D: 3" string>literals drop +] unit-test + +{ } [ + "[ B: 1 -- C: 2 ] D: 3" string>literals drop +] unit-test + +{ } [ + "( B: 1 -- C: 2 ) D: 3" string>literals drop +] unit-test \ No newline at end of file diff --git a/extra/modern/modern.factor b/extra/modern/modern.factor index 172142f34e..cc42932aae 100644 --- a/extra/modern/modern.factor +++ b/extra/modern/modern.factor @@ -3,8 +3,9 @@ USING: accessors arrays assocs combinators combinators.short-circuit continuations io.encodings.utf8 io.files kernel make math math.order math.parser modern.compiler -modern.paths modern.slices sequences sequences.extras sets -splitting strings syntax.modern unicode vocabs.loader ; +modern.paths modern.slices sequences sequences.extras +sequences.generalizations sets splitting strings syntax.modern +unicode vocabs.loader ; IN: modern : ( obj -- obj ) ; @@ -310,7 +311,7 @@ MACRO:: read-matched ( $ch -- quot: ( string n tag -- string n' slice' ) ) } 1&& ; : read-til-semicolon ( string n slice -- string n' semi ) - [ but-last ";" append ";" "--" ")" 4array lex-colon-until ] keep + [ but-last ";" append ";" "--" ")" "]" "}" 6 narray lex-colon-until ] keep swap ! What ended the FOO: .. ; form? ! Remove the ; from the payload if present