1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

Fix wrong assertion of program args

This commit is contained in:
Dennis Kuhnert 2017-01-30 10:54:26 +01:00
parent f132c9fbea
commit 016e5e1caa
2 changed files with 2 additions and 3 deletions

View file

@ -8,7 +8,6 @@ fn main() {
.include("lib/libsnark/include/libsnark")
.flag("-std=c++11")
.define("CURVE_BN128", None)
// .define("DEBUG", None)
.file("lib/wraplibsnark.cpp")
.compile("libwraplibsnark.a");
}

View file

@ -71,7 +71,7 @@ fn parse_program(file: File) -> Prog {
};
break;
},
Some(Ok(ref x)) if x.starts_with("//") || x == "" => {},
Some(Ok(ref x)) if x.trim().starts_with("//") || x == "" => {},
None => panic!("End of file reached without function def"),
Some(x) => panic!("Found '{:?}' outside of function", x),
}
@ -343,7 +343,7 @@ fn r1cs_program(prog: &Prog) -> (Vec<String>, Vec<Vec<(usize, i32)>>, Vec<Vec<(u
fn main() {
let args: Vec<_> = std::env::args().collect();
assert!(args.len() == 2|3);
assert!(args.len() == 2 || args.len() == 3);
let path = Path::new(&args[1]);
let file = match File::open(&path) {