pike.git / lib / modules / Tools.pmod / AutoDoc.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/module.pmod:65:    string|void arg2)   {    mapping attributes = mappingp(arg1) ? arg1 : 0;    string content = stringp(arg1) ? arg1 : stringp(arg2) ? arg2 : 0;    if (content && content != "")    return opentag(t, attributes) + content + closetag(t);    string s = "<" + t + writeattributes(attributes) + "/>";    return s;   }    + //! Class used to keep track of where in the source a piece of + //! documentation originated.   class SourcePosition { -  +  //!    string filename; -  +  +  //! Range of lines.    int firstline;    int lastline;    -  +  //!    protected void create(string filename, int firstline,    int|void lastline)    {    if (!firstline) {    werror("**********************************************************\n");    werror("* NO FIRST LINE !!!!! \n");    werror("**********************************************************\n");    werror("%s", describe_backtrace(backtrace()));    werror("**********************************************************\n");    werror("**********************************************************\n");    }    this_program::filename = filename;    this_program::firstline = firstline;    this_program::lastline = lastline;    }    -  +  //! @returns +  //! Returns a copy of the current object.    SourcePosition copy() {    return SourcePosition(filename, firstline, lastline);    }       string _sprintf(int t) {    if(t!='O') return 0;    string res = "SourcePosition(File: " + (filename ? filename : "?");    if (firstline)    if (lastline)    res += sprintf(", lines: %d..%d", firstline, lastline);    else    res += sprintf(", line: %d", firstline);    return res + ")";    }    -  +  //! @returns +  //! Returns a string with an XML-fragment describing the source position.    string xml() {    mapping(string:string) m = ([]);    m["file"] = filename || "?";    if (firstline) m["first-line"] = (string) firstline;    if (lastline) m["last-line"] = (string) lastline;    return xmltag("source-position", m);    }   }    - class AutoDocError { -  SourcePosition position; -  string part; // which part of the autodoc system... -  string message; -  protected void create(SourcePosition _position, string _part, string _message) { -  position = _position; -  part = _part; -  message = _message; -  } + //! Base class for errors generated by the autodoc extraction system. + class AutoDocError ( +  //! +  SourcePosition position, +  +  //! Which part of the autodoc system. +  string part, +  +  //! Error message. +  string message +  ) {    string _sprintf(int t) {    return t=='O' && sprintf("%O(%O, %O, %O)", this_program,    position, part, message);    }   }