--- gforth/quotes.fs 2002/05/01 05:33:56 1.4 +++ gforth/quotes.fs 2002/12/04 10:42:59 1.6 @@ -68,7 +68,7 @@ char o c, char p c, char q c, 13 \G @code{\}[0-7]+ octal numerical character value, @code{\x}[0-9a-f]+ \G hex numerical character value; a @code{\} before any other \G character represents that character (only ', \, ? in C99). - here >r 0 c, + here >r >in @ chars source chars over + >r + begin ( parse-area R: here parse-end ) dup r@ < while dup c@ [char] " <> while @@ -82,16 +82,16 @@ char o c, char p c, char q c, 13 char+ source >r - r> min char/ >in ! r> drop here r> - dup negate allot - here swap char/ 1 /string ; + here swap char/ ; :noname \"-parse save-mem ; -:noname postpone (s") \"-parse dup c, 1+ chars allot drop ; +:noname \"-parse save-mem 2dup postpone sliteral drop free throw ; interpret/compile: s\" ( compilation 'ccc"' -- ; run-time -- c-addr u ) \ gforth s-backslash-quote \G Like @code{S"}, but translates C-like \-escape-sequences into \G single characters. See @code{\"-parse} for details. :noname \"-parse type ; -:noname postpone (.") \"-parse dup c, 1+ chars allot drop ; +:noname postpone s\" postpone type ; interpret/compile: .\" ( compilation 'ccc"' -- ; run-time -- ) \ gforth dot-backslash-quote 0 [if] \ test @@ -100,9 +100,9 @@ interpret/compile: .\" ( compilation 'cc s" x1fg" drop \-escape 31 <> throw drop .s s" 00129" drop \-escape 10 <> throw drop .s s" a" drop \-escape 7 <> throw drop .s - \"-parse " s" " compare 0<> throw .s + \"-parse " s" " str= 0= throw .s \"-parse \a\b\c\e\f\n\r\t\v\100\x40xabcde" dump - s\" \a\bcd\e\fghijklm\12opq\rs\tu\v" \-escape-table over compare 0<> throw - s\" \w\0101\x041\"\\" name wAA"\ compare 0<> throw + s\" \a\bcd\e\fghijklm\12opq\rs\tu\v" \-escape-table over str= 0= throw + s\" \w\0101\x041\"\\" name wAA"\ str= 0= throw s\" s\\\" \\" ' evaluate catch 0= throw [endif]