From dfab15e657d217118dd71a5d9dc80b1b15a31abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 26 Nov 2024 14:14:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E4=BF=AE=E6=94=B9=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ecaCompiler/compiler.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ecaCompiler/compiler.ts b/src/ecaCompiler/compiler.ts index 877ff56..82be383 100644 --- a/src/ecaCompiler/compiler.ts +++ b/src/ecaCompiler/compiler.ts @@ -21,13 +21,14 @@ export class Exp { this.args.push(new Exp(arg)); } if ('op_arg' in json) { - let enables = json.op_arg_enable as boolean[]; - for (let op_arg of json.op_arg as y3.json.JObject[]) { - let enable = enables?.shift(); - if (op_arg === null || enable === false) { + let enables = json.op_arg_enable as boolean[] | undefined; + let op_args = json.op_arg as y3.json.JObject[]; + for (let i = 0; i < op_args.length; i++) { + let enable = enables?.[i]; + if (op_args[i] === null || enable === false) { this.args.push(null); } else { - this.args.push(new Exp(op_arg)); + this.args.push(new Exp(op_args[i])); } } }