[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: Mon, 19 Sep 2011 10:46:33 -0400

As promised, the 'wip-peg-fixed' branch now has an updated
S-expression representation for PEG grammars, and updated
documentation for it.

As I understand it, the next thing to do before merging (and possibly
the last thing!) is to think about what things should be named, so
they can be easy for people to learn and forwards-compatible with
whatever our future plans for parsing are. I will try to send an email
soon with some thoughts on that.


On Sat, Sep 17, 2011 at 9:09 PM, Noah Lavine <address@hidden> wrote:
> Hello,
>> 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.
> Noah
> 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]