Re: [Pyparsing] Grouping when using asList()
Brought to you by:
ptmcg
From: Joshua J. K. <jk...@sk...> - 2008-03-07 01:50:36
|
On Thu, 2008-03-06 at 16:08 -0600, Paul McGuire wrote: > Try to look past the "it's a function call" to "this is a lot easier to > specify a results name than that old way!". (However, if you need to add > the listAllMatches attribute, this still requires the explicit call to > setResultsName.) Just had a thought: why not allow the listAllMatches=True to be added to the calls to pyparsing elements? Such as: p.delimitedList(bracket_quoted('key_columns', listAllMatches=True)) In fact, here you go. Starting on line 1170 of pyparsing.py (doc strings deleted for brevity) def __call__(self, name, **kw): return self.setResultsName(name, **kw) And just advertise pp_element() as a shortcut for pp_element.setResultsName(). j -- Joshua Kugler VOC/SigNet Provider (aka Web App Programmer) S&K Aerospace Alaska |