interpolate: [I -> I[[
parent
55df44923f
commit
13d9a78ec6
|
@ -40,6 +40,6 @@ IN: interpolate.tests
|
||||||
{ "Oops, I accidentally the whole economy..." } [
|
{ "Oops, I accidentally the whole economy..." } [
|
||||||
let[
|
let[
|
||||||
"economy" :> noun
|
"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
|
] unit-test
|
||||||
|
|
|
@ -85,6 +85,10 @@ MACRO: interpolate-locals ( str -- quot )
|
||||||
: interpolate-locals>string ( str -- newstr )
|
: interpolate-locals>string ( str -- newstr )
|
||||||
[ interpolate-locals ] with-string-writer ; inline
|
[ interpolate-locals ] with-string-writer ; inline
|
||||||
|
|
||||||
SYNTAX: [I
|
: define-interpolate-syntax ( accum string -- accum )
|
||||||
"I]" parse-multiline-string
|
parse-multiline-string
|
||||||
interpolate-locals-quot append! ;
|
interpolate-locals-quot append! ;
|
||||||
|
|
||||||
|
SYNTAX: I[[ "]]" define-interpolate-syntax ;
|
||||||
|
SYNTAX: I[=[ "]=]" define-interpolate-syntax ;
|
||||||
|
SYNTAX: I[==[ "]==]" define-interpolate-syntax ;
|
||||||
|
|
Loading…
Reference in New Issue