[lang] reintroduce the old ABI generation

We keep this in ink! until the new ABI format support is stable enough.
parent ecd609d5
......@@ -52,3 +52,6 @@ test-env = [
"std",
"ink_model/test-env",
]
ink-generate-abi = [
"std",
]
......@@ -17,6 +17,8 @@
use proc_macro2::TokenStream as TokenStream2;
use syn::Result;
#[cfg(feature = "ink-generate-abi")]
use crate::old_abi;
use crate::{
gen,
hir,
......@@ -33,6 +35,8 @@ pub fn generate(input: TokenStream2) -> TokenStream2 {
pub fn generate_or_err(input: TokenStream2) -> Result<TokenStream2> {
let ast_contract = parser::parse_contract(input.clone())?;
let hir_contract = hir::Contract::from_ast(&ast_contract)?;
#[cfg(feature = "ink-generate-abi")]
old_abi::generate_old_abi(&hir_contract)?;
let tokens = gen::generate_code(&hir_contract);
Ok(tokens)
}
......@@ -27,6 +27,9 @@ mod hir;
mod ident_ext;
mod parser;
#[cfg(feature = "ink-generate-abi")]
mod old_abi;
#[cfg(test)]
mod tests;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment