Open
Description
It looks like Prism::Format is currently set up to format Prism::ParseResults. Is there any scope to have it format Prism::Nodes?
It looks like you can create a new Prism::Format with an empty string and then get a Prism::Node to accept it, but then there are issues with an assumed stack. For example, when visiting a block node, it is assumed that @stack[-2]
exists and responds to type
.
I’m using Prism to find specific patterns and re-write them into better optimised code, so I’m looking to take a mutated Prism::Node and turn it into Ruby that can be eval’d. I don’t know if this kind of round-tripping is a goal for SyntaxTree, or if the focus is more on being a formatter for files.
Metadata
Metadata
Assignees
Labels
No labels