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

WIP: Introduce Fuzz(...) #205

Closed
wants to merge 1 commit into from

Conversation

pontaoski
Copy link

@pontaoski pontaoski commented Dec 15, 2021

Fuzz allows for easy grammar-driven fuzzing via Participle grammars.

WIP because I can't figure out why performance is dying in the TestFuzz_LookAhead test, and also the panic("todo")

Fixes #204.

Fuzz allows for easy grammar-driven fuzzing
via Participle grammars.
for i := 0; i < items; i++ {
s.WriteString(g.expr.Fuzz(l))
if i < items-1 {
s.WriteString(" ")
Copy link
Owner

Choose a reason for hiding this comment

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

This is a really interesting idea, but this implementation makes assumptions about whitespace that will not hold true for all lexers. For example, it is possible to have a lexer that relies on indentation, which this would break on.

I love the idea though, so perhaps there is a way to make it work in the general case.

Copy link
Author

Choose a reason for hiding this comment

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

This is a really interesting idea, but this implementation makes assumptions about whitespace that will not hold true for all lexers. For example, it is possible to have a lexer that relies on indentation, which this would break on.

Hm, how would you model this? I was trying to keep it stateless, but I'm not sure if I could avoid that and fix this problem.

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, that is definitely the question, and I'm not sure what the answer is :(

@alecthomas alecthomas closed this Jun 3, 2022
@alecthomas
Copy link
Owner

I'm going to close this, but feel free to send a new PR if you come up with a general purpose solution.

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.

Feature request: fuzzing support
2 participants