-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ccoVeille I realize ^
@@ -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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for grol-io/grol-discord-bot#7