neotomex icon indicating copy to clipboard operation
neotomex copied to clipboard

Labelled Matches

Open jtmoulia opened this issue 10 years ago • 0 comments

neotoma has a neat facility for labelling matches:

string <- '"' chars:(!'"' ("\\\\" / '\\"' / .))* '"'

It then labels the match using a tuple, for example {:chars, ...}. This is awesome when there is a sequence of matches since it turns it into a keyword list. Even if only some elements are labelled, e.g. [{:chars, "1"}, "2] the keyword functions still work.

This serves a similar purpose as #4, throwaway matches.

jtmoulia avatar Aug 19 '14 14:08 jtmoulia