-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++20 modules support #266
base: master
Are you sure you want to change the base?
Conversation
@amaanq could you please take a look? |
'export', | ||
choice($._exportable_item, seq('{', repeat($._exportable_item), '}')) | ||
), | ||
import_declaration: $ => seq( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it reduce productions to remove the optional('export')
and instead add this to the list of exportable items? The standard enforces that a module import declaration shall not be contained in a declaration-seq of an export-declaration: https://eel.is/c%2B%2Bdraft/module#interface-1. This could simplify the productions here since it's more of a semantic error.
As discussed in #173, this PR implements the C++20 modules grammar after the last contributor time restraints. It Closes #174.
Parser states
before:
after:
Implementation
The most complex rules in the grammar are:
Declarations, in turn, can be any one of those discussed in https://en.cppreference.com/w/cpp/language/declarations. Said that, due to the inerent complexity of c++20 modules, I think that the state count can't go much lower than that. I'm open to suggestions tho.