Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private encodeNode(node: RBNFNode, symbols: string[]): any {
switch (node.kind) {
case 'literal': {
const i = symbols.indexOf(node.n);
return [Opcode.LITERAL, i];
}
case 'apply-left-rule': {
const i = this.ruleindex(node.n);
return [Opcode.APPLY_LEFT_RULE, i];
}
case 'apply-left-numfmt': {
const i = this.index.get(node.n);
return [Opcode.APPLY_LEFT_NUM_FORMAT, i];
}
case 'apply-left-2-rule': {
const i = this.ruleindex(node.n);
return [Opcode.APPLY_LEFT_2_RULE, i];
}