From: Dirk B. <db...@us...> - 2008-12-21 08:56:24
|
Update of /cvsroot/win32forth/win32forth/src/lib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10235 Modified Files: EscapedStrings.f Log Message: C\" \ "string" -- caddr \ W32F .\" \ "string" -- \ W32F Z\" \ "string" -- addr \ W32F Z,\" \ comp: ( -<string">- ) \ W32F +Z,\" \ comp: ( -<string">- ) \ W32F added for symetry with the other string literlas in w32f Index: EscapedStrings.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/lib/EscapedStrings.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EscapedStrings.f 20 Dec 2008 12:17:03 -0000 1.1 --- EscapedStrings.f 21 Dec 2008 08:56:16 -0000 1.2 *************** *** 264,267 **** --- 264,269 ---- INTERNAL + IN-SYSTEM + : $, \ caddr len -- \ *G Lay the string into the dictionary at *\fo{HERE}, reserve *************** *** 270,273 **** --- 272,280 ---- here place r> 1 chars + allot + + \ All string literals are stored as null terminated, counted strings. + \ The count doesn't include the null byte. + 0 c, + align ; *************** *** 399,403 **** EXTERNAL ! : S\" \ "string" -- caddr u \ *G As *\fo{S"}, but translates escaped characters using \ ** *\fo{parse\"} above. --- 406,410 ---- EXTERNAL ! : S\" \ "string" -- caddr u \ 200X \ *G As *\fo{S"}, but translates escaped characters using \ ** *\fo{parse\"} above. *************** *** 407,410 **** --- 414,469 ---- ; IMMEDIATE + \ For symetry with the other string literals in Win32Forth + \ by Dirk Busch + + : C\" \ "string" -- caddr \ W32F + \ *G As *\fo{C"}, but translates escaped characters using + \ ** *\fo{parse\"} above. + readEscaped state @ if + compile (c") count $, + then + ; IMMEDIATE + + : .\" \ "string" -- \ W32F + \ *G As *\fo{."}, but translates escaped characters using + \ ** *\fo{parse\"} above. + readEscaped count state @ if + compile (.") $, + else type + then + ; IMMEDIATE + + : Z\" \ "string" -- addr \ W32F + \ *G As *\fo{Z"}, but translates escaped characters using + \ ** *\fo{parse\"} above. + readEscaped state @ if + compile (z") count $, + else + dup +null 1 chars + + then + ; IMMEDIATE + + INTERNAL + + : Z$, \ comp: ( addr len -- ) \ W32F + \ *G Lay the null terminated string into the dictionary + \ ** at *\fo{HERE}, reserve space for it and *\fo{ALIGN} + \ ** the dictionary. + here over allot swap cmove 0 c, align + ; + + EXTERNAL + + : Z,\" \ comp: ( -<string">- ) \ W32F + \ *G compile string delimited by " as uncounted + \ ** chars null-terminated chars at here + readEscaped count Z$, ; + + : +Z,\" \ comp: ( -<string">- ) \ W32F + \ *G Adds the string delimited by " to the currently compiled string. + -NULL, Z,\" ; + + IN-PREVIOUS + MODULE |