guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unexpected extra parens on struct-ref [WAS: [ANN] nyacc 0.80.3 released]


From: Jan Nieuwenhuizen
Subject: Unexpected extra parens on struct-ref [WAS: [ANN] nyacc 0.80.3 released]
Date: Mon, 24 Jul 2017 14:49:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Matt Wette writes:

> NYACC V0.80.3 is released.

This works as expected:

    typedef struct foo {
      int bar;
    } baz;

    int
    main ()
    {
      struct foo f;

      return 0;
    }

=>

    (trans-unit
      (decl (decl-spec-list
              (stor-spec (typedef))
              (type-spec
                (struct-def
                  (ident "foo")
                  (field-list
                    (comp-decl
                      (decl-spec-list (type-spec (fixed-type "int")))
                      (comp-declr-list (comp-declr (ident "bar"))))))))
            (init-declr-list (init-declr (ident "baz"))))
      (fctn-defn
        (decl-spec-list (type-spec (fixed-type "int")))
        (ftn-declr (ident "main") (param-list))
        (compd-stmt
          (block-item-list
            (decl (decl-spec-list
                    (type-spec (struct-ref (ident "foo"))))
                  (init-declr-list (init-declr (ident "f"))))
            (return (p-expr (fixed "0")))))))


but typedef'ing struct foo to foo like so:

    typedef struct foo {
      int bar;
    } foo;

    int
    main ()
    {
      struct foo f;

      return 0;
    }

gives unexpected parens when using it in main:

    (trans-unit
      (decl (decl-spec-list
              (stor-spec (typedef))
              (type-spec
                (struct-def
                  (ident "foo")
                  (field-list
                    (comp-decl
                      (decl-spec-list (type-spec (fixed-type "int")))
                      (comp-declr-list (comp-declr (ident "bar"))))))))
            (init-declr-list (init-declr (ident "foo"))))
      (fctn-defn
        (decl-spec-list (type-spec (fixed-type "int")))
        (ftn-declr (ident "main") (param-list))
        (compd-stmt
          (block-item-list
            (decl (decl-spec-list
                    (type-spec (struct-ref (ident ("foo")))))
                  (init-declr-list (init-declr (ident "f"))))
            (return (p-expr (fixed "0")))))))


This bit: (struct-ref (ident ("foo")))

There seem to be more places where the extra parens occur.

Greetings,
janneke

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]