This PR is a work-in-progress. This PR significantly reworks the way declarators and function declarations/definitions work, in particular to improve support for qualified names, inline vs. out-of-line definitions, and linking.
It fixes some long-standing bugs in Lobster, including:
Fixes #332
Fixes #329
Fixes #238
Fixes #327
Fixes #326
Fixes #234
TODO add more
All regression tests are currently passing, but more need to be added to thoroughly test the affected parts of compilation as well as new features.
It adds a new construct, DeclaratorName, that serves as an abstraction over parsing an unqualified or qualified name in a declarator. It contains a cleaned up mechanism for assessing whether a declarator names a constructor or destructor, based on the context in which the name occurs.
The Declarator construct is also updated to use DeclaratorName internally and to create a "qualified context" based on both its "occurring context" (i.e. where it lexically occurs in the code) and its "qualified prefix context". This preps for future work in #301.
TODO: recursive functions are broken on this branch
This PR is a work-in-progress. This PR significantly reworks the way declarators and function declarations/definitions work, in particular to improve support for qualified names, inline vs. out-of-line definitions, and linking.
It fixes some long-standing bugs in Lobster, including:
All regression tests are currently passing, but more need to be added to thoroughly test the affected parts of compilation as well as new features.
It adds a new construct,
DeclaratorName
, that serves as an abstraction over parsing an unqualified or qualified name in a declarator. It contains a cleaned up mechanism for assessing whether a declarator names a constructor or destructor, based on the context in which the name occurs.The
Declarator
construct is also updated to useDeclaratorName
internally and to create a "qualified context" based on both its "occurring context" (i.e. where it lexically occurs in the code) and its "qualified prefix context". This preps for future work in #301.TODO: recursive functions are broken on this branch