You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: parser/build.rs
+30-20
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,39 @@ use std::path::{Path, PathBuf};
5
5
use tiny_keccak::{Hasher,Sha3};
6
6
7
7
fnmain() -> anyhow::Result<()>{
8
-
constSOURCE:&str = "python.lalrpop";
9
8
let out_dir = PathBuf::from(std::env::var_os("OUT_DIR").unwrap());
9
+
gen_phf(&out_dir);
10
10
11
+
constSOURCE:&str = "src/python.lalrpop";
11
12
println!("cargo:rerun-if-changed={SOURCE}");
12
13
13
-
try_lalrpop(SOURCE,&out_dir.join("python.rs"))?;
14
-
gen_phf(&out_dir);
14
+
let target;
15
+
let error;
16
+
17
+
#[cfg(feature = "lalrpop")]
18
+
{
19
+
target = out_dir.join("src/python.rs");
20
+
}
21
+
#[cfg(not(feature = "lalrpop"))]
22
+
{
23
+
target = PathBuf::from("src/python.rs");
24
+
error = "python.lalrpop and src/python.rs doesn't match. This is a rustpython-parser bug. Please report it unless you are editing rustpython-parser. Run `lalrpop src/python.lalrpop` to build parser again.";
0 commit comments