tree-sitter-cpp icon indicating copy to clipboard operation
tree-sitter-cpp copied to clipboard

Struct with __attribute__

Open EvgeniyPeshkov opened this issue 6 years ago • 3 comments

Structures with attributes are parsed incorrectly. For example:

struct __attribute__((packed)) struct1_t {
    static constexpr int A = 1;
    static constexpr int B = 2;
};

It seems to me, that they are taken for function_definition somehow. This will help to resolve this issue. Thank you very much.

EvgeniyPeshkov avatar Jun 17 '19 14:06 EvgeniyPeshkov

What version of tree-sitter-cpp are you using? This looks like it should have been fixed by https://github.com/tree-sitter/tree-sitter-c/pull/19, which would be included in [email protected].

Arcanemagus avatar Jun 17 '19 17:06 Arcanemagus

Nevermind, just checked your linked repository and it appears you are already on that version.

Arcanemagus avatar Jun 17 '19 17:06 Arcanemagus

I use the latest version 0.15.0. It seems that __attribute__ was fixed for function declarations, but not structs.

EvgeniyPeshkov avatar Jun 17 '19 17:06 EvgeniyPeshkov