[Issue 3554] Ddoc generats invalid output for documentation comments with non paired paranthasis

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 21 16:51:26 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3554



--- Comment #15 from Witold Baryluk <baryluk at smp.if.uj.edu.pl> 2010-11-21 16:50:01 PST ---
Thanks for your hard work, but I just tested initial bugreport in DMD 2.050,
and it still do not work as expected.

  /** Produces something in (a;b] */
  float f(float a, float b) { return (a+b)/2.0; }
  /** Produces something in [a;b) */
  float h(float a, float b) { return (a+b)/2.0; }

  void main() { }


<br><br>
<dl><dt><big>float <u>f</u>(float <i>a</i>, float <i>b</i>);
</big></dt>
<dd>Produces something in <i>a</i>;<i>b</i>] <br><br>

</dd>
<dt><big>float <u>h</u>(float <i>a</i>, float <i>b</i>);
</big></dt>
<dd>Produces something in [<i>a</i>;<i>b</i> <br><br>

</dd>
</dl>


No ( or ).   :(

When compiling with -wi, i got

ttt.d(2): Warning: Ddoc: Stray '('. This may cause incorrect Ddoc output. Use
$(LPAREN) instead for unpaired left parentheses.
ttt.d(4): Warning: Ddoc: Stray ')'. This may cause incorrect Ddoc output. Use
$(RPAREN) instead for unpaired right parentheses.

Why it is hard to detect non-macro usage of parantheses? I was thinking macros
need have $ before opening (. 


After creating ddoc file:
RPAREN = )
LPAREN = (

And compiling again, i had now:

<br><br>
<dl><dt><big>float <u>f</u>(float <i>a</i>, float <i>b</i>);
</big></dt>
<dd>Produces something in (<i>a</i>;<i>b</i>] <br><br>

</dd>
<dt><big>float <u>h</u>(float <i>a</i>, float <i>b</i>);
</big></dt>
<dd>Produces something in [<i>a</i>;<i>b</i>) <br><br>

</dd>
</dl>


Which is exactly what was expected! (Warning are still there). But it works.

So just resolving problem with macro definition in compiler is needed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list