csv: faster for files that do not have blanks around delimiter.

db4
John Benediktsson 2012-07-15 09:15:55 -07:00
parent 8d2a271aa2
commit d31ece5dd0
1 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,13 @@ MEMO: (quoted-field) ( delimiter -- delimiter' )
delimiter> (quoted-field) read-until
dup CHAR: " =
[ 2drop quoted-field ]
[ swap [ blank? ] trim % ]
[
swap dup {
[ ?first blank? ]
[ ?last blank? ]
} 1||
[ [ blank? ] trim ] when %
]
if ;
: maybe-escaped-quote ( -- endchar )