pest icon indicating copy to clipboard operation
pest copied to clipboard

Add basic support for `node_tag` and `branch_tag`

Open oovm opened this issue 4 years ago • 1 comments

This idea was introduced in #550 .

This pr submitted new interfaces that does not break compatibility.

  • ParserState::tag_node
  • ParserState::tag_branch
  • Pair::as_node_tag
  • Pair::as_branch_tag

I think when this feature is fully prepared, the if here can be deleted.

https://github.com/ygg-lang/pest/blob/91133e29ab59db0e6ab7ce42b18a3b46d1ae26e2/pest/src/iterators/pair.rs#L292-L298

oovm avatar Oct 18 '21 04:10 oovm

This is a cool feature! Maybe add some tests?

NoahTheDuke avatar Oct 20 '21 14:10 NoahTheDuke

added a test in https://github.com/pest-parser/pest/pull/832

tomtau avatar Apr 08 '23 11:04 tomtau