-
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
debug inspect #6
Comments
Ideally, to_s would return the current representation and inspect would return yours; however, I don't know how many people rely on the return values being what they are, and it's probably not worth a major version bump. |
Data point: I do not rely on |
What about @bbatsov? |
my idea was that you only get it when you want it. |
It is definitely a past design failure in ast. |
I'm on the road right now. Will be back home tomorrow and I'll take a look On Tuesday, September 15, 2015, whitequark notifications@github.com wrote:
Best Regards, |
After having used this a bit more, i actually reverted to the multiline version. (wasn't before) |
I'm not using this is as well, so I think making this change is unlikely to affect many (any) users. |
OK. I will accept a PR implementing this as per #6 (comment). |
ok, do you want it in the sexp module (as my code is now), or should i change the node.to_sexp to output ruby code ? |
No, no modules. Just |
i guess this is clear |
great stuff , thanks.
This just reduced my 10 (hand coded ast-) classes to nothing. Great :-)
In doing that i was obviously using the handy s() function. But also i wrote a modified Node.inspect
that gets included with the s() and prints out the node in the exact same way as the code needs it.
The effect being that one can copy paste the failed test output as an expected result (it's ruby code, yeah)
I found that very handy and could make a pull request. Code is here https://github.com/dancinglightning/ast/commit/fdb4d8cb7a36601d76750dab658893e30e85c8c9
The text was updated successfully, but these errors were encountered: