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

Query about -a flag #252

Open
dorchard opened this issue Dec 20, 2022 · 2 comments
Open

Query about -a flag #252

dorchard opened this issue Dec 20, 2022 · 2 comments

Comments

@dorchard
Copy link
Member

The -a flag let's us pass "lex" or "parse" to tell fortran-src what to do:

let options' = [ ("lex", Lex) , ("parse", Parse) ] in

But do we want this to be more general (to allow any action?).
I'm not 100% sure why we have this option anyway, but I wonder why its so specific.

@raehik
Copy link
Collaborator

raehik commented Dec 20, 2022

You're right -- it would seem sensible if the "lex or parse" choice were used further down the line for other commands, but it's not. It's useful to check the lexer output, so I'd want to keep it. It's exposed differently to the rest of the functionality (which is all option-based). I'm not sure what else we can do other than clarify the option as you did, without altering the interface a fair amount. (Mused on this in #177.)

Based on personal experience, I find programs that expose their functionality through commands and subcommands are more discoverable than fortran-src's option-based approach. What about an interface like

fortran-src typecheck mod1.f mod2.f

or closer to existing syntax

# --action now takes lex,parse,typecheck,rename,bblocks,...
fortran-src --action typecheck mod1.f mod2.f

@dorchard
Copy link
Member Author

dorchard commented Dec 20, 2022

The latter would be very easy to implement and backwards compatible so that might be the best choice.

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

No branches or pull requests

2 participants