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

Chpldoc error with --comment-style flag and non-matching closing comment #5909

Closed
lydia-duncan opened this issue Mar 30, 2017 · 4 comments
Closed

Comments

@lydia-duncan
Copy link
Member

Summary of Problem

When Chapel code is documented with chpldoc, if the --comment-style flag is used, no verification is performed to ensure that the signifier of the end of the comment matches the start of the comment. We would like to ensure that all custom comment styles are closed in the reverse order of the starting sequence. We might also consider adding a flag to specify different opening and closing signifiers, but that would be a bonus feature.

Steps to Reproduce

Source Code:

/** This comment is not closed properly */
proc bad() {

}

Compile command:
chpldoc --comment-style /** badClose.doc.chpl

Associated Future Test(s):
chpldoc/compflags/comment/badClose.doc.chpl

Configuration Information

  • Output of chpl --version:
    Chapel 1.10.0 and on (still present as of Chapel 1.15.0)
@Shashi456
Copy link

how can i go about doing this ?

@lydia-duncan
Copy link
Member Author

lydia-duncan commented Apr 3, 2017

The handling of chpldoc flags can be found in compiler/main/docsDriver.cpp. Looking in there should allow you to determine the global variable used for determining if a block comment is a chpldoc comment (I recommend doing a search on the flag minus the leading "--" and then reading the description above the data structure which that will lead you to, in order to determine which of the components of that record is used).

The detection of whether an ordinary block comment or a chpldoc comment is being used is handled at parse time. Doing a search in the compiler for the variable you found in the last step will lead you to two potential files - one of them is generated from the other. The file you want to modify is compiler/parser/chapel.lex. Once you have made modifications there, you will need to do a make parser in the directory containing that source in order to actually see your changes take effect when you rebuild the compiler (a separate step).

@lprimeroo
Copy link
Member

Is this fixed?

@lydia-duncan
Copy link
Member Author

#5973 is resolving this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants