Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
blocks.add('let', (params, _hash, blocks) => {
if (!params) {
return error('let requires arguments', 0, 0);
}
let { count, actions } = CompilePositional(params);
return [actions, invokeStaticBlockWithStack(blocks.get('default')!, count)];
});
ifTrue() {
return invokeStaticBlockWithStack(unwrap(blocks.get('default')), 1);
},
body() {
let out: StatementCompileActions = [
op(Op.PutIterator),
op(Op.JumpUnless, label('ELSE')),
op(MachineOp.PushFrame),
op(Op.Dup, $fp, 1),
op(MachineOp.ReturnTo, label('ITER')),
op(Op.EnterList, label('BODY')),
op('Label', 'ITER'),
op(Op.Iterate, label('BREAK')),
op('Label', 'BODY'),
invokeStaticBlockWithStack(unwrap(blocks.get('default')), 2),
op(Op.Pop, 2),
op(MachineOp.Jump, label('FINALLY')),
op('Label', 'BREAK'),
op(Op.ExitList),
op(MachineOp.PopFrame),
op(MachineOp.Jump, label('FINALLY')),
op('Label', 'ELSE'),
];
if (blocks.has('else')) {
out.push(invokeStaticBlock(blocks.get('else')!));
}
return out;
},
});