@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
25 lines (23 loc) • 617 B
JavaScript
import { ProgramCounter } from './ProgramCounter';
export class DeferredProgramCounter extends 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;
}
}
//# sourceMappingURL=DeferredProgramCounter.js.map