Skip to content
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

Fix dstr #366

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix dstr #366

wants to merge 2 commits into from

Conversation

mbj
Copy link
Owner

@mbj mbj commented May 28, 2024

No description provided.

@mbj mbj force-pushed the fix/dstr branch 2 times, most recently from d6931fd to 7ac3ca1 Compare September 16, 2024 03:17
bin/corpus Outdated
require 'unparser'

Thread.abort_on_exception = true
Thread.report_on_exception = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment: FYI Thread.report_on_exception has been true by default since Ruby 2.5.

Also, It probably doesn't matter in this case since this it the top-level script, but it is possible to set these attributes at the Thread object level so you don't have to worry about doing it globally.

@mbj mbj force-pushed the fix/dstr branch 4 times, most recently from bf874eb to 4e16935 Compare September 20, 2024 21:26
* This is an entirely new approach.
* Instead to find the "correct" dstr segments we simply try all and unparse the first one
  that round trips.
* This so far guarantees we always get good concrete syntax, but it can be time intensive as
  the combinatoric space of possible dynamic string sequence is quadratic with the dstr children size.
* For this reason we try above (currently) dstr children to unparse as heredoc first.
* Passes the entire corpus and fixes bugs.

[fix #249]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants