dmajda/pegjs — Issue #63: Give predicates access to previously matched labeled expressions
Author: wolever
Created: 2011-12-14 20:01:40+00:00
State: open

It would be really nice if predicates could access previously matched labeled expressions.

For example, consider a simple HTML parser that is aware of self-closing tags. It would be nice to be able to do something like:

selfclosing_tag
= tag:tag_open "/>"
/ tag:tag_open &{ return tag.name == "br" } ">"

Would this be possible to implement? (my parsing-foo is weak)

And, if so, would a patch to do this be accepted?