Closed ltratt closed 6 years ago
Before I look at the code, I can't build this branch:
$ git branch
* compile_time_builder
master
$ cargo build
Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to select a version for `cfgrammar`.
... required by package `lrpar v0.1.0 (file:///home/snim2/Desktop/working/softdev/lrpar)`
versions that meet the requirements `= 0.1.0` are: 0.1.0
the package `lrpar` depends on `cfgrammar`, with features: `serde` but `cfgrammar` does not have these features.
Have you done cargo update
?
Ah, oops!
There's a separate travis error. Let me fix that in case you'll also bump into it after the cargo update
.
That test failure happened because Rust thinks you have a test in a doc comment BTW
Fixed (hopefully).
OK, I think you have actioned everything, so please squash. Also, I think it would be worth raising a quick clippy PR on this repo.
Squashed.
This is similar in use to the compile-time system for lrlex, though the implementation details are very different. For simplicity, we use serde to serialize the grammar, state graph, and state table at compile-time, loading them back in later.
There is one major missing feature which is that there is no way to get NDIdxs. We don't currently provide access to the Grammar struct, nor do we provide compile-time constants. I need to think more about how to do this, possibly changing the way that NTIdx is defined in cfgrammar. However, that can be done later: the bare bones here are, I think, sufficient to see clearly the direction of travel.