radicle-dev / radicle-surf

A code browsing library for VCS file systems.
Other
32 stars 11 forks source link

Use nom for parsing references #161

Closed FintanH closed 3 years ago

FintanH commented 3 years ago

The regex had a subtle bug in it that I wasn't willing to put the effort in to figure out why. Instead I've switched to use the nom parsing library so I can have a better understanding of the semantics. However, I also did not put in the effort to figure out how to make the errors better. Any failure is considered a "MalformedRef".

FintanH commented 3 years ago

@NunoAlexandre tagging you because you played with nom and thought you might have some good feedback on usage. The library is a bit of a war ground with str and [u8].

FintanH commented 3 years ago

What was the issue?

I got into all kinds of annoyances when PeerId got involved as a remote -- using TryFrom -- and then the mixed-use of librad::RefLike and surf::RefLike was too much of a headache. I couldn't see it being worth the maintenance.

kim commented 3 years ago

I see. We could consider releasing only the git_ext::reference::name module as a separate crate. Maybe "rightpad" would be an appropriate name :thinking:

FintanH commented 3 years ago

Hahaha I'm ok with releasing something more complete and polished. It would be good to know what you're thinking needs work in that area and I could chip in with getting it publishable :)