Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007807OCamlstandard librarypublic2018-06-11 21:402018-06-18 15:25
Reporterherbelin 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version4.06.1 
Target VersionFixed in Version 
Summary0007807: Format: More refined check to evaluate whether a box shall lead to go beyond max_indent and need a break prior to opening?
DescriptionThis is a followup of a discussion at issue 7804 showing the example of a box which would fit on the line but which however forces a break just because it is opened beyond the max_indent limit.

Assuming that the specification of max_indent is strictly to not indent beyond the max_indent value, the test made at box opening to force a break if the box is opened beyong max_indent seems overly preventive. Opening a box does not mean that printing the contents of the box shall necessarily need to break a line and indent.

In particular, in a situation such as described in https://github.com/coq/coq/issues/7731, [^] where a box is opened beyond the max_indent limit but this box is within a surrounding box and a previous break in the surrounding box has already checked that the forthcoming comments shall fit, the box may (??) trust the decision take by the previous break and not test max_indent. Would it make sense to refine the algorithm in this way? Otherwise said, looking at the implementation of `Format.format_pp_token`, is the "size" computed in the `Pp_break` clause correct enough to ensure that, if it fits, forthcoming boxes shall fit and shall not have to preventively test whether they are beyond the max_indent limit.

Steps To ReproduceSee 0007804 for a simplified example, or https://github.com/coq/coq/issues/7731 [^] for a realistic example.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2018-06-11 21:40 herbelin New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker