remove reset_default from proc-macro, forgot to remove when removing from RegBuilder

This commit is contained in:
Jacob Lifshay 2024-09-22 16:01:23 -07:00
parent bdbc6d89bd
commit 790bb15408
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c
2 changed files with 3 additions and 34 deletions

View file

@ -78,7 +78,6 @@ mod kw {
custom_keyword!(output); custom_keyword!(output);
custom_keyword!(reg_builder); custom_keyword!(reg_builder);
custom_keyword!(reset); custom_keyword!(reset);
custom_keyword!(reset_default);
custom_keyword!(skip); custom_keyword!(skip);
custom_keyword!(target); custom_keyword!(target);
custom_keyword!(wire); custom_keyword!(wire);

View file

@ -265,11 +265,6 @@ pub(crate) enum RegBuilderReset {
paren: Paren, paren: Paren,
init_expr: Box<Expr>, init_expr: Box<Expr>,
}, },
ResetDefault {
dot_token: Token![.],
reset_default: kw::reset_default,
paren: Paren,
},
} }
impl_fold! { impl_fold! {
@ -286,11 +281,6 @@ impl_fold! {
paren: Paren, paren: Paren,
init_expr: Box<Expr>, init_expr: Box<Expr>,
}, },
ResetDefault {
dot_token: Token![.],
reset_default: kw::reset_default,
paren: Paren,
},
} }
} }
@ -312,11 +302,6 @@ impl Parse for RegBuilderReset {
paren: parenthesized!(paren_contents in input), paren: parenthesized!(paren_contents in input),
init_expr: paren_contents.call(parse_single_fn_arg)?, init_expr: paren_contents.call(parse_single_fn_arg)?,
}), }),
RegBuilderMethod::ResetDefault(reset_default) => Ok(Self::ResetDefault {
dot_token,
reset_default,
paren: parenthesized!(paren_contents in input),
}),
} }
} }
} }
@ -344,15 +329,6 @@ impl ToTokens for RegBuilderReset {
reset.to_tokens(tokens); reset.to_tokens(tokens);
paren.surround(tokens, |tokens| init_expr.to_tokens(tokens)); paren.surround(tokens, |tokens| init_expr.to_tokens(tokens));
} }
RegBuilderReset::ResetDefault {
dot_token,
reset_default,
paren,
} => {
dot_token.to_tokens(tokens);
reset_default.to_tokens(tokens);
paren.surround(tokens, |_| {});
}
} }
} }
} }
@ -401,8 +377,6 @@ make_builder_method_enum! {
NoReset(no_reset), NoReset(no_reset),
#[cond = need_reset] #[cond = need_reset]
Reset(reset), Reset(reset),
#[cond = need_reset]
ResetDefault(reset_default),
} }
} }
@ -445,17 +419,13 @@ impl HdlLetKindRegBuilder {
let mut clock_domain = None; let mut clock_domain = None;
match RegBuilderMethod::parse_dot_prefixed(&input.fork(), true, true)?.1 { match RegBuilderMethod::parse_dot_prefixed(&input.fork(), true, true)?.1 {
RegBuilderMethod::ClockDomain(_) => clock_domain = Some(input.parse()?), RegBuilderMethod::ClockDomain(_) => clock_domain = Some(input.parse()?),
RegBuilderMethod::NoReset(_) RegBuilderMethod::NoReset(_) | RegBuilderMethod::Reset(_) => {}
| RegBuilderMethod::Reset(_)
| RegBuilderMethod::ResetDefault(_) => {}
} }
let reset = input.parse()?; let reset = input.parse()?;
if clock_domain.is_none() { if clock_domain.is_none() {
match RegBuilderMethod::parse_dot_prefixed(&input.fork(), true, false)?.1 { match RegBuilderMethod::parse_dot_prefixed(&input.fork(), true, false)?.1 {
RegBuilderMethod::ClockDomain(_) => clock_domain = Some(input.parse()?), RegBuilderMethod::ClockDomain(_) => clock_domain = Some(input.parse()?),
RegBuilderMethod::NoReset(_) RegBuilderMethod::NoReset(_) | RegBuilderMethod::Reset(_) => unreachable!(),
| RegBuilderMethod::Reset(_)
| RegBuilderMethod::ResetDefault(_) => unreachable!(),
} }
} }
Ok(Self { Ok(Self {
@ -1370,7 +1340,7 @@ impl Visitor<'_> {
no_reset.to_tokens(&mut expr); no_reset.to_tokens(&mut expr);
paren.surround(&mut expr, |expr| ty_expr.to_tokens(expr)); paren.surround(&mut expr, |expr| ty_expr.to_tokens(expr));
} }
RegBuilderReset::Reset { .. } | RegBuilderReset::ResetDefault { .. } => { RegBuilderReset::Reset { .. } => {
hdl_let.kind.reset.to_tokens(&mut expr); hdl_let.kind.reset.to_tokens(&mut expr);
} }
} }