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
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
Hi!
Noah Lavine noah.b.lav...@gmail.com 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?
Hello,
The syntactic changes you propose all make sense to me, FWIW.
Great! Then I will push an implementation soon unless someone else objects.
A more general question about PEG: how do you bind a variable to the
result of a pattern? For instance, if you want the result of (* a) to
be
Hello all,
It looks to me like the last thing needed before the peg branch can be
used is to change some of the S-expression representations of the
components. Here are the five that I think need changing, taken from
the manual, with suggested replacements.
-- PEG Pattern: zero or more a