Improve indentation example to reject malformed indent#961
Open
JohnathanFL wants to merge 1 commit intozesterer:mainfrom
Open
Improve indentation example to reject malformed indent#961JohnathanFL wants to merge 1 commit intozesterer:mainfrom
JohnathanFL wants to merge 1 commit intozesterer:mainfrom
Conversation
Previously, it would accept same-dent/de-dent when a block was expected, which is particulary troublesome if you want to optionally parse a block (as in my language). Also adds an example of it failing to the example, as well as a bunch of comments explaining more of how it's working for others to replicate.
Author
|
Actually, hold up on this one; I think I found some issues with my logic here while working on my own language. I'll get my own language properly tested so I know for sure it handles the right edge cases, then update this PR again. I don't anticipate the example code getting very complex; just a matter of finding the right logic. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, it would accept same-dent/de-dent when a block was expected, which is particulary troublesome if you want to optionally parse a block (as in my language).
Also adds an example of it failing to the example, as well as a bunch of comments explaining more of how it's working for others to replicate.
As an aside, fantastic work with Chumsky! I've tried a bunch of parser libraries for my own language (which uses indentation extensively, including exotic things like strings that are determined by minimum indent while keeping lines' extra indent) and Chumsky has by far been the easiest to work with, though it makes the LSP scream in agony.