Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006769OCamlstandard librarypublic2015-02-03 21:112017-03-17 16:52
Reporterivg 
Assigned Toweis 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version4.02.1 
Target VersionFixed in Version 
Summary0006769: Formatting tags are lost on a flush
DescriptionI'm not sure whether it is a bug or feature, but if you flush formatter, it will "forget" all its tags.

Steps To Reproduce# set_tags true;;
- : unit = ()
# printf "@{<html>@{<body>hello@}@}";;
<html><body>hello</body></html>- : unit = ()
# printf "@{<html>@{<body>hello@.@}@}";;
<html><body>hello
- : unit = ()
#
Additional Informationis also reproducible on 4.01
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0017674)
doligez (administrator)
2017-03-15 15:13

The question is whether `flush` should close the currently open tags as well as the boxes.
(0017677)
ivg (reporter)
2017-03-15 15:47

Tags represent semantics (i.e., what is data about), where boxes represent the syntax (i.e., how it is printed; how it looks like).

Intuitively, the flush operation should be transparent with respect to the syntax and semantics of data. So the same program with and without interleaved flushes should have the same final output. This is the first invariant.

Another intuitive property is that flush should dump all available data. This is the second invariant.

It is not trivial to preserve both these properties with respect to boxes since we can't layout a stream that has non-closed boxes.

A possible solution is to provide two `flush` functions - `hard_flush` and `flush`. The `hard_flush` may break the first invariant (syntax and semantics), but will never violate the second one. It should be used at the end of the program, or other already exceptional/abnormal conditions. The normal `flush` function, will always preserve the first invariant, although the second one will be relaxed. Basically, a `flush ppf` is a recommendation to flush data as soon as possible.

- Issue History
Date Modified Username Field Change
2015-02-03 21:11 ivg New Issue
2015-02-19 00:10 doligez Status new => acknowledged
2015-02-19 00:10 doligez Target Version => 4.03.0+dev / +beta1
2016-04-18 14:13 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2017-02-16 14:01 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:43 doligez Category OCaml standard library => standard library
2017-03-15 15:13 doligez Note Added: 0017674
2017-03-15 15:14 doligez Assigned To => weis
2017-03-15 15:14 doligez Status acknowledged => assigned
2017-03-15 15:14 doligez Target Version undecided =>
2017-03-15 15:47 ivg Note Added: 0017677


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker