Moves compiler.rs to leo-compiler module

This commit is contained in:
howardwu 2020-04-26 22:37:08 -07:00
parent 026b59a67a
commit d115870815
7 changed files with 9 additions and 6 deletions

1
Cargo.lock generated
View File

@ -651,6 +651,7 @@ version = "0.1.0"
dependencies = [
"from-pest",
"lazy_static",
"log",
"pest",
"pest-ast",
"pest_derive",

View File

@ -13,6 +13,7 @@ snarkos-models = { path = "../../snarkOS/models", version = "0.8.0" }
from-pest = { version = "0.3.1" }
lazy_static = { version = "1.3.0" }
log = { version = "0.4" }
pest = { version = "2.0" }
pest-ast = { version = "0.3.3" }
pest_derive = { version = "2.0" }

View File

@ -1,4 +1,4 @@
use leo_compiler::{self, ast};
use crate::{ast, Program, ResolvedProgram};
use snarkos_errors::gadgets::SynthesisError;
use snarkos_models::{
@ -40,11 +40,11 @@ impl<F: Field + PrimeField> ConstraintSynthesizer<F> for Compiler<F> {
let syntax_tree = ast::File::from_pest(&mut file).expect("infallible");
log::debug!("{:#?}", syntax_tree);
let program = leo_compiler::Program::<'_, F>::from(syntax_tree);
let program = Program::<'_, F>::from(syntax_tree);
log::info!(" compiled: {:#?}", program);
let program = program.name("simple".into());
leo_compiler::ResolvedProgram::generate_constraints(cs, program);
ResolvedProgram::generate_constraints(cs, program);
Ok(())
}

View File

@ -10,6 +10,8 @@ extern crate pest_derive;
pub mod ast;
pub mod compiler;
pub mod constraints;
pub use self::constraints::*;

View File

@ -1,9 +1,9 @@
use crate::{cli::*, cli_types::*};
use crate::compiler::Compiler;
use crate::directories::{OutputsDirectory, source::SOURCE_DIRECTORY_NAME};
use crate::errors::{CLIError, BuildError};
use crate::files::{MainFile, MAIN_FILE_NAME};
use crate::manifest::Manifest;
use leo_compiler::compiler::Compiler;
use snarkos_curves::bls12_377::Fr;

View File

@ -1,7 +1,7 @@
use crate::{cli::*, cli_types::*};
use crate::commands::BuildCommand;
use crate::compiler::Compiler;
use crate::errors::CLIError;
use leo_compiler::compiler::Compiler;
use snarkos_algorithms::snark::{generate_random_parameters, prepare_verifying_key, Parameters, PreparedVerifyingKey};
use snarkos_curves::bls12_377::{Bls12_377, Fr};

View File

@ -5,7 +5,6 @@ extern crate failure;
pub mod cli;
pub mod cli_types;
pub mod commands;
pub mod compiler;
pub mod directories;
pub mod errors;
pub mod files;