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

Place generated files in $OUT_DIR #13

Merged
merged 1 commit into from Mar 14, 2018
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
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"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: That would be nicer with an explanation.

}

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