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

Support where clauses in chpldoc #5950

lydia-duncan opened this issue Apr 5, 2017 · 2 comments


None yet
2 participants
Copy link

commented Apr 5, 2017

Summary of Problem

Today, the documentation of functions through chpldoc neglects any where clause on the function. Documentation writers are then forced to explicitly write such information in the documentation for the function instead of relying on chpldoc to autogenerate it for them. The generated documentation for a function should be extended to include this information.

Steps to Reproduce

Source Code:

/* I shouldn't have to say that x's type and y's type must always match */
proc bar(x, y) where (x.type == y.type) {


Compile command:
chpldoc foo.chpl


This comment has been minimized.

Copy link

commented Apr 10, 2017

Could you please help me with the files I should be looking into to resolve this?


This comment has been minimized.

Copy link
Member Author

commented Apr 10, 2017

Hi @saru95 - chpldoc is implemented mostly using compiler/AST/AstPrintDocs.cpp and the printDocs methods on the various AST nodes. I recommend getting familiar with our AST structure before trying to solve the bug right away, to understand how each of the different nodes interact with each other. The class structures for the AST nodes are defined in compiler/include/, under symbol.h, expr.h, stmt.h and a few others.

One consideration that I didn't think of before adding the "easy" label is that printing the internals of the where clause will involve operations that AstPrintDocs hasn't had to handle much before, with its focus on symbols. That said, there are other visitor pattern Ast*.cpp files that can be consulted for how to handle this operation.

Hopefully this is enough to get you started. Let me know if you have further questions!

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.