calcium-js
Version:
Calcium runtime on JavaScript
29 lines • 806 B
JavaScript
export class Address {
constructor(indent, index, calls = 0, fileName = 'main') {
this.indent = indent;
this.index = index;
this.calls = calls;
this.fileName = fileName;
}
clone() {
return new Address(this.indent, this.index, this.calls, this.fileName);
}
isLocatedAt(addr) {
return (addr.indent === this.indent &&
addr.index === this.index &&
addr.calls === this.calls &&
addr.fileName === this.fileName);
}
jump(to) {
this.indent = to.indent;
this.index = to.index;
this.fileName = to.fileName;
}
shift(deltaIndent) {
this.indent += deltaIndent;
}
step(deltaIndex) {
this.index += deltaIndex;
}
}
//# sourceMappingURL=address.js.map