escape-strings: Add a tag-payload word to make a string payload and tag.
parent
279acbc53e
commit
12918ae2a5
|
@ -28,6 +28,9 @@ IN: escape-strings
|
|||
: escape-strings ( strs -- str )
|
||||
[ escape-string ] map concat escape-string ;
|
||||
|
||||
: tag-payload ( str tag -- str' )
|
||||
[ escape-string ] dip prepend ;
|
||||
|
||||
: escape-simplest ( str -- str' )
|
||||
dup { CHAR: ' CHAR: " CHAR: \r CHAR: \n CHAR: \s } counts {
|
||||
{ [ dup { CHAR: ' CHAR: \r CHAR: \n CHAR: \s } values-of sum 0 = ] [ drop "'" prepend ] }
|
||||
|
|
Loading…
Reference in New Issue