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

Added --quiet option to FsLex and FsYacc. #199

Closed
wants to merge 1 commit into from

Conversation

vzarytovskii
Copy link
Collaborator

@vzarytovskii vzarytovskii commented Apr 5, 2024

This option suppresses the output of the generated code to the console. The generated code is still written to the output file.

If anyone has better approach to the issue, please advise. Also, not sure where/how to test it.

I will pick this later to dotnet/fsharp's local copies.

Update: reasoning is to suppress output when working with compiler, output is useless for 99% of contributors in 99% of cases.

…e output of the generated code to the console. The generated code is still written to the output file.
Comment on lines +1224 to +1238
let example1 =
let e = "E"
let t = "Terminal"
let plus = "+"
let mul = "*"
let f = "F"
let lparen = "("
let rparen = ")"
let id = "id"

let terminals = [plus; mul; lparen; rparen; id]
let nonTerminals = [e; t; f]

let p2 = e, (NonAssoc, ExplicitPrec 1), [NonTerminal e; Terminal plus; NonTerminal t], None
let p3 = e, (NonAssoc, ExplicitPrec 2), [NonTerminal t], None in
let p3 = e, (NonAssoc, ExplicitPrec 2), [NonTerminal t], None in
Copy link
Collaborator Author

@vzarytovskii vzarytovskii Apr 5, 2024

Choose a reason for hiding this comment

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

Those are either by fantomas or my editor, I can revert if needed.

Same applies for all whitespace changes in files.

Copy link
Collaborator

Choose a reason for hiding this comment

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

As this is in a code comment, this is your editor's doing.

Copy link
Collaborator

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

Hmm, I'm on the fence here.
While I have some permissions on this repository, I will let the maintainers decide here.

Comment on lines +1224 to +1238
let example1 =
let e = "E"
let t = "Terminal"
let plus = "+"
let mul = "*"
let f = "F"
let lparen = "("
let rparen = ")"
let id = "id"

let terminals = [plus; mul; lparen; rparen; id]
let nonTerminals = [e; t; f]

let p2 = e, (NonAssoc, ExplicitPrec 1), [NonTerminal e; Terminal plus; NonTerminal t], None
let p3 = e, (NonAssoc, ExplicitPrec 2), [NonTerminal t], None in
let p3 = e, (NonAssoc, ExplicitPrec 2), [NonTerminal t], None in
Copy link
Collaborator

Choose a reason for hiding this comment

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

As this is in a code comment, this is your editor's doing.

@@ -668,6 +678,6 @@ let writeSpecToFile (generatorState: GeneratorState) (spec: ParserSpec) (compile
generatorState.bufferTypeArgument
ty

let compileSpec (spec: ParserSpec) (logger: Logger) =
let compileSpec (spec: ParserSpec) (logger: Logger) quiet =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, I would prefer to see logger changed to Microsoft.Extensions.Logging.Logger.
The quiet flag very much feels like a quick win that someone else will need to clean up in the future.

@T-Gro
Copy link

T-Gro commented Sep 24, 2024

Hello @nojaf , I would like to reopen this and resolve whatever feedback is provided by the maintainers.

Before I do it, do you think this has a chance to be expected?
If you aren't sure, who should we loop in please?

@nojaf
Copy link
Collaborator

nojaf commented Sep 24, 2024

Hi there, @T-Gro! My initial concern with this proposal is that it feels like a quick-fix solution that would need to be revisited the next time someone wants to fine-tune it. Using something like Microsoft.Extensions.Logging.Logger could provide a more streamlined solution.

As I mentioned, I'm not a maintainer; I have some permissions granted by Don to merge items here. For small tweaks and fixes, I use this privilege. In this case, I'm uncertain and would appreciate the maintainers sharing their thoughts.

Could you please reach out to @dsyme about this? If he thinks it's harmless, I won't oppose it.

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.

3 participants