Feature Request - Raw HTML in ddoc comments

Bill Baxter dnewsgroup at billbaxter.com
Sun Mar 2 17:19:56 PST 2008


BCS wrote:
> Reply to Janice,
> 
>> On 02/03/2008, Derek Parnell <derek at psych.ward> wrote:
>>

> 
> (for lack of a better place in this post to put it):
> 
> The problem with escaping raw output is that DMD would need to include 
> something akin to a full lex/yacc and more to do this. This is because 
> absolutely anything could be raw output. I could use DDoc to generate 
> output for a system that has any arbitrary syntax. To make a system that 
> can work with defining the rules that would allow DDoc to find the stuff 
> to escape would be a huge project in and of it's self. To take a fun 
> example, say I want to make ddoc generate D (don't ask why, I've made 
> use of crazier things) some string would need to be escaped ( \n for
> example) but only if they are not in quotes ("\n") but maybe not all 
> quotes (`\n`).
> There are other reasons to not escape; when do you escape? Say I define 
> a macro like this "AB=A $(B $1))" This macro will insert an A followed 
> by B expanding it's arg. This might be on top of a language package (in 
> which cases the A should be escaped if it has special meaning) or as 
> part of a language package (in which cases it should not be escaped).
> 
> To start having DDoc escape stuff just opens a huge can of worms that 
> /has not solution/ so it just doesn't bother.
> 
> I hope some of that is useful.

That's a nice example of why simple macro substitution can never be 
powerful enough to really solve the markup translation problem.  There 
is a solution, but it requires DDoc learning some new tricks and moving 
beyond the pure macro processor idea, which I'm not sure Walter is 
willing to give up.

--bb



More information about the Digitalmars-d mailing list