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

Allow running passes multiple times. #67

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

aDotInTheVoid
Copy link
Contributor

Previously, limit was always nonzero, which meant that !limit-- was always false, so the inner loop would never iterate.

Closes #61
Closes #66

alona@Ashtabula:~/dev$ cat issue61.ebnf 
binding-names = {name, ","}, name, ",", name;
alona@Ashtabula:~/dev$ cat issue66.ebnf 
binding-names = {name, ","}, name, ",", name, [","];
alona@Ashtabula:~/dev$ ./kgt/build/bin/kgt -l iso-ebnf -e rrutf8 < ./issue61.ebnf 
Segmentation fault
alona@Ashtabula:~/dev$ ./kgt/build/bin/kgt -l iso-ebnf -e rrutf8 < ./issue66.ebnf 
binding-names:
                      ╭────>────╮
                      │         │
    │├──╭── name ──╮──╯── "," ──╰──┤│
        │          │
        ╰── "," ───╯

alona@Ashtabula:~/dev$ ./kgt-2/build/bin/kgt -l iso-ebnf -e rrutf8 < ./issue61.ebnf 
binding-names:
    │├──╭── name ── "," ──╮── name ──┤│
        │                 │
        ╰────────<────────╯

alona@Ashtabula:~/dev$ ./kgt-2/build/bin/kgt -l iso-ebnf -e rrutf8 < ./issue66.ebnf 
binding-names:
                                     ╭────>────╮
                                     │         │
    │├──╭── name ── "," ──╮── name ──╯── "," ──╰──┤│
        │                 │
        ╰────────<────────╯

I'm not sure how to test this.

@edk0
Copy link
Collaborator

edk0 commented Sep 25, 2023

Just on a moral level running the pretty steps to convergence shouldn't be necessary to get a correct tree. It's been too long since I worked on this code, but I really feel like that's something we should fix.

@edk0 edk0 mentioned this pull request Sep 25, 2023
@katef
Copy link
Owner

katef commented Apr 8, 2025

I agree with @edk0 here, the iteration shouldn't be neccessary. But the loop is there, so let's have it working until it gets removed.

@katef
Copy link
Owner

katef commented Apr 8, 2025

Thanks for the PR!

@katef katef merged commit 0411b63 into katef:main Apr 8, 2025
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.

Incorrect railroad diagram Segfault in collapse_suffix
3 participants