Changeset 19 for trunk/example.lisp
- Timestamp:
- 02/27/2008 05:56:24 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/example.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/example.lisp
r18 r19 29 29 (defun un-dquote (s) (regex-replace-all "\"\"" (snip s) "\"")) 30 30 31 (deflexer scan-csv 31 (deflexer scan-csv (:priority-only t) 32 32 ("," comma) 33 33 ("[^\"',]+" value) … … 35 35 ("\"(?:[^\"]|\"\")*\"" value un-dquote)) 36 36 37 (defun scan-all (input)38 (labels ((scan (start tokens)39 (if (> (length input) start)40 (multiple-value-bind (class image remainder)41 (scan-csv input start)42 (when class43 (scan remainder (cons (cons class image) tokens))))44 (nreverse tokens))))45 (scan 0 '())))46 37 47 (scan-all "no quotes,'a ''quote''',\"another \"\"quote\"\"\"") 38 39 (lex-all 'scan-csv "no quotes,'a ''quote''',\"another \"\"quote\"\"\"")
Note: See TracChangeset
for help on using the changeset viewer.
