Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
case 'apply-unch-numfmt': {
const i = symbols.indexOf(node.n);
return [Opcode.UNCHANGED_NUM_FORMAT, i];
}
case 'cardinal':
case 'ordinal': {
const block: any[] = [];
for (const n of node.n) {
const cat = PLURALS.indexOf(n.category);
const i = symbols.indexOf(n.n);
block.push([cat, i]);
}
return node.kind === 'cardinal' ? [Opcode.CARDINAL, block] : [Opcode.ORDINAL, block];
}
case 'optional': {
const block = node.n.map(n => this.encodeNode(n, symbols));
return [Opcode.OPTIONAL, block];
}
case 'sub-left':
return [Opcode.SUB_LEFT];
case 'sub-right':
return [Opcode.SUB_RIGHT];
case 'sub-right-3':
return [Opcode.SUB_RIGHT_3];
}