diff --git a/src/meander/epsilon.clj b/src/meander/epsilon.clj index 0a0dfd32..9a95351f 100644 --- a/src/meander/epsilon.clj +++ b/src/meander/epsilon.clj @@ -386,6 +386,24 @@ ;; else &form)) +(defsyntax sequential + "Pattern matching operator which matches the `seq` of anything that + is `sequential?` against + + (p1 ,,, pn) + + where the sequence `p1` through `pn` is equal to `patterns`." + [& patterns] + (case (::r.syntax/phase &env) + :meander/match + `(r.match.syntax/pred sequential? (r.match.syntax/apply seq ~patterns)) + + :meander/substitute + patterns + + ;; else + &form)) + (defsyntax scan "Pattern matching operator which matches the `seq` of `seqable?` forms of the shape