aboutsummaryrefslogtreecommitdiff
path: root/rtic-macros/src/syntax/parse/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rtic-macros/src/syntax/parse/app.rs')
-rw-r--r--rtic-macros/src/syntax/parse/app.rs25
1 files changed, 18 insertions, 7 deletions
diff --git a/rtic-macros/src/syntax/parse/app.rs b/rtic-macros/src/syntax/parse/app.rs
index d75c8c6..efcafbe 100644
--- a/rtic-macros/src/syntax/parse/app.rs
+++ b/rtic-macros/src/syntax/parse/app.rs
@@ -198,7 +198,9 @@ impl App {
.iter()
.position(|attr| util::attr_eq(attr, "init"))
{
- let args = InitArgs::parse(item.attrs.remove(pos).tokens)?;
+ let args = InitArgs::parse(
+ item.attrs.remove(pos).parse_args().unwrap_or_default(),
+ )?;
// If an init function already exists, error
if init.is_some() {
@@ -216,7 +218,9 @@ impl App {
.iter()
.position(|attr| util::attr_eq(attr, "idle"))
{
- let args = IdleArgs::parse(item.attrs.remove(pos).tokens)?;
+ let args = IdleArgs::parse(
+ item.attrs.remove(pos).parse_args().unwrap_or_default(),
+ )?;
// If an idle function already exists, error
if idle.is_some() {
@@ -243,7 +247,9 @@ impl App {
));
}
- match syntax_parse::task_args(item.attrs.remove(pos).tokens)? {
+ match syntax_parse::task_args(
+ item.attrs.remove(pos).parse_args().unwrap_or_default(),
+ )? {
Either::Left(args) => {
check_binding(&args.binds)?;
check_ident(&item.sig.ident)?;
@@ -369,8 +375,9 @@ impl App {
.iter()
.position(|attr| util::attr_eq(attr, "init"))
{
- let args = InitArgs::parse(item.attrs.remove(pos).tokens)?;
-
+ let args = InitArgs::parse(
+ item.attrs.remove(pos).parse_args().unwrap_or_default(),
+ )?;
// If an init function already exists, error
if init.is_some() {
return Err(parse::Error::new(
@@ -387,7 +394,9 @@ impl App {
.iter()
.position(|attr| util::attr_eq(attr, "idle"))
{
- let args = IdleArgs::parse(item.attrs.remove(pos).tokens)?;
+ let args = IdleArgs::parse(
+ item.attrs.remove(pos).parse_args().unwrap_or_default(),
+ )?;
// If an idle function already exists, error
if idle.is_some() {
@@ -421,7 +430,9 @@ impl App {
));
}
- match syntax_parse::task_args(item.attrs.remove(pos).tokens)? {
+ match syntax_parse::task_args(
+ item.attrs.remove(pos).parse_args().unwrap_or_default(),
+ )? {
Either::Left(args) => {
check_binding(&args.binds)?;
check_ident(&item.sig.ident)?;