mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Track doc comments and render them in :doc
This commit is contained in:
parent
e5af7cbeb9
commit
7fae378835
25 changed files with 515 additions and 16 deletions
|
@ -583,6 +583,20 @@ std::string ExprLambda::showNamePos(const EvalState & state) const
|
|||
return fmt("%1% at %2%", id, state.positions[pos]);
|
||||
}
|
||||
|
||||
void ExprLambda::setDocComment(DocComment docComment) {
|
||||
if (!this->docComment) {
|
||||
this->docComment = docComment;
|
||||
|
||||
// Curried functions are defined by putting a function directly
|
||||
// in the body of another function. To render docs for those, we
|
||||
// need to propagate the doc comment to the innermost function.
|
||||
//
|
||||
// If we have our own comment, we've already propagated it, so this
|
||||
// belongs in the same conditional.
|
||||
body->setDocComment(docComment);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* Position table. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue