fsyacc prints every shift/reduce and reduce/reduce conflict to stdout unconditionally, and there is no way to turn it off.
The reports come from reportConflict in src/FsYacc.Core/fsyaccast.fs:
printfn
" %s/%s error at state %d on terminal %s between %s and %s - assuming the former because %s"
Nothing guards that call, and none of the options in src/FsYacc/fsyacc.fs reduce output. The closest is -v, which adds a listing file rather than removing anything.
Why it matters
For the F# compiler grammar (pars.fsy) this is 1457 lines on every regeneration: 617 shift/reduce and 840 reduce/reduce. Because CallFsYacc in FsLexYacc.targets runs a plain <Exec> with no importance set, all of it lands in the MSBuild log at normal verbosity and buries everything else the build has to say.
These conflicts are a property of the grammar. For someone authoring a grammar they are worth seeing. For someone vendoring a grammar they do not control, which is Fantomas' case with dotnet/fsharp's pars.fsy, they are noise on every build and carry no action.
Possible resolutions
Any of these would solve it:
- a
--quiet or --no-conflict-report flag on fsyacc
- routing the conflict reports into the listing file that
-v already produces, instead of stdout
- printing a summary by default, for example
617 shift/reduce, 840 reduce/reduce conflicts, pass -v for detail, with the per state detail behind -v
The third seems the most useful of the three, since what a grammar author actually wants to notice is the count changing, not 1457 individual lines scrolling past.
Workaround
Setting StandardOutputImportance="low" on the <Exec> in CallFsYacc hides the reports at normal verbosity while keeping them available at -v:detailed. That is what Fantomas does through a Directory.Build.targets override. It could reasonably be the package default: the reports are not actionable for the great majority of consumers, and the escape hatch costs nothing.
fsyaccprints every shift/reduce and reduce/reduce conflict to stdout unconditionally, and there is no way to turn it off.The reports come from
reportConflictinsrc/FsYacc.Core/fsyaccast.fs:printfn " %s/%s error at state %d on terminal %s between %s and %s - assuming the former because %s"Nothing guards that call, and none of the options in
src/FsYacc/fsyacc.fsreduce output. The closest is-v, which adds a listing file rather than removing anything.Why it matters
For the F# compiler grammar (
pars.fsy) this is 1457 lines on every regeneration: 617 shift/reduce and 840 reduce/reduce. BecauseCallFsYaccinFsLexYacc.targetsruns a plain<Exec>with no importance set, all of it lands in the MSBuild log at normal verbosity and buries everything else the build has to say.These conflicts are a property of the grammar. For someone authoring a grammar they are worth seeing. For someone vendoring a grammar they do not control, which is Fantomas' case with dotnet/fsharp's
pars.fsy, they are noise on every build and carry no action.Possible resolutions
Any of these would solve it:
--quietor--no-conflict-reportflag on fsyacc-valready produces, instead of stdout617 shift/reduce, 840 reduce/reduce conflicts, pass -v for detail, with the per state detail behind-vThe third seems the most useful of the three, since what a grammar author actually wants to notice is the count changing, not 1457 individual lines scrolling past.
Workaround
Setting
StandardOutputImportance="low"on the<Exec>inCallFsYacchides the reports at normal verbosity while keeping them available at-v:detailed. That is what Fantomas does through aDirectory.Build.targetsoverride. It could reasonably be the package default: the reports are not actionable for the great majority of consumers, and the escape hatch costs nothing.