From b292759bcb4f571acd64d36f1035c20b7fb827e0 Mon Sep 17 00:00:00 2001 From: David Pearce Date: Mon, 4 Nov 2024 14:01:50 +1300 Subject: [PATCH] feat: Allow empty `(begin ..)` (#289) 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), } }