@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
48 lines (46 loc) • 1.15 kB
JavaScript
import { ResolvedScope } from './ResolvedScope';
export class CapturingScope {
constructor(node, index, parent) {
this.node = node;
this.index = index;
this.parent = parent;
this.mutableVariableCount = 0;
this.bindings = new Set();
}
add(name) {
this.mutableVariableCount += 1;
this.bindings.add(name);
return { nameBrand: 0 };
}
addUnique() {
this.mutableVariableCount += 1;
return { nameBrand: 0 };
}
set(sb, node) {
sb.emitOp(node, 'NOP');
}
get(sb, node) {
sb.emitOp(node, 'NOP');
}
getThis(sb, node) {
sb.emitOp(node, 'NOP');
}
getGlobal(sb, node) {
sb.emitOp(node, 'NOP');
}
setGlobal(sb, node) {
sb.emitOp(node, 'NOP');
}
pushAll(sb, node) {
sb.emitOp(node, 'NOP');
}
emit(sb, node, options, func) {
sb.emitOp(node, 'NOP');
func(options);
sb.emitOp(node, 'NOP');
}
resolve(parent) {
return new ResolvedScope(this.mutableVariableCount, parent);
}
}
//# sourceMappingURL=CapturingScope.js.map