From 9ea6b5161489b3457a1e1cbbfd77c10654f2ef7b Mon Sep 17 00:00:00 2001 From: DavePearce Date: Mon, 4 Nov 2024 13:42:22 +1300 Subject: [PATCH] Allow empty `(begin ..)` This adjusts the minimum expected arity for `begin` statements to allow them to be empty. The reason for this is that, in practice, we may have a `begin` statement stuffed only with `debug` constraints (which are physically removed unless the `--debug` switch is provided). --- src/compiler/generator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/generator.rs b/src/compiler/generator.rs index 0aed499..0e555d8 100644 --- a/src/compiler/generator.rs +++ b/src/compiler/generator.rs @@ -251,7 +251,7 @@ impl FuncVerifier for Intrinsic { Intrinsic::Neg => Arity::Monadic, Intrinsic::Inv => Arity::Monadic, Intrinsic::Normalize => Arity::Monadic, - Intrinsic::Begin => Arity::AtLeast(1), + Intrinsic::Begin => Arity::AtLeast(0), Intrinsic::IfZero | Intrinsic::IfNotZero => Arity::Between(2, 3), } }