diff --git a/basis/interpolate/interpolate-tests.factor b/basis/interpolate/interpolate-tests.factor index a69c4e44a0..a9899b8714 100644 --- a/basis/interpolate/interpolate-tests.factor +++ b/basis/interpolate/interpolate-tests.factor @@ -40,6 +40,6 @@ IN: interpolate.tests { "Oops, I accidentally the whole economy..." } [ let[ "economy" :> noun - "accidentally" [ [I Oops, I ${0} the whole ${noun}...I] ] with-string-writer + "accidentally" [ I[[ Oops, I ${0} the whole ${noun}...]] ] with-string-writer ] ] unit-test diff --git a/basis/interpolate/interpolate.factor b/basis/interpolate/interpolate.factor index fd00b1fdd1..24d216fbbc 100644 --- a/basis/interpolate/interpolate.factor +++ b/basis/interpolate/interpolate.factor @@ -85,6 +85,10 @@ MACRO: interpolate-locals ( str -- quot ) : interpolate-locals>string ( str -- newstr ) [ interpolate-locals ] with-string-writer ; inline -SYNTAX: [I - "I]" parse-multiline-string +: define-interpolate-syntax ( accum string -- accum ) + parse-multiline-string interpolate-locals-quot append! ; + +SYNTAX: I[[ "]]" define-interpolate-syntax ; +SYNTAX: I[=[ "]=]" define-interpolate-syntax ; +SYNTAX: I[==[ "]==]" define-interpolate-syntax ;