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

ERROR with multiple bitfields

Open genotrance opened this issue 4 years ago • 0 comments

struct status {
   unsigned int widthValidated : 1, heightValidated : 1;
};

Results in:

# (struct_specifier 1 1 74
#  (type_identifier 1 8 6 "status")
#  (field_declaration_list 1 15 60
#   (field_declaration 2 4 53
#    (sized_type_specifier 2 4 12
#     (primitive_type 2 13 3 "int")
#    )
#    (field_identifier 2 17 14 "widthValidated")
#    (ERROR 2 32 3
#     (bitfield_clause 2 32 3
#      (number_literal 2 34 1 "1")
#     )
#    )
#    (field_identifier 2 37 15 "heightValidated")
#    (bitfield_clause 2 53 3
#     (number_literal 2 55 1 "1")
#    )
#   )
#  )
# )

gcc doesn't seem to mind this syntax so I'm presuming it is valid.

The same issue occurs with tree-sitter-cpp as well.

genotrance avatar Apr 12 '20 17:04 genotrance