Skip to content

Commit

Permalink
Merge jethrogb#22
Browse files Browse the repository at this point in the history
22: Upgrade to nom 5 r=jethrogb a=jonhoo

This patchset builds on jethrogb#21, and bumps the dependency on `nom` to version 5. The change is a fairly major one, since `nom` moved away from macro-based parsers to combinators based on function callbacks.

Fixes jethrogb#19 

---

**Old obsolete text:**

The current state of affairs is that this _almost_ compiles. The biggest remaining issue is how to pass the methods of `expr::PRef` in the new function-passing style. The errors should pretty quickly make it obvious what's going on. I'm honestly not sure what the right way to go about this is. The methods that call them may need to be re-written in the sort of "linear" style that `nom 5` favors. [`nom-methods`](https://docs.rs/nom-methods/) may provide some inspiration here. The new `&mut self` style also makes it awkward to have a combinator that may call multiple different methods on `self`.  It may be that we want to return to the old "consume self return Self" strategy to get around this.

I don't know that I'll have the time to finish this PR up any time soon, so @jethrogb if you want to pick this up and run with it, feel free!

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/jethrogb/rust-cexpr/22)
<!-- Reviewable:end -->


Co-authored-by: Jon Gjengset <jon@thesquareplanet.com>
  • Loading branch information
bors[bot] and jonhoo authored Mar 9, 2020
2 parents 23298e5 + b9c14da commit c257faa
Show file tree
Hide file tree
Showing 6 changed files with 543 additions and 459 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cexpr"
version = "0.3.6"
version = "0.4.0"
edition = "2018"
authors = ["Jethro Beekman <jethro@jbeekman.nl>"]
license = "Apache-2.0/MIT"
Expand All @@ -13,7 +13,7 @@ keywords = ["C","expression","parser"]
travis-ci = { repository = "jethrogb/rust-cexpr" }

[dependencies]
nom = {version = "^4", features = ["verbose-errors"] }
nom = "5"

[dev-dependencies]
clang-sys = ">= 0.13.0, < 0.29.0"
Loading

0 comments on commit c257faa

Please sign in to comment.