diff options
author | 2023-01-03 07:51:35 +0100 | |
---|---|---|
committer | 2023-03-01 00:31:04 +0100 | |
commit | d7ed7a8b9f78344f6855fa1c2655ae0d85e44068 (patch) | |
tree | a5888257f8047b3ba67e143aa5104c1f496ad036 /macros/src/syntax.rs | |
parent | 9829d0ac07180967208403610bc9a25249b9fe85 (diff) | |
download | rtic-d7ed7a8b9f78344f6855fa1c2655ae0d85e44068.tar.gz rtic-d7ed7a8b9f78344f6855fa1c2655ae0d85e44068.tar.zst rtic-d7ed7a8b9f78344f6855fa1c2655ae0d85e44068.zip |
syntax: Remove parse settings struct
Diffstat (limited to 'macros/src/syntax.rs')
-rw-r--r-- | macros/src/syntax.rs | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/macros/src/syntax.rs b/macros/src/syntax.rs index 09b2ab3d..d6f5a476 100644 --- a/macros/src/syntax.rs +++ b/macros/src/syntax.rs @@ -13,7 +13,6 @@ mod accessors; pub mod analyze; pub mod ast; mod check; -mod optimize; mod parse; /// An ordered map keyed by identifier @@ -31,10 +30,10 @@ pub enum Context<'a> { /// The `init`-ialization function Init, - /// A software task: `#[task]` + /// A async software task SoftwareTask(&'a Ident), - /// A hardware task: `#[exception]` or `#[interrupt]` + /// A hardware task HardwareTask(&'a Ident), } @@ -93,36 +92,21 @@ impl<'a> Context<'a> { } } -/// Parser and optimizer configuration -#[derive(Default)] -#[non_exhaustive] -pub struct Settings { - /// Whether to accept the `binds` argument in `#[task]` or not - pub parse_binds: bool, - /// Whether to parse `extern` interrupts (functions) or not - pub parse_extern_interrupt: bool, - /// Whether to "compress" priorities or not - pub optimize_priorities: bool, -} - /// Parses the input of the `#[app]` attribute pub fn parse( args: TokenStream, input: TokenStream, - settings: Settings, ) -> Result<(ast::App, analyze::Analysis), syn::parse::Error> { - parse2(args.into(), input.into(), settings) + parse2(args.into(), input.into()) } /// `proc_macro2::TokenStream` version of `parse` pub fn parse2( args: TokenStream2, input: TokenStream2, - settings: Settings, ) -> Result<(ast::App, analyze::Analysis), syn::parse::Error> { - let mut app = parse::app(args, input, &settings)?; + let app = parse::app(args, input)?; check::app(&app)?; - optimize::app(&mut app, &settings); match analyze::app(&app) { Err(e) => Err(e), |