pike.git / refdoc / inlining.txt

version» Context lines:

pike.git/refdoc/inlining.txt:126:    }    int methodTwo()    {    ...    }       //! However, it can be useful sometimes, for really short methods:    int very_short() { return 4711; }    int even_shorter() { return 0; }    -  +    In Pike files, you can not use @class or @module to tell which module   or class you are in. To document a class, you simply write:      //! Doc for the class   class CheeseMaker   {    //! You can even document inherits!    inherit Earth : earth;       //! Doc for CheeseMaker->a()
pike.git/refdoc/inlining.txt:157:   CheeseMaker. If a class has no documentation comment, it's internals   will not be examined, thus it is an error if a class contains   documentation comments but is itself undocumented:      class a()   {    //! @decl foo    //! ... doc for foo ...   }    + A special inlining case is that of functions and classes. When documenting + these, the doc comment can be put between the head of the function/class, + and the opening "{", like this: +  +  class Roy +  //! Documentation for Roy +  { +  .... +  } +  +  int un_randomize(int x) +  //! This function takes a random number, and transforms it into +  //! a predictable number. +  { +  return x = 4711; +  } +    If a doc block is the first in a file, and it has no target, then it   is treated as doc for the file (or rather: the module/class that the   file compiles into) itself. In any other case it is an error to have a   targetless doc block. A target can also be set with the @decl meta   keyword. If a doc comment begins with some @decl keywords, these   @decl's act just like real declarations standing next to the doc.   Thus:       //! @decl int a(int x)    //! @decl int b(int x)