-
Notifications
You must be signed in to change notification settings - Fork 25
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
refactor: Refactor of attribute lookahead processing #84
Conversation
add method that prepares for building expr tree
parser_library/src/context/ordinary_assembly/ordinary_assembly_context.cpp
Show resolved
Hide resolved
void ordinary_assembly_context::add_symbol_reference(symbol sym) | ||
{ | ||
auto name = sym.name; | ||
symbol_refs_.try_emplace(name, std::move(sym)); |
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.
I still think that the copy is not needed. But this code will make two copies...
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
🎉 This PR is included in version 0.12.0-beta.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 0.12.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Until the PR, attribute lookahead was triggered during evaluation of CA expressions. That caused a complexity on the parser as it needed to be prepared to start parsing (performing lookup) in the middle of any statement processing.
The PR introduces new method of performing attribute lookup. It separates lookup from statement processing by initiating the lookup before a statement is passed to a processor.
The refactor caused the simplification of
parser_impl
andcollector
classes. Also it moved the functionality of lookup fromprocessing_manager
tostatement_provider
while utilizing theprocessing_manager
's loop.The refactor may simplify the future work in parsing optimizations.