diff --git a/Cargo.lock b/Cargo.lock index cd4110d..299fe8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,6 +51,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + [[package]] name = "ascii-canvas" version = "3.0.0" @@ -347,6 +353,7 @@ checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" name = "lltz" version = "0.1.0" dependencies = [ + "anyhow", "clap", "lalrpop", "lalrpop-util", diff --git a/Cargo.toml b/Cargo.toml index 65dd23b..4dafc43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ build = "build.rs" lalrpop = "0.20.0" [dependencies] +anyhow = "1.0.79" clap = { version = "4.2.7", features = ["derive"] } lalrpop-util = { version = "0.20.0", features = ["lexer", "unicode"] } michelson-ast = { path = "./michelson-ast" } diff --git a/src/michelify.rs b/src/michelify.rs index 673c090..cf36964 100644 --- a/src/michelify.rs +++ b/src/michelify.rs @@ -4,12 +4,11 @@ use crate::mlir::{ ast::{Operation, Value}, dialect::michelson::ast::Type, }; +use anyhow::Result; use michelson_ast; use std::collections::HashMap; -pub fn compile( - smart_contract: Operation, -) -> Result> { +pub fn compile(smart_contract: Operation) -> Result { /* * HashMap that returns the position of a Value on the Michelson Stack as its Key * Note that it returns the relative position in the register area of Value, using a 1-index