-
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
Add a parse command #198
base: master
Are you sure you want to change the base?
Add a parse command #198
Conversation
Parse { | ||
/// What to parse the input as | ||
#[arg(long, value_enum)] | ||
parse_as: ParseAs, |
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.
I'd suggest renaming this into as
because
anthem parse --as program file.lp
feels much more natural than
anthem parse --parse-as program file.lp
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.
@ZachJHansen Btw, is the word as
proper English grammar here or is anthem parse --into ...
better?
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.
Either is fine - I prefer "as"
@@ -22,6 +22,20 @@ pub enum Command { | |||
input: Option<PathBuf>, | |||
}, | |||
|
|||
/// Parse and output an input |
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.
Really?
pub enum Output { | ||
#[default] | ||
Debug, | ||
Default, |
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.
I find it rather weird to have a Debug
that is the default and a Default
that is not. Given the fact that these names originate form the names of our formatters, I suggest not to rename things here. I'd also suggest not to change the default as the Debug
output is much more helpful than the Default
output.
That said, I my improvement ideas are limited -- and I would give this a pass if we are unable to find something better.
This PR fixes #176
The parse command has two arguments:
parse-as
to choose what the input is parse as (i.e. program, theory, specification or user guide)output
either debug output or the default output