On May 16, 6:43 am, Ant <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a question on PyParsing. I am trying to create a parser for a
> hierarchical todo list format, but have hit a stumbling block. I have
> parsers for the header of the list (title and description), and the body
> (recursive descent on todo items).
>

LineStart *really* wants to be parsed at the beginning of a line.
Your textline reads up to but not including the LineEnd.  Try making
these changes.

1. Change textline to:

     textline = pp.Combine(
        pp.Group(pp.Word(pp.alphas, pp.printables) + pp.restOfLine)) +
\
        pp.LineEnd().suppress()

2. Change comb to:

    comb = head + parser

With these changes, my version of your code runs ok.

-- Paul
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to