| Paste number 80997: | field-body parsing attempt |
| Pasted by: | arcfide |
| When: | 8 months, 1 week ago |
| Share: | Tweet this! | http://paste.lisp.org/+1QHX |
| Channel: | #scheme |
| Paste contents: |
(define-parser rfc822-parser:field-body
(*parser (first rfc822-parser:text)
(parser:optional first
(parser:backtrackable
(parser:sequence rfc822-parser:crlf rfc822-parser:lwsp-char
(*parser (rest rfc822-parser:field-body)
(parser:return (string-append first " " rest))))))))
(define-parser rfc822-parser:text
(parser:string:repeated-until
(parser:backtrackable (parser:choice rfc822-parser:crlf (parser:end)))
(parser:char-in-set rfc822-char-set)))
Annotations for this paste:
| Annotation number 1: | Failure... |
| Pasted by: | arcfide |
| When: | 8 months, 1 week ago |
| Share: | Tweet this! | http://paste.lisp.org/+1QHX/1 |
| Paste contents: |
> (parse-string rfc822-parser:field-body "Test: this\r\n test\r\n" #f (lambda (a
b c) a) (lambda (a b c) (error #f "Parse Error at ~a: ~s" (parse-error/position
a) (parse-error/messages a))))
"Test: this"
>