Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::DocComment Struct Reference

#include <nixexpr.hh>

Public Member Functions

 operator bool () const
 
std::string getInnerText (const PosTable &positions) const
 

Public Attributes

PosIdx begin
 
PosIdx end
 

Detailed Description

A documentation comment, in the sense of RFC 145

Note that this does not implement the following:

  • argument attribute names ("formals"): TBD
  • argument names: these are internal to the function and their names may not be optimal for documentation
  • function arity (degree of currying or number of ':'s):
    • Functions returning partially applied functions have a higher arity than can be determined locally and without evaluation. We do not want to present false data.
    • Some functions should be thought of as transformations of other functions. For instance overlay -> overlay -> overlay is the simplest way to understand composeExtensions, but its implementation looks like f: g: final: prev: <...>. The parameters final and prev are part of the overlay concept, while distracting from the function's purpose.

Member Function Documentation

◆ operator bool()

nix::DocComment::operator bool ( ) const
inline

Whether the comment is set.

A DocComment is small enough that it makes sense to pass by value, and therefore baking optionality into it is also useful, to avoiding the memory overhead of std::optional.

Member Data Documentation

◆ begin

PosIdx nix::DocComment::begin

Start of the comment, including the opening, ie / and **.

◆ end

PosIdx nix::DocComment::end

Position right after the final asterisk and / that terminate the comment.


The documentation for this struct was generated from the following files: