Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004713OCamlCamlp4public2009-02-10 20:202013-12-24 09:50
ReporterYoric 
Assigned Todim 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionreopened 
PlatformOSOS Version
Product Version3.11.0 
Target Version4.01.1+devFixed in Version 
Summary0004713: Camlp4o messes with comments
DescriptionCamlp4o messes with comments, hence with ocamldoc generation of documentation.

In order for comments to be used by ocamldoc, they should come immediately before or after a value. Camlp4o moves comments away from values, hences breaks ocamldoc.

While there may be workarounds, it's quite annoying for documentation generation of Batteries Included, as it produces pages such as http://batteries.forge.ocamlcore.org/doc.preview:batteries-alpha3/html/api/GZip.html [^] .

Is there any hope that this could be fixed?
Tagspatch
Attached Files? file icon t.mli [^] (48 bytes) 2009-02-10 20:20 [Show Content]
diff file icon camlp4.diff [^] (1,665 bytes) 2009-12-31 13:44 [Show Content]

- Relationships
related to 0004545feedbackhongboz Camlp4 preprocessing messes up the documentation. 
related to 0004346closeddim Camlp4 messes up comments within and after records. 

-  Notes
(0004835)
Yoric (reporter)
2009-02-10 20:22

camlp4o t.mli => the comment is removed
(0004836)
Yoric (reporter)
2009-02-10 20:22

camlp4o t2.mli => the first comment is moved from the first value to the second value, the second comment is removed
(0005216)
ygrek (reporter)
2009-12-31 13:50

camlp4.diff - a dirty workaround that will partially fix observed behaviour (for interface files). Can't think of anything better unless comments become part of the Ast (why not?).
(0005692)
ygrek (reporter)
2010-10-27 16:26

Here is one more example : http://extunix.forge.ocamlcore.org/api/ExtUnixSpecific.html#TYPEadvice [^]

Is it possible to make comments part of the AST and will you consider such patch for inclusion?
(0006597)
dim (developer)
2012-01-05 12:01

Note that the problem is that you are using an intermediate on-disk file, camlp4 is not supposed to be used like this (you loose locations for example).

If you call ocamldoc on the file before it is preprocessed with the right -pp option, then the result is fine (i tried for extunix). A possible solution for extunix is to copy extUnix.mlpp to extUnixAll.ml and extUnixSpecific.ml and use camlp4 on both files. If you want i can provide a patch.
(0006601)
ygrek (reporter)
2012-01-05 16:38

Thanks for looking into it - I will try to generate docs with simultaneous preprocessing and see how it goes. The generated files are included in distribution so I decided to generate docs from that files without much thinking.
(Anyway, camlp4 ideally shouldn't mess with comments).
(0010758)
ygrek (reporter)
2013-12-22 04:28

forwarded to https://github.com/ocaml/camlp4/issues/6 [^]

- Issue History
Date Modified Username Field Change
2009-02-10 20:20 Yoric New Issue
2009-02-10 20:20 Yoric File Added: t.mli
2009-02-10 20:22 Yoric Note Added: 0004835
2009-02-10 20:22 Yoric Note Added: 0004836
2009-03-28 17:19 xleroy Status new => assigned
2009-03-28 17:19 xleroy Assigned To => ertai
2009-12-31 13:44 ygrek File Added: camlp4.diff
2009-12-31 13:50 ygrek Note Added: 0005216
2010-10-27 16:26 ygrek Note Added: 0005692
2011-10-26 08:44 ertai Assigned To ertai => xclerc
2012-01-05 12:01 dim Note Added: 0006597
2012-01-05 12:01 dim Assigned To xclerc => dim
2012-01-05 12:01 dim Status assigned => feedback
2012-01-05 16:38 ygrek Note Added: 0006601
2012-07-11 14:58 doligez Target Version => 4.01.0+dev
2012-07-11 15:52 doligez Relationship added related to 0004545
2012-07-11 16:06 doligez Relationship added related to 0004346
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-17 13:49 doligez Target Version 4.00.1+dev => 4.01.0+dev
2013-08-02 14:43 doligez Target Version 4.01.0+dev => 4.01.1+dev
2013-09-04 18:09 doligez Tag Attached: patch
2013-12-22 04:28 ygrek Note Added: 0010758
2013-12-24 09:50 dim Status feedback => closed
2013-12-24 09:50 dim Resolution open => reopened


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker