Re: writing a moin parser

jacob martinson <[email protected]> Wed, 15 Jun 2005 15:40:02 -0500
Newsgroups gmane.comp.web.wiki.moin.devel
Message-ID <[email protected]>
i thought this was going to be a simple change, but it's proving
difficult for me so far.  i'm just trying to change wiki.py to
recognize [Pagename] as a wiki word, instead of  ["Pagename"].

-j

On 6/15/05, jacob martinson <[email protected]> wrote:
> On 6/14/05, Thomas Waldmann <[email protected]> wrote:
> > > are there any docs anywhere on writing a moin parser?  i.e. how a
> > > parser fits in with the rest of moin, the interfaces, etc.
> >
> > Not really, but there is some example code in MoinMoin/parser/*.py. :)
> >
> > And it is not THAT complicated.
> >
>=20
> I'm sure it's simple once you understand it, but looking at wiki.py
> it's pretty easy to get lost on what is actually happening.  This has
> got to be one of the best candidates for being rewritten with the re.X
> option I've ever seen:
>=20
> word_rule =3D
> ur'(?:(?<![%(l)s])|^)%(parent)s(?:%(subpages)s(?:[%(u)s][%(l)s]+){2,})+(?=
![%(u)s%(l)s]+)'
> % {
> 'u': config.chars_upper,
> 'l': config.chars_lower,
> 'subpages': config.allow_subpages and (wikiutil.CHILD_PREFIX + '?') or ''=
,
> 'parent': config.allow_subpages and (ur'(?:%s)?' %
> re.escape(PARENT_PREFIX)) or '',
> }
>=20
> And I thought I knew reg expressions pretty well!
>=20
> Thanks for everyone's help so far... I'm still chugging at it...
>=20
> -j
>


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click