Branch: Tag:

2001-01-09

2001-01-09 13:28:41 by David Norlin <norlin@roxen.com>

If an error is found in a comment block, an array is throw:n.
err[0] = error message string. err[1] = a SourcePosition object that
points out the filename and the range of lines where the erroneous
comment can be found.

Rev: lib/modules/Tools.pmod/AutoDoc.pmod/CExtractor.pmod:1.4
Rev: lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod:1.4
Rev: lib/modules/Tools.pmod/AutoDoc.pmod/PikeExtractor.pmod:1.3
Rev: lib/modules/Tools.pmod/AutoDoc.pmod/PikeObjects.pmod:1.3
Rev: lib/modules/Tools.pmod/AutoDoc.pmod/PikeParser.pike:1.3
Rev: lib/modules/Tools.pmod/AutoDoc.pmod/module.pmod:1.3

9:   private void parseError(string s, mixed ... args) {    s = sprintf(s, @args);    werror(s+"\n"); -  s = "Doc markup error: " + s; +  s = "DocParser error: " + s;    throw(({ s, 0 }));   }   
645:    static MetaData mMetadata = 0;    static string mDoc = 0;    static string mContext = 0; -  void create(string s) { ::create(s); state = 0; } +  SourcePosition sourcePos = 0; +  void create(string s, SourcePosition|void sp) { +  ::create(s); +  state = 0; +  sourcePos = sp; +  }       MetaData metadata() { -  +  mixed err = catch {    if (state == 0) {    ++state;    mMetadata = ::getMetaData();    }    return mMetadata; -  +  }; +  if (sourcePos) +  throw(({ err[0], sourcePos }));    }       string doc(string context) { -  +  mixed err = catch {    if (state == 1) {    ++state;    mContext == context;
664:    else if (state == 0 || state > 1 && mContext != context)    return 0;    return mDoc; +  }; +  if (sourcePos) +  throw(({ err[0], sourcePos }));    }   }