Version
v110.98
Operating System
OS Version
Ubuntu 18.04
Processor
No response
Component
Core system
Severity
Minor
Description of the problem
When printing a CaseExp using PPAst, the last branch is omitted from printing.
One potential fix would be to remove the trim function, using rules instead of trim rules. (I'm not sure what the reasoning behind trim is in the first place, though.)
Transcript
- val pd : PrettyPrint.device = {consumer = print, linewidth = Fn.const 80, flush = fn () => TextIO.flushOut TextIO.stdOut};
val pd = {consumer=fn,flush=fn,linewidth=fn} : ?.PrettyPrint.PP.device
- val dec = SmlFile.parse (Source.newSource ("demo", TextIO.openString "case 0 of 0 => 0", false, ErrorMsg.defaultConsumer ()));
val dec =
SeqDec
[MarkDec
(ValDec ([Vb {exp=MarkExp #,lazyp=false,pat=VarPat #}],[]),(2,18))]
: Ast.dec
- let val strm = PrettyPrint.openStream pd in PPAst.ppDec NONE strm (dec,6) before PrettyPrint.closeStream strm end;
val it =
(case 0
)val it = () : unit
Expected Behavior
No response
Steps to Reproduce
val pd : PrettyPrint.device = {consumer = print, linewidth = Fn.const 80, flush = fn () => TextIO.flushOut TextIO.stdOut};
val dec = SmlFile.parse (Source.newSource ("demo", TextIO.openString "case 0 of 0 => 0", false, ErrorMsg.defaultConsumer ()));
let val strm = PrettyPrint.openStream pd in PPAst.ppDec NONE strm (dec,6) before PrettyPrint.closeStream strm end;
Additional Information
No response
Email address
No response
Comments from smlnj-gforge
Original smlnj-gforge bug number 270
Submitted on 2020-08-08 at 21:35:00
Keywords: pretty-print
Version
v110.98
Operating System
OS Version
Ubuntu 18.04
Processor
No response
Component
Core system
Severity
Minor
Description of the problem
When printing a
CaseExpusingPPAst, the last branch is omitted from printing.One potential fix would be to remove the
trimfunction, usingrulesinstead oftrim rules. (I'm not sure what the reasoning behindtrimis in the first place, though.)Transcript
Expected Behavior
No response
Steps to Reproduce
Additional Information
No response
Email address
No response
Comments from smlnj-gforge
Original smlnj-gforge bug number 270
Submitted on 2020-08-08 at 21:35:00
Keywords: pretty-print