Protobuf printer refactor#114
Open
eric-therond wants to merge 7 commits intoircmaxell:printer_refactorfrom
Open
Protobuf printer refactor#114eric-therond wants to merge 7 commits intoircmaxell:printer_refactorfrom
eric-therond wants to merge 7 commits intoircmaxell:printer_refactorfrom
Conversation
Contributor
Author
|
I will check later why CI is failing, I suspect something not working with |
Contributor
Author
|
@ircmaxell perhaps this protobuf printer shouldn't be part of the ircmaxell/php-cfg repository (I can create a new one on my side to host it (eric-therond/php-cfg-protobuf-printer for instance)), as it can be difficult to manage different types of printers in the same place. However, I think the other changes I've made are necessary to facilitate support for a wider variety of printers. What do you think? |
Contributor
Author
|
I updated the protobuf schema, nothing important, I try to find the more efficient one. Something more important, boolean and null literals were not generated correctly due to a bug in constfetch parsing, I think I have fixed that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a protobuf printer. To do this, I had to slightly modify the base printer class and renderers:
renderer/Operand/Temporary.php, we previously returned anidprefixed with#, this kind of transformation in now performed inPrinter/Text.php.opare rendered in a similar way. In the past, we had specific style forPhi,AssertionorAttributesGroup, with this PR, we have the same style of rendering. That's why you'll see diff in code tests related to theseops. We lose a bit of readability for Text printer but I think we have a more generic rendering, and it could be ok?