-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Made improvements to pretty printing #116
Conversation
Just as a heads up, I think the patch contains many useful changes which should be included, but I currently don't have time to review it and modify it to be generic (e.g. currently it relies on things like IDs of reduction actions, which is something that changes every time the grammar is modified). |
OK, I reviewed this and the only feature that depended on the IDs of reduction actions was the preservation of heredoc strings. That feature is useful to me, so I kept it in my local copy, however I removed it from the version that I posted here in my latest commit. So this change should be ready to review and merge by you. Please let me know if you have any further trouble. Thanks! |
Look at Travis, you should fix the tests. |
It would probably be a good idea to rebase against the master too. |
Any news on this? |
@@ -11,7 +11,7 @@ namespace PhpParser; | |||
/* This is an automatically GENERATED file, which should not be manually edited. | |||
* Instead edit one of the following: | |||
* * the grammar file grammar/zend_language_parser.phpy |
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.
You could remove the y
from phpy
if you commit again
Any news on this? |
I thought they weren't interested in the updates and already deleted my On Thu, Sep 10, 2015 at 6:42 AM, Dmitry Patsura [email protected]
|
For me this should not be the role of this library to pretty print something as this will imply at lot of complexity here. I have resolved this by piping the generated code through https://github.com/FriendsOfPHP/PHP-CS-Fixer and it works well. |
@joelwurtz That's the same conclusion I came in. Do you still use it? Now you can use I use it and it works well apart few glitches: #400 |
@nikic I believe this can be closed now... |
Right, realistically this is not landing at this point. My current stance on the issue is that for non-trivial adjustment to the formatting an existing formatting library should be used, as mentioned in #116 (comment). |
Hi, I found this PHP-Parser project and it appears quite useful. I started using the PHP Pretty Printer, and wrote a number of changes to this feature that I think are improvements. They are in this changeset that I am making available to you in case you want to pull the changes (or any part of them that you find useful).
Summary of the changes:
I can give you some examples of before and after code and show you how much this is improved in terms of flexibility and appearance of output.
The rest of this message consists of a pretty printer script that I wrote which uses most of these new features.