Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamldoc comments no longer in the cmt_comments field of .cmt files #6972

Closed
vicuna opened this issue Aug 27, 2015 · 8 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Aug 27, 2015

Original bug ID: 6972
Reporter: @oandrieu
Assigned to: @lpw25
Status: closed (set by @xavierleroy on 2017-02-16T14:14:38Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.2
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: jmeber

Bug description

Since the store-ocamldoc-comments-as-attributes-in-the-AST change in 4.02.2, the cmt_comments part of .cmt files only contains non-ocamldoc comments. This broke my program that was looking for ocamldoc comments there.

I'm not sure this was intended, just reporting this in case it was an oversight.

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 27, 2015

Comment author: @gasche

I suspect that this is an unintended change (I would expect all comments to be stored in this field). Unfortunately it's probably too late to fix this regression in a 4.02.x release.

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 27, 2015

Comment author: @lpw25

I cannot reproduce the problem. Could you give more details about what differences you are seeing?

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 27, 2015

Comment author: @trefis

The only difference I could notice between 4.02.1 and >=4.02.2 is that before 4.02.2 an ocamldoc comment would be stored with a leading star, whereas now you don't have that star anymore (since '(**' is now handled specially).

If you tool relied on that, maybe that explains the breakage?
In any case, I can confirm that all comments are still stored in the cmt_comments field.

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 27, 2015

Comment author: @oandrieu

Ooh right, indeed it's the missing leading star that broke my tool.

I had then a quick look at the patch, misread it and thought the comments were gone from cmt_comments.

sorry about that.

@vicuna

This comment has been minimized.

Copy link
Author

commented Aug 28, 2015

Comment author: @alainfrisch

I'm not sure about the resolution status. If the source code contains a comment (** ... *), shouldn't the leading star be reflected in the cmt_comments field?

@vicuna

This comment has been minimized.

Copy link
Author

commented Sep 28, 2015

Comment author: @lpw25

If the source code contains a comment (** ... *), shouldn't the leading star be reflected in the cmt_comments field?

I had thought not, but I guess there is no other way to distinguish special and regular comments in that field.

@vicuna

This comment has been minimized.

Copy link
Author

commented Sep 28, 2015

Comment author: @alainfrisch

My question was rather rhetorical. Since comments are delimited by (...), it seems pretty clear that the "payload" of (*FOO) is "*FOO". The fact that ocamldoc-like comments are recognized in a special way and passed through attribute is an addition, it should not break existing tools that rely on finding "*FOO" in the cmt files (esp. when the new -keep-docs is not used).

@vicuna

This comment has been minimized.

Copy link
Author

commented Nov 3, 2015

Comment author: @gasche

This was fixed by Leo in

#276

@vicuna vicuna closed this Feb 16, 2017

@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.