interpolate: [I -> I[[
parent
55df44923f
commit
13d9a78ec6
|
@ -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
|
||||
|
|
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue