pomsky-lang / pomsky

A new, portable, regular expression language
https://pomsky-lang.org
Apache License 2.0
1.28k stars 19 forks source link

Ruby doesn't allow forward references #102

Closed Aloso closed 10 months ago

Aloso commented 10 months ago

Describe the bug

Fuzzing revealed that Ruby/oniguruma rejects forward references. The information here is either outdated or just wrong.

Pomsky should disallow forward references in the Ruby flavor.

To Reproduce

regex-test "(\k<x>(?<x>))+" -fruby

Pomsky expression:

:(::x? :x("a")){3}

Expected behavior

Pomsky should show an error message when targeting Ruby.