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

Use a slice to accumulate errors #20

Merged
merged 1 commit into from
Aug 18, 2022
Merged

Use a slice to accumulate errors #20

merged 1 commit into from
Aug 18, 2022

Conversation

nickng
Copy link
Owner

@nickng nickng commented Aug 18, 2022

Instead of using a buffered channel to return errors, use two slices
to accumulate all errors, and return other errors before yacc-errors.

Thanks @its-luca for point this out: #19 (comment)

Instead of using a buffered channel to return errors, use two slices
to accumulate all errors, and return other errors before yacc-errors.
case err := <-l.ParseErrors:
return nil, err
switch {
case len(l.Errors) > 0: // Non-yacc errors
Copy link
Owner Author

Choose a reason for hiding this comment

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

This should now be more deterministic as this case is checked first (specs)

@nickng nickng merged commit 443fee2 into main Aug 18, 2022
@nickng nickng deleted the lexer-error-slice branch August 18, 2022 23:37
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.

1 participant