nyacc: fixed c99/CPP bug: need to skip space before lparen

This commit is contained in:
Matt Wette 2017-01-02 07:42:23 -08:00 committed by Jan Nieuwenhuizen
parent 7b665385c9
commit 2df0f57a30
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2017-01-02 Matt Wette <mwette@alumni.caltech.edu>
* lang/c99/cppbody.scm (expand-cpp-mref): skip ws between ident
and left paren
2017-01-01 Matt Wette <mwette@alumni.caltech.edu>
* lang/c99/body.scm (gen-c-lexer): in code mode now expands includes

View file

@ -163,9 +163,12 @@
(define (collect-args argd dict used)
;;(simple-format #t "collect-args\n")
(if (not (eqv? (read-char) #\()) (throw 'parse-error "collect-args"))
(if (not (eqv? (skip-ws (read-char)) #\())
(let ((fn (or (port-filename (current-input-port)) "(unknown)"))
(ln (1+ (port-line (current-input-port)))))
(throw 'parse-error "~A:~A: CPP expecting `('" fn ln)))
(let iter ((argl (list (scan-cpp-input argd dict used #t))))
(simple-format #t "args: ~S\n" argl)
;;(simple-format #t "args: ~S\n" argl)
(let ((ch (read-char)))
(if (eqv? ch #\)) (reverse argl)
(iter (cons (scan-cpp-input argd dict used #t) argl))))))