UNPKG

@nodescript/core

Version:

Visual programming language for Browser and Node

39 lines 1.2 kB
import { SymTable } from './SymTable.js'; export class CompilerSymbols { constructor() { this.symtable = new SymTable(); } getComputeSym(moduleRef) { return this.symtable.get(`compute:${moduleRef}`); } createComputeSym(moduleRef) { const sym = this.symtable.nextSym('d'); this.symtable.set(`compute:${moduleRef}`, sym); return sym; } getModuleSym(moduleRef) { return this.symtable.get(`module:${moduleRef}`); } createModuleSym(moduleRef) { const sym = this.symtable.nextSym('d'); this.symtable.set(`module:${moduleRef}`, sym); return sym; } getNodeSym(nodeUid, fallback) { return this.symtable.get(`node:${nodeUid}`, fallback); } createNodeSym(nodeUid) { const sym = this.symtable.nextSym('r'); this.symtable.set(`node:${nodeUid}`, sym); return sym; } getLineSym(lineUid) { return this.symtable.get(`prop:${lineUid}`); } createLineSym(lineUid) { const sym = this.symtable.nextSym('p'); this.symtable.set(`prop:${lineUid}`, sym); return sym; } } //# sourceMappingURL=CompilerSymbols.js.map