@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
29 lines (27 loc) • 805 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeferredProgramCounter = void 0;
const ProgramCounter_1 = require("./ProgramCounter");
class DeferredProgramCounter extends ProgramCounter_1.ProgramCounter {
constructor(offset = 0) {
super();
this.offset = offset;
}
plus(offset) {
return new DeferredProgramCounter(this.offset + offset);
}
equals(other) {
return this === other;
}
setPC(pc) {
this.mutablePC = pc;
}
getPC() {
if (this.mutablePC === undefined) {
throw new Error('Unknown PC');
}
return this.mutablePC.getPC() + this.offset;
}
}
exports.DeferredProgramCounter = DeferredProgramCounter;
//# sourceMappingURL=DeferredProgramCounter.js.map