#![feature(core_intrinsics)]
#![feature(proc_macro_span)]
#![feature(proc_macro_def_site)]
#[warn(unused_imports)]
#[macro_use]
extern crate singlemap;
extern crate proc_macro;
extern crate proc_macro2;
extern crate once_cell;
extern crate pest;
extern crate quote;
#[macro_use]
extern crate pest_derive;
extern crate autopath;
use proc_macro::TokenStream;
mod com;
use com::component_scan;
use crate::com::{scan_path_utils, path_utils};
#[allow(warnings)]
#[proc_macro_attribute]
pub fn autowired(_attr: TokenStream, _input: TokenStream) -> TokenStream {
return com::autowired::impl_autowired(_attr, _input.clone());
}
#[allow(warnings)]
#[proc_macro_attribute]
pub fn bean(_attr: TokenStream, _input: TokenStream) -> TokenStream {
return _input;
}
#[proc_macro_attribute]
pub fn component_scan(_attr: TokenStream, _input: TokenStream) -> TokenStream {
let ast_path = path_utils::get_caller_path();
println!("ast_path:{}",ast_path);
if ast_path.is_empty(){
return _input;
}
component_scan::impl_component_scan(&_attr,&_input,&ast_path)
}
#[proc_macro_attribute]
pub fn aop(_attr: TokenStream, _input: TokenStream) -> TokenStream {
return com::aop::impl_aop(&_attr,&_input);
}
#[proc_macro_attribute]
pub fn starter_scan(_attr: TokenStream, _input: TokenStream) -> TokenStream {
let ast_path = path_utils::get_caller_path();
println!("ast_path:{}",ast_path);
return com::starter_scan::impl_starter_scan(&_attr,&_input,&ast_path);
}