Skip to content

Commit 0fb031f

Browse files
committed
pass control scope externs to apply block action calls
1 parent e476706 commit 0fb031f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

codegen/rust/src/statement.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,16 @@ impl<'a> StatementGenerator<'a> {
347347
args.push(quote! { #arg });
348348
}
349349

350+
// pass externs instantiated at control scope to actions
351+
for x in &control.variables {
352+
if let Type::UserDefined(typename) = &x.ty {
353+
if self.ast.get_extern(typename).is_some() {
354+
let arg = format_ident!("{}", x.name);
355+
args.push(quote! { & #arg });
356+
}
357+
}
358+
}
359+
350360
tokens.extend(quote! {
351361
#(#lvref).*(#(#args),*);
352362
})

0 commit comments

Comments
 (0)