Repository navigation
Replies: 1 comment 2 replies
|
Some bugs we fixed in prism that the parser gem gets wrong but it looks like this would be a rather easy fix in the parser gem instead, not related to actually parsing the code. I would just try and propose the fix to the parser gem. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have no idea if I'm putting this in the right spot! Happy to move this to an issue if that's preferred.
I'm seeing an issue with the tree Parser builds for procargs that are arrays of length 1:
Those are definitely not the same in Ruby:
It traces to
def procarg0:So Path A produces the tree path Path B already produced. The bug was found while working on a gem that builds ASTs, and Claude dug out the failure case above. This is the generated summary of the issue:
Claude's suggestion here was to override
procarg0inPrism::Translation::Parser::Builderusing an opt-in builder flag:This might address the bug, but isn't the right fix because the builder-flag pattern is from Parser, not Prism (Claude has been shamed accordingly). Also, setting a builder flag to make your parser work is deeply, deeply irritating. A full override of procarg0 is likely a better fix:
But this would change the contract with Parser, because Prism would handle the case correctly where Parser fails silently and produces incorrect output. I don't know whether this would be okay here.
This is the scope of the change:
So: is this worth pursuing? I know Prism 2 is coming out soon (no idea when), and I also know that Prism promises identical output to Parser.
All reactions