nyacc: fixed bug in pretty-print-c99 wrt i-sel
This commit is contained in:
parent
f7ab751dcd
commit
953a57b663
|
@ -1,3 +1,7 @@
|
|||
2017-02-28 Matt Wette <mwette@alumni.caltech.edu>
|
||||
|
||||
* lang/c99/pprint.scm: (binary 'd-del .. => (binary 'd-sel
|
||||
|
||||
2017-02-22 Matt Wette <mwette@alumni.caltech.edu>
|
||||
|
||||
* lang/c99/cpp.scm (rtokl->string): added handler for 'string
|
||||
|
|
|
@ -168,8 +168,8 @@
|
|||
((array-ref ,dim ,expr)
|
||||
(ppx expr) (sf "[") (ppx dim) (sf "]"))
|
||||
|
||||
((d-sel ,id ,ex) (binary 'd-del "." ex id))
|
||||
((i-sel ,id ,ex) (binary 'i-del "->" ex id))
|
||||
((d-sel ,id ,ex) (binary 'd-sel "." ex id))
|
||||
((i-sel ,id ,ex) (binary 'i-sel "->" ex id))
|
||||
|
||||
((pre-inc ,expr) (unary/l 'pre-inc "++" expr))
|
||||
((pre-dec ,expr) (unary/l 'pre-dec "--" expr))
|
||||
|
|
|
@ -390,7 +390,8 @@
|
|||
((member (cadr tspec) keep) udecl)
|
||||
(else ;; splice in the typedef
|
||||
(let* ((name (sx-ref tspec 1))
|
||||
(decl (assoc-ref udecl-dict name)) ; decl for typename
|
||||
(decl (or (assoc-ref udecl-dict name) ; decl for typename
|
||||
(throw 'c99-error "util2 decl error")))
|
||||
(tdef-specl (sx-ref decl 1)) ; decl-spec-list for typename
|
||||
(tdef-declr (sx-ref decl 2)) ; init-declr for typename
|
||||
;; splice the typedef specifiers into target:
|
||||
|
|
|
@ -185,7 +185,7 @@ the file COPYING included with the this distribution.")
|
|||
(define (sx-tail sx ix)
|
||||
(cond
|
||||
((zero? ix) (error "sx-tail: expecting index greater than 0"))
|
||||
((and (pair? (cdr sx)) (eqv? '@ (cadr sx))) (list-tail sx (1+ ix)))
|
||||
((and (pair? (cadr sx)) (eqv? '@ (caadr sx))) (list-tail sx (1+ ix)))
|
||||
(else (list-tail sx ix))))
|
||||
|
||||
;; @deffn sx-has-attr? sx
|
||||
|
@ -253,7 +253,7 @@ the file COPYING included with the this distribution.")
|
|||
;; a-list of precedence with keys @code{'left}, @code{'right} and
|
||||
;; @code{nonassoc}.
|
||||
;; @example
|
||||
;; (protect-expr? 'lval '+ '(mul ...)) => TBD
|
||||
;; (protect-expr? 'left '+ '(mul ...)) => TBD
|
||||
;; @end example
|
||||
(define (make-protect-expr op-prec op-assc)
|
||||
|
||||
|
@ -283,8 +283,8 @@ the file COPYING included with the this distribution.")
|
|||
|
||||
(lambda (side op expr)
|
||||
(let ((assc? (case side
|
||||
((lt left) assc-rt?)
|
||||
((rt right) assc-lt?)))
|
||||
((lt lval left) assc-rt?)
|
||||
((rt rval right) assc-lt?)))
|
||||
(vtag (car expr)))
|
||||
(case (prec op vtag)
|
||||
((>) #t)
|
||||
|
|
Loading…
Reference in a new issue