Re: [Pyparsing] Variable comment char
Brought to you by:
ptmcg
From: Ralph C. <ra...@in...> - 2011-09-26 12:17:52
|
Hi Russell, > I need to parse a rather evil format that has the following line: > > [Comment Char] |_char > > Which would change the comment char to '|'. How about a two-pass approach? Have pyparsing handle just these `change comment char' commands with all the other text being stripped of comments, denoted by the current char, by Python code, then pyparse again with your full grammar knowing all comments have gone. Cheers, Ralph. |