mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-18 15:31:32 +03:00
fix syntax tests
This commit is contained in:
parent
6eb9ef41c3
commit
e62a2a066a
@ -154,7 +154,14 @@ impl<F: Field + PrimeField, G: GroupType<F>> Compiler<F, G> {
|
||||
self,
|
||||
cs: &mut CS,
|
||||
) -> Result<OutputBytes, CompilerError> {
|
||||
generate_constraints::<_, G, _>(cs, self.program, self.program_inputs, &self.imported_programs)
|
||||
let path = self.main_file_path;
|
||||
generate_constraints::<_, G, _>(cs, self.program, self.program_inputs, &self.imported_programs).map_err(
|
||||
|mut error| {
|
||||
error.set_path(path);
|
||||
|
||||
error
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
pub fn to_bytes(&self) -> Result<Vec<u8>, CompilerError> {
|
||||
|
@ -11,7 +11,7 @@ pub mod integers;
|
||||
pub mod macros;
|
||||
pub mod mutability;
|
||||
pub mod statements;
|
||||
// pub mod syntax;
|
||||
pub mod syntax;
|
||||
|
||||
use leo_compiler::{
|
||||
compiler::Compiler,
|
||||
@ -66,14 +66,14 @@ pub(crate) fn parse_program(bytes: &[u8]) -> Result<EdwardsTestCompiler, Compile
|
||||
Ok(compiler)
|
||||
}
|
||||
|
||||
// pub(crate) fn parse_inputs(bytes: &[u8]) -> Result<EdwardsTestCompiler, CompilerError> {
|
||||
// let mut compiler = new_compiler();
|
||||
// let inputs_string = String::from_utf8_lossy(bytes);
|
||||
//
|
||||
// compiler.parse_inputs(&inputs_string, "")?;
|
||||
//
|
||||
// Ok(compiler)
|
||||
// }
|
||||
pub(crate) fn parse_inputs(bytes: &[u8]) -> Result<EdwardsTestCompiler, CompilerError> {
|
||||
let mut compiler = new_compiler();
|
||||
let inputs_string = String::from_utf8_lossy(bytes);
|
||||
|
||||
compiler.parse_inputs(&inputs_string, "")?;
|
||||
|
||||
Ok(compiler)
|
||||
}
|
||||
|
||||
pub(crate) fn get_outputs(program: EdwardsTestCompiler) -> OutputBytes {
|
||||
// synthesize the circuit on the test constraint system
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::{get_error, parse_inputs, parse_program};
|
||||
use crate::{expect_compiler_error, parse_inputs, parse_program};
|
||||
use leo_ast::ParserError;
|
||||
use leo_compiler::errors::{CompilerError, ExpressionError, FunctionError, StatementError};
|
||||
use leo_inputs::InputParserError;
|
||||
@ -19,7 +19,7 @@ fn test_undefined() {
|
||||
let bytes = include_bytes!("undefined.leo");
|
||||
let program = parse_program(bytes).unwrap();
|
||||
|
||||
let error = get_error(program);
|
||||
let error = expect_compiler_error(program);
|
||||
|
||||
match error {
|
||||
CompilerError::FunctionError(FunctionError::StatementError(StatementError::ExpressionError(
|
||||
|
Loading…
Reference in New Issue
Block a user