From 080cc42bb1da09059dbc35049a7ded0649961e0c Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 29 Aug 2022 20:52:56 +0200 Subject: feat: implement async functionality --- macros/src/macro_flag.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 macros/src/macro_flag.rs (limited to 'macros/src/macro_flag.rs') diff --git a/macros/src/macro_flag.rs b/macros/src/macro_flag.rs new file mode 100644 index 0000000..257a059 --- /dev/null +++ b/macros/src/macro_flag.rs @@ -0,0 +1,27 @@ +use syn::parse::{Parse, ParseStream}; +use syn::{Ident, LitBool, Token}; + +#[derive(Debug)] +pub struct MacroFlag +{ + pub flag: Ident, + pub is_on: LitBool, +} + +impl Parse for MacroFlag +{ + fn parse(input: ParseStream) -> syn::Result + { + let input_forked = input.fork(); + + let flag: Ident = input_forked.parse()?; + + input.parse::()?; + + input.parse::()?; + + let is_on: LitBool = input.parse()?; + + Ok(Self { flag, is_on }) + } +} -- cgit v1.2.3-18-g5258