Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whoops, I don't think a test feature flag exists #895

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 4 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

Before doing anything else, run `cargo build -p lalrpop`!

From now on use `cargo compile/test -p lalrpop --features=test` instead of
`cargo build -p lalrpop`.

Just before your final commit, run `sh update_lrgrammar.sh`
When making changes the alter the generated code, use `sh update_lrgrammar.sh`
to pass the `verify_lalrpop_generates_itself` test.


### Contributor's "How to"
Expand Down Expand Up @@ -37,20 +35,8 @@ generate your own `lrgrammar.rs` parser. That's how you do it:
$ cargo build -p lalrpop # --release
```

Now you need to tell cargo that you're using `lalrpop/src/parser/lrgrammar.lalrpop` to generate
a new `lrgrammar.rs` inside `{CARGO_OUT_DIR}` and use it for the compilation:

```sh
$ cargo build/test -p lalrpop --features=test
# or
$ cargo build/test -p lalrpop --all-features
```

When this flag is passed, cargo uses not `lalrpop/src/parser/lrgrammar.rs` but the newly generated
`lrgrammar.rs` instead (generating it if needed). From now on you use this command.

Once you're done with your work, all the tests are passed, and you are ready to finally commit
you changes run
Once you're done with your work, make sure that you are running against an
updated version of the grammar.
dburgener marked this conversation as resolved.
Show resolved Hide resolved

```sh
$ sh update_lrgrammar.sh
Expand Down
62 changes: 0 additions & 62 deletions lalrpop/build.rs

This file was deleted.

9 changes: 0 additions & 9 deletions lalrpop/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,11 @@ use crate::grammar::parse_tree::*;
use crate::grammar::pattern::*;
use crate::tok;

#[cfg(not(feature = "test"))]
#[rustfmt::skip]
#[allow(dead_code)]
#[allow(clippy::all)]
mod lrgrammar;

#[cfg(feature = "test")]
lalrpop_mod!(
#[rustfmt::skip]
#[allow(dead_code)]
#[allow(clippy::all)]
lrgrammar,
"/src/parser/lrgrammar.rs"
);

#[cfg(test)]
mod test;
Expand Down