Skip to content

Commit

Permalink
Merge pull request #13 from mbrubeck/out
Browse files Browse the repository at this point in the history
Place generated files in `$OUT_DIR`
  • Loading branch information
sgodwincs committed Mar 14, 2018
2 parents bbc17f3 + d9695b2 commit 57f85d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -10,7 +10,7 @@ name = "webidl"
readme = "README.md"
repository = "https://github.com/sgodwincs/webidl-rs"
version = "0.5.0"
exclude = ["tests/*.zip", "src/parser/grammar.rs"]
exclude = ["tests/*.zip"]

[build-dependencies]
lalrpop = "^0.14"
Expand Down
5 changes: 4 additions & 1 deletion build.rs
Expand Up @@ -2,5 +2,8 @@ extern crate lalrpop;

fn main() {
println!("cargo:rerun-if-changed=src/parser/grammar.lalrpop");
lalrpop::process_root().unwrap();
lalrpop::Configuration::new()
.use_cargo_dir_conventions()
.process()
.unwrap();
}
4 changes: 3 additions & 1 deletion src/parser/mod.rs
@@ -1,7 +1,9 @@
#[cfg_attr(rustfmt, rustfmt_skip)]
#[allow(unknown_lints)]
#[allow(clippy)]
mod grammar;
mod grammar {
include!(concat!(env!("OUT_DIR"), "/parser/grammar.rs"));
}

/// Contains all structures related to the AST for the WebIDL grammar.
pub mod ast;
Expand Down

0 comments on commit 57f85d3

Please sign in to comment.