Mercurial > projects > dil
diff trunk/src/dil/doc/Parser.d @ 769:5e3ef1b2011c
Added and improved documentation.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sun, 17 Feb 2008 02:21:55 +0100 |
parents | d84349a60f5c |
children | 3b34f6a95a27 |
line wrap: on
line diff
--- a/trunk/src/dil/doc/Parser.d Sat Feb 16 22:10:21 2008 +0100 +++ b/trunk/src/dil/doc/Parser.d Sun Feb 17 02:21:55 2008 +0100 @@ -8,6 +8,7 @@ import dil.Unicode; import common; +/// A pair of strings. class IdentValue { string ident; @@ -23,11 +24,11 @@ /// <pre> /// ident = value /// ident2 = value2 -//// more text +/// more text /// </pre> struct IdentValueParser { - char* p; + char* p; /// Current pointer. char* textEnd; IdentValue[] parse(string text) @@ -73,6 +74,11 @@ return makeString(begin, end); } + /// Finds the next "Identifier =". + /// Params: + /// ident = set to Identifier. + /// bodyBegin = set to the beginning of the text body (whitespace skipped.) + /// Returns: true if found. bool findNextIdent(ref string ident, ref char* bodyBegin) { while (p < textEnd) @@ -119,6 +125,6 @@ char[] makeString(char* begin, char* end) { - assert(begin <= end); + assert(begin && end && begin <= end); return begin[0 .. end - begin]; }