import { type Parameter } from './types'; export declare const enum OpCode { CONSTANT = 0,// operand: constant pool index NIL = 1,// push null TRUE = 2,// push true FALSE = 3,// push false POP = 4,// discard top of stack DEFINE_GLOBAL = 5,// operand: name index in constants GET_GLOBAL = 6,// operand: name index SET_GLOBAL = 7,// operand: name index GET_LOCAL = 8,// operand: stack slot offset SET_LOCAL = 9,// operand: stack slot offset ADD = 10, SUBTRACT = 11, MULTIPLY = 12, DIVIDE = 13, MODULO = 14, NEGATE = 15,// unary minus EQUAL = 16, NOT_EQUAL = 17, LESS = 18, LESS_EQUAL = 19, GREATER = 20, GREATER_EQUAL = 21, NOT = 22,// unary ! JUMP = 23,// operand: unsigned 16-bit forward offset JUMP_IF_FALSE = 24,// operand: unsigned 16-bit forward offset, pops condition LOOP = 25,// operand: unsigned 16-bit backward offset BUILD_ARRAY = 26,// operand: element count (reads that many from stack) BUILD_OBJECT = 27,// operand: pair count (reads key+value pairs from stack) GET_INDEX = 28,// obj[index] SET_INDEX = 29,// obj[index] = value GET_PROPERTY = 30,// operand: name index obj.prop SET_PROPERTY = 31,// operand: name index obj.prop = value CLOSURE = 32,// operand: constant index (points to a FunctionProto) CALL = 33,// operand: arg count RETURN = 34,// pop return value, restore frame RETURN_VOID = 35,// return null implicitly CALL_BUILTIN = 36,// operand: name index, second operand: arg count CALL_MODEL = 37,// operand: name index (model name), second operand: arg count CALL_IMAGE = 38,// same shape CALL_VIDEO = 39,// same shape PRINT = 40,// operand: arg count (pops N values, prints space-joined) TRY_START = 41,// operands: catchOffset (16-bit), finallyOffset (16-bit) TRY_END = 42, FINALLY_START = 43, FINALLY_END = 44, IMPORT = 45,// operands: source index, names index ALLOW = 46,// operands: source index, binding index INITIALIZE_MEMORY = 47,// operand: name index GET_UPVALUE = 48,// operand: upvalue index SET_UPVALUE = 49,// operand: upvalue index CLOSE_UPVALUE = 50, CONVERT = 51 } export type ConstantValue = string | number | boolean | null | FunctionProto | string[] | any; export interface FunctionProto { kind: 'FunctionProto'; name: string; arity: number; params: Array; chunk: Chunk; isAsync: boolean; upvalues: Array<{ index: number; isLocal: boolean; }>; } export interface Chunk { code: number[]; constants: ConstantValue[]; lines: number[]; } export declare function makeChunk(): Chunk; export declare function addConstant(chunk: Chunk, value: ConstantValue): number; export declare function emitByte(chunk: Chunk, byte: number, line: number): void; export declare function emitBytes(chunk: Chunk, byte1: number, byte2: number, line: number): void; export declare function emit16(chunk: Chunk, opcode: number, operand: number, line: number): void; export declare function emitJump(chunk: Chunk, opcode: OpCode, line: number): number; export declare function patchJump(chunk: Chunk, offset: number): void; export declare function emitLoop(chunk: Chunk, loopStart: number, line: number): void; export declare function read16(code: number[], ip: number): number; export declare function disassemble(chunk: Chunk, name: string): string; //# sourceMappingURL=chunk.d.ts.map