-
Notifications
You must be signed in to change notification settings - Fork 15
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
First proposal of improvements on C++ generator #1065
Conversation
Initial discussion : @pramodk @ohm314 Stack approach to manipulate code blocks
Rework CodePrinter::add_lineThe change allows the method to essentially work like the Python standard library function textwrap.dedent Remove trivial
|
@tristan0x: suggestions look fine to me! (as mentioned elsewhere, we would like to make it easy to understand/develop/contribute by external users/devs) |
(Bear with me until I look in detail at the changes but) overall I agree with the suggestions. |
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.
Alright, I did a pass. I really like the changes. Had just some minor comments.
87e724f
to
453cc1a
Compare
This comment has been minimized.
This comment has been minimized.
c4e7fce
to
97dab1e
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1065 +/- ##
==========================================
+ Coverage 69.94% 70.19% +0.24%
==========================================
Files 188 188
Lines 25647 25632 -15
==========================================
+ Hits 17939 17992 +53
+ Misses 7708 7640 -68
☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6adfd7b
to
5eb5a81
Compare
This comment has been minimized.
This comment has been minimized.
* reduce number of copies * `CodePrinter::add_text`: * now supports multiple arguments * use it instead of trivial but expensive call to `fmt::format`. * `CodePrinter::add_multi_line`: * rework to work with C++ raw string literals * used it instead of 3 or more consecutive `add_line` * `CodePrinter::start_block`: rename to `push_block` * `CodePrinter::end_block`: rename to pop_block
5eb5a81
to
0e59bd4
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
LGTM overall. Some small suggestions
Co-authored-by: Ioannis Magkanaris <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Logfiles from GitLab pipeline #154642 (:white_check_mark:) have been uploaded here! Status and direct links: |
Sorry, I was too late to notice comment. But I guess this has resolved somehow 👍 |
* First proposal of improvements on C++ generator * reduce number of copies * `CodePrinter::add_text`: * now supports multiple arguments * use it instead of trivial but expensive call to `fmt::format`. * `CodePrinter::add_multi_line`: * rework to work with C++ raw string literals * used it instead of 3 or more consecutive `add_line` * `CodePrinter::start_block`: rename to `push_block` * `CodePrinter::end_block`: rename to pop_block * CodegenCppVisitor::visit_program more visible * Try removing python3-importlib-metadata Co-authored-by: Nicolas Cornu <[email protected]> Co-authored-by: Ioannis Magkanaris <[email protected]> Co-authored-by: Erik Heeren <[email protected]>
CodePrinter::add_text
:fmt::format
.CodePrinter::add_multi_line
:add_line
CodePrinter::start_block
: rename topush_block
CodePrinter::end_block
: rename to pop_blockCodePrinter::chain_block
: rename to chain_block