Re: [Pyparsing] How can I determine if a fragment is valid?
Brought to you by:
ptmcg
From: Andrew S. <agt...@ya...> - 2008-01-17 02:32:25
|
--- Paul McGuire <pt...@au...> wrote: > > > Thanks for the quick reply. So far using pe.loc < > len(input) works for me. > I'll reply to the list if I can find a counter > example. Can I count on loc > sticking around in the ParseException class? > > <PM> Great! Yes, loc is an important part of > ParseException, and has been > in pyparsing since version 0.5. What would give you > the idea that it might > not stick around? > (Grammar discussion snipped) Since the algorithm you suggested for maybeParseable() works well but is not a formal part API I kind of feel like I'm going in through the "back door" to get this done. It's probably just perception on my part, but relying on direct attribute access for the parse error location also feels like it could change. This is most likely a holdover from habits gained doing too much Java beans attribute access. Even though I'd like getters and setters to die a horrible death they did sort of provide a feeling of permanence. -a. ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |