Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return [Opcode.APPLY_LEFT_2_NUM_FORMAT, i];
}
case 'apply-right-rule': {
const i = this.ruleindex(node.n);
return [Opcode.APPLY_RIGHT_RULE, i];
}
case 'apply-right-numfmt': {
const i = symbols.indexOf(node.n);
return [Opcode.APPLY_RIGHT_NUM_FORMAT, i];
}
case 'apply-unch-rule': {
const i = this.ruleindex(node.n);
return [Opcode.UNCHANGED_RULE, i];
}
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];