[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More PEG

From: Noah Lavine
Subject: Re: More PEG
Date: Sat, 17 Sep 2011 21:09:03 -0400


> Can you give an example of what ‘peg-parse’ and ‘peg:tree’ return?

'peg-parse' returns a match record, which contains the string that was
parsed, the substring that actually matched, and the tree structure
produced by the matching. 'peg:tree' gets the tree structure out of a
match record.

I hadn't really looked at this part of the module, but it looks to me
now like the names aren't descriptive enough. Maybe we should change
them before putting this in a release.


On Sat, Sep 10, 2011 at 5:35 PM, Ludovic Courtès <address@hidden> wrote:
> Hi!
> Noah Lavine <address@hidden> skribis:
>> Right now I think you could get the same thing by running match on the
>> output of the peg - something like
>> (match (peg:tree (peg-parse <pattern> <tree>))
>>   ((list-of-as) ...)).
> Can you give an example of what ‘peg-parse’ and ‘peg:tree’ return?
> Ludo’.
> PS: I would suggest removing the ‘peg-’ and ‘peg:’ prefixes.  Users can
>    still use a renamer if the names clash.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]