import * as chinillaclvm_tools_rs from './build/chinillaclvm_tools_rs.js'; import {hexlify, unhexlify} from 'binascii'; export function bytestring(s) { return unhexlify(s); } export function run_program(program, args, symbols, overrides) { let runner = chinillaclvm_tools_rs.create_chinillaclvm_runner(program, args, symbols, overrides); if (runner.error) { console.log(runner.error); return; } var ended = null; do { var result = chinillaclvm_tools_rs.run_step(runner); if (result !== null) { if (result.Final !== undefined) { ended = result.Final; break; } if (result.Failure !== undefined) { ended = result.Failure; break; } } } while (ended === null); let finished = chinillaclvm_tools_rs.final_value(runner); chinillaclvm_tools_rs.remove_chinillaclvm_runner(runner); return finished; };