paurkedal / ppx_regexp

Matching Regular Expressions with OCaml Patterns
GNU Lesser General Public License v3.0
56 stars 3 forks source link

Fix multi-group top level regexp for ppx_tyre. #3

Closed Drup closed 6 years ago

Drup commented 6 years ago

Routes like this one:

let url = function%tyre
  | "(?&host:host)/hump/(?&hump:int)(\?(?<b>extinct))?" -> host, `Hump (hump, b)

were broken, because the ppx would generate a pattern (host, hump, b), instead of the correct (host, (hump, b). Everything to generate nested tuples was already there, it was just not used in enough places. :p

paurkedal commented 6 years ago

Merged. Do we need a bugfix release right away?

Drup commented 6 years ago

If you don't mind, that would be nice yes. It makes it impossible to have regexes with more than 2 groups at toplevel, which is ... slightly unfortunate.

paurkedal commented 6 years ago

A new release on it's way, ocaml/opam-repository#12566.