mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-11 20:20:00 +00:00
added first draft for lib-crates for test_random and test_random_derive (lighthouse-246)
This commit is contained in:
15
eth2/utils/test_random_derive/Cargo.toml
Normal file
15
eth2/utils/test_random_derive/Cargo.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "test_random_derive"
|
||||
version = "0.1.0"
|
||||
authors = ["thojest <thojest@gmail.com>"]
|
||||
edition = "2018"
|
||||
description = "Procedural derive macros for implementation of TestRandom trait"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
syn = "0.15"
|
||||
quote = "0.6"
|
||||
test_random = {path = "../test_random"}
|
||||
|
||||
15
eth2/utils/test_random_derive/src/lib.rs
Normal file
15
eth2/utils/test_random_derive/src/lib.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
extern crate proc_macro;
|
||||
|
||||
use crate::proc_macro::TokenStream;
|
||||
use quote::quote;
|
||||
use syn;
|
||||
use syn::DeriveInput;
|
||||
|
||||
#[proc_macro_derive(TestRandom)]
|
||||
pub fn test_random_derive(input: TokenStream) -> TokenStream {
|
||||
let ast = syn::parse(input).unwrap();
|
||||
|
||||
impl_test_random(&ast)
|
||||
}
|
||||
|
||||
fn impl_test_random(ast: &DeriveInput) -> TokenStream {}
|
||||
Reference in New Issue
Block a user