Alan Post wrote:
Interesting. Is the PEG grammar available for this
parser?
-Alan
It's at
https://github.com/AboutUs/kiwi/blob/master/src/syntax.leg
Get peg/leg from
http://piumarta.com/software/peg/
I just tried it and already found a bug on the first Hello World (it
surrounds headers inside paragraphs).
It strangely converts templates into underscored words. They may be
expecting some other parser piece to restore it. I'm pretty sure there
are corner cases in the preprocessor (eg. just looking at the peg file
they don't handle mixed case noincludes), but I don't think that should
need to be handled by the parser itself.
The grammar looks elegant. I doubt it can really handle full wikitext.
But it would be so nice if it did...