I wrote a toy regex package in roc. The parser is a recursive decent parser, because I ran into problems with the parser combinator example in the roc repo. It was a challenge because state has to be kept for the parser. I think I will try to write some kind of state monad to make this easier.
https://github.com/KilianVounckx/roc_regex
I also had some bugs with expect and dbg when working on this. I wasn't planning on adding the example app, but expect didn't work as intended on the one test that is there, so I didn't try to make more and just wrote an app file
super cool!!!
if you can reproduce bugs with dbg
and expect
, it would be awesome to have issues for those! We have lots of reports of people running into bugs with them, but unfortunately not much in the way of standalone reproductions to try to fix :sweat_smile:
I'll try to create some minimal reproductions tomorrow. After that, I will probably not have much time due to exams coming up
makes sense, thank you!
Raised two issues so far: https://github.com/roc-lang/roc/issues/5479 and https://github.com/roc-lang/roc/issues/5480
Seems like my expect test in the regex package works now after updating the compiler (built from source)!
The two issues raised still are bugs though
Last updated: Jul 06 2025 at 12:14 UTC