rekka / meval-rs

Math expression parser and evaluation library for Rust
The Unlicense
153 stars 30 forks source link

Nom5 #22

Open glennpierce opened 4 years ago

glennpierce commented 4 years ago

If you are interested I need a basic parser / evaluator to perform simple maths on vectors of data. Why trying to learn your code I made a port to use nom 5 if you are interested. If so here is the pull request.

rekka commented 4 years ago

Thanks for the updated code. I will check it out if I find time; I'm unfortunately a bit busy these days. I didn't even know that there is already nom version 5! :)

michel-slm commented 2 years ago

any update here? nu-command requires meval, and we have nom 7.1.0 in Fedora so unless we maintain nom 1.x there separately, we can't build Nushell without heavily patching meval

rekka commented 2 years ago

Thanks for the ping.

I am not at all familiar with packaging programs for Fedora (is this the Linux distribution we are talking about?)

I have not updated to newer versions of nom since I do not see the benefit of the extra work (and serious lack of available time). Last time I checked it looked like that only the API changed, which might make writing new parsers easier I suppose, but I did not see any performance gains that would justify the update. I do not plan to expand the functionality of meval's parser. I checked and nom 1 is still available on crates.io and as far as I know it compiles on the current rustc just fine.

Is there a bug in nom 1 that is a cause for concern?

My worry is that the semantics of nom changed between 1 and 7, in particular the handling of complete/incomplete parsing, and this makes updating the current parser somewhat subtle. I cannot say that my unit tests are exhaustive...

I am sorry for my lack of knowledge, but can you give me more details why it is necessary to update to newer nom? Would I need to update to a newer version of nom again when nom bumps the version to 8, 9, etc.?