Merge git://factorcode.org/git/factor

db4
Doug Coleman 2008-02-01 23:56:09 -06:00
commit dcd2ce7b57
3 changed files with 16 additions and 16 deletions

View File

@ -58,17 +58,17 @@ M: f pprint* drop \ f pprint-word ;
! Strings ! Strings
: ch>ascii-escape ( ch -- str ) : ch>ascii-escape ( ch -- str )
H{ H{
{ CHAR: \e CHAR: \\e } { CHAR: \e CHAR: e }
{ CHAR: \n CHAR: \\n } { CHAR: \n CHAR: n }
{ CHAR: \r CHAR: \\r } { CHAR: \r CHAR: r }
{ CHAR: \t CHAR: \\t } { CHAR: \t CHAR: t }
{ CHAR: \0 CHAR: \\0 } { CHAR: \0 CHAR: 0 }
{ CHAR: \\ CHAR: \\\\ } { CHAR: \\ CHAR: \\ }
{ CHAR: \" CHAR: \\\" } { CHAR: \" CHAR: \" }
} at ; } at ;
: unparse-ch ( ch -- ) : unparse-ch ( ch -- )
dup ch>ascii-escape [ ] [ ] ?if , ; dup ch>ascii-escape [ "\\" % ] [ ] ?if , ;
: do-string-limit ( str -- trimmed ) : do-string-limit ( str -- trimmed )
string-limit get [ string-limit get [