How to use the @phensley/cldr-ext-rbnf/lib/rbnftypes.Opcode.UNCHANGED_RULE function in @phensley/cldr-ext-rbnf

To help you get started, we’ve selected a few @phensley/cldr-ext-rbnf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phensley / cldr-engine / packages / cldr-compiler / src / rbnf / encoder.ts View on Github external
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];