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

Print hints in dbg method #530

Merged
merged 1 commit into from Jun 5, 2023
Merged

Print hints in dbg method #530

merged 1 commit into from Jun 5, 2023

Conversation

Lev135
Copy link
Contributor

@Lev135 Lev135 commented Jun 5, 2023

This is convinient for figuring out where your labels are lost during parsing process.
I had to add showErrorItem to Text.Megaparsec.Error exports to use it for printing hints in Text.Megaparsec.Debug. Maybe there's any better solution. Moreover, there can be many styles of printing hints. I've chosen list-like:

HINTS: ['a', 'b', end of file]

Copy link
Owner

@mrkkrp mrkkrp left a comment

Choose a reason for hiding this comment

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

Could you please also update the changelog accordingly?

Text/Megaparsec/Error.hs Show resolved Hide resolved
@Lev135
Copy link
Contributor Author

Lev135 commented Jun 5, 2023

I've added the following message into changelog:

## Megaparsec 9.4.0

* `dbg` now prints hints among other debug information.

@mrkkrp mrkkrp merged commit 36f02e8 into mrkkrp:master Jun 5, 2023
4 checks passed
@mrkkrp
Copy link
Owner

mrkkrp commented Jun 5, 2023

Thanks!

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.

None yet

2 participants