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

Expose errors (for bot). #35

Merged
merged 2 commits into from
Jul 15, 2024
Merged

Expose errors (for bot). #35

merged 2 commits into from
Jul 15, 2024

Conversation

ldemailly
Copy link
Member

@ldemailly ldemailly requested a review from ccoVeille July 15, 2024 23:50
@@ -84,7 +85,8 @@ func Interactive(in io.Reader, out io.Writer, options Options) {
}

// Returns true in line mode if more should be fed to the parser.
func EvalOne(s, macroState *eval.State, what string, out io.Writer, options Options) bool {
// TODO: this one size fits 3 different calls (file, interactive, bot) is getting spaghetti.
Copy link
Member Author

Choose a reason for hiding this comment

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

@ccoVeille I realize ^

@ldemailly ldemailly merged commit c4f454c into main Jul 15, 2024
1 check passed
@@ -72,7 +73,7 @@ func Interactive(in io.Reader, out io.Writer, options Options) {
return
}
l := prev + scanner.Text()
contNeeded := EvalOne(s, macroState, l, out, options)
contNeeded, _ := EvalOne(s, macroState, l, out, options)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why ignoring errors here?

Maybe it's OK, but a comment would help

Copy link
Member Author

Choose a reason for hiding this comment

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

it's because they've been printed interactively, which is kinda why the spagheti of ifs and modes in EvalOne isn't great, I probably should just copy paste exactly for 3 modes, or ... clean up somehow

agreed on comment, adding

Copy link
Member Author

Choose a reason for hiding this comment

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

@ldemailly ldemailly deleted the eval_err branch July 20, 2024 07:18
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.

2 participants