-
Notifications
You must be signed in to change notification settings - Fork 92
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
feat: exit
as builtin function
#402
Conversation
is it really necessary to remove it from std/env tho? |
It's not necessary if we don't want to add it in the |
Well at that point it will be a conflict? We should keep a duplicate? |
src/modules/builtin/exit.rs
Outdated
|
||
fn parse(&mut self, meta: &mut ParserMetadata) -> SyntaxResult { | ||
token(meta, "exit")?; | ||
syntax(meta, &mut self.code)?; |
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.
Just thinking if we should allow omitting this parameter - this way we could just exit with zero exit code.
exit
// Same as `exit 0`
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 kinda too late tbh but updated the PR to handle parsing of the code argument for the Exit statement as optional. If the code is omitted during parsing, it will now default to 0.
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.
LGTM
This pr +
#401should close #215