ridiculousfish / regress

REGex in Rust with EcmaScript Syntax
Apache License 2.0
176 stars 11 forks source link

Named captures to return their names in-order #97

Closed ridiculousfish closed 2 months ago

ridiculousfish commented 2 months ago

Prior to this commit, the Match::named_groups() function would return names in an arbitrary order, because they were stored in a hash table. Switch to returning them in the original specification order from the pattern. This allows implementing the JS engine semantics where the object key order matches that from the pattern.

Fixes #96