1
0
Fork 0

support #[hdl] on functions -- enables #[hdl] usage in function body

This commit is contained in:
Jacob Lifshay 2024-09-20 18:42:24 -07:00
parent a8c804ef4a
commit ff94dda922
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c
9 changed files with 341 additions and 156 deletions

View file

@ -2,6 +2,7 @@
// See Notices.txt for copyright information
use crate::{
fold::{impl_fold, DoFold},
kw,
module::transform_body::{with_debug_clone_and_fold, Visitor},
Errors, HdlAttr, PairsIterExt,
};
@ -749,7 +750,7 @@ struct HdlMatchParseState<'a> {
impl Visitor<'_> {
pub(crate) fn process_hdl_match(
&mut self,
_hdl_attr: HdlAttr<Nothing>,
_hdl_attr: HdlAttr<Nothing, kw::hdl>,
expr_match: ExprMatch,
) -> Expr {
let span = expr_match.match_token.span();
@ -761,7 +762,7 @@ impl Visitor<'_> {
brace_token: _,
arms,
} = expr_match;
self.require_normal_module(match_token);
self.require_normal_module_or_fn(match_token);
let mut state = HdlMatchParseState {
match_span: span,
errors: &mut self.errors,