[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: major change to argument processing.
From: |
Marius Vollmer |
Subject: |
Re: RFC: major change to argument processing. |
Date: |
02 Jun 2001 03:20:13 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102 |
Rob Browning <address@hidden> writes:
> Marius Vollmer <address@hidden> writes:
>
> > I think so, yes. The effort is not really that large (I think Rob has
> > already written it).
>
> Yes.
Here is some code for the parser I have in mind, to make things
clearer.
(define (read-quoted-argument)
;; gobble whittespace
(let loop ((ch (read-char)))
(cond ((eof-object? ch)
ch)
((char-whitespace? ch)
(loop (read-char)))
(else
;; gather argument chars
(let loop ((arg '())
(ch ch)
(state 'free))
(cond ((or (eof-object? ch)
(and (eq? state 'free) (char-whitespace? ch)))
(list->string (reverse! arg)))
((and (not (eq? state 'single)) (eq? ch #\\))
(let ((ch (read-char)))
(if (eof-object? ch)
(error "escape at end of file"))
(loop (cons ch arg) (read-char) state)))
((and (not (eq? state 'double)) (eq? ch #\'))
(loop arg (read-char)
(if (eq? state 'single) 'free 'single)))
((and (not (eq? state 'single)) (eq? ch #\"))
(loop arg (read-char)
(if (eq? state 'double) 'free 'double)))
(else
(loop (cons ch arg) (read-char) state))))))))
- Re: RFC: major change to argument processing., Dirk Herrmann, 2001/06/01
- Re: RFC: major change to argument processing., Lars J. Aas, 2001/06/01
- Re: RFC: major change to argument processing., Dirk Herrmann, 2001/06/01
- Re: RFC: major change to argument processing., Marius Vollmer, 2001/06/01
- Re: RFC: major change to argument processing., Rob Browning, 2001/06/01
- Re: RFC: major change to argument processing.,
Marius Vollmer <=
- Re: RFC: major change to argument processing., Rob Browning, 2001/06/02
- Re: RFC: major change to argument processing., Marius Vollmer, 2001/06/02
- Re: RFC: major change to argument processing., Rob Browning, 2001/06/02
- Re: RFC: major change to argument processing., Marius Vollmer, 2001/06/02
- Re: RFC: major change to argument processing., Rob Browning, 2001/06/02
- Re: RFC: major change to argument processing., Marius Vollmer, 2001/06/02
- Re: RFC: major change to argument processing., Rob Browning, 2001/06/02