hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.23k stars 224 forks source link

Allow const declarations without wildcard #1143

Closed sookach closed 1 week ago

sookach commented 1 week ago

Addresses #1138, case D.

d0836be2bff6a65d6ffb081a3d4cb14ccc49c25f suppresses the error, but returning a default object drops the pc_qualifiers.

sookach commented 1 week ago

Due to cppfront's being a backtracking parser, it does the hokey pokey, entering and exiting parse sections until it's successful, and with my adjustment of defaulting to return the built up type_id node all the time, the parser gets thrown off in the instances where it is just testing waters by trying to parse a type id. It would be nice to convert cppfront to a predictive parser (nothing in the grammar stands out as an obstacle), but at this stage, that would be quite the undertaking.