[Doc-SIG] scope of the parser

Alan Jaffray jaffray@pobox.com
Sat, 17 Nov 2001 16:29:14 -0500 (EST)


On Sat, 17 Nov 2001, David Goodger wrote:
> Looks like it's time for another... DPS Components Diagram!

Thanks for the explanation and the diagram.  It cleared things up for me.

> > It seems advantageous to be able to decouple directive
> > processing and implementation from reStructuredText parsing and
> > implementation.
> 
> We can't do that, because directives are specifically allowed to reuse
> the parser for their own purposes.  For example, the admonition
> directives (note, caution, danger, etc.) recursively generate and run
> a parser state machine to do most of their work for them.

That's why I said "be able to".  95% of the time the desired behavior
for directives will be to process the block argument as RST, and not
do any other RST processing.  In those cases, you can decouple.  If you
want something else, you have to muck with the inside of the parser.

Alan