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

version» Context lines:

pike.git/lib/modules/Tools.pmod/AutoDoc.pmod/module.pmod:52:      static string xmltag(string t, string|mapping(string:string)|void arg1,    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);    return "<" + t + "/>";   } +  + class SourcePosition { +  string filename; +  int firstline; +  int lastline; +  +  static void create(string|void filename, int|void firstline, +  int|void lastline) +  { +  local::filename = filename; +  local::firstline = firstline; +  local::lastline = lastline; +  } +  +  string _sprintf() { +  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 + ")"; +  } + } +