Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Detect left recursive parsers making no progress#369

Closed
nikabyn wants to merge 2 commits into
zesterer:mainfrom
nikabyn:endless_debug_asserts
Closed

Detect left recursive parsers making no progress#369
nikabyn wants to merge 2 commits into
zesterer:mainfrom
nikabyn:endless_debug_asserts

Conversation

@nikabyn
Copy link
Copy Markdown
Contributor

@nikabyn nikabyn commented Mar 11, 2023

Implementation of #303
Adds a debug panic for left recursive parsers without memoization.

@zesterer
Copy link
Copy Markdown
Owner

Unfortunately, I don't think the changes in this PR are sufficient by themselves. For example, I'm pretty sure any mutually recursive pattern will not be caught, such as this:

recursive(|a| {
    recursive(move |_| {
        a
    })
})

I think unfortunately something more substantial is required, like piggy-backing on top of the memoisation hashmap.

@zesterer
Copy link
Copy Markdown
Owner

Now being worked on in #371

@zesterer zesterer closed this Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants