diff --git a/module/nyacc/ChangeLog b/module/nyacc/ChangeLog index ce9cb65e..e09aaefe 100644 --- a/module/nyacc/ChangeLog +++ b/module/nyacc/ChangeLog @@ -1,3 +1,7 @@ +2017-02-28 Matt Wette + + * lang/c99/pprint.scm: (binary 'd-del .. => (binary 'd-sel + 2017-02-22 Matt Wette * lang/c99/cpp.scm (rtokl->string): added handler for 'string diff --git a/module/nyacc/lang/c99/pprint.scm b/module/nyacc/lang/c99/pprint.scm index 0afd9f9a..e0bab69c 100644 --- a/module/nyacc/lang/c99/pprint.scm +++ b/module/nyacc/lang/c99/pprint.scm @@ -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)) diff --git a/module/nyacc/lang/c99/util2.scm b/module/nyacc/lang/c99/util2.scm index 94911efd..434f4b0a 100644 --- a/module/nyacc/lang/c99/util2.scm +++ b/module/nyacc/lang/c99/util2.scm @@ -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: diff --git a/module/nyacc/lang/util.scm b/module/nyacc/lang/util.scm index 7134e557..db0dff18 100644 --- a/module/nyacc/lang/util.scm +++ b/module/nyacc/lang/util.scm @@ -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)