How to use the @phensley/cldr-ext-rbnf/lib/rbnftypes.Opcode.SUB_RIGHT 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
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];
      }
      throw new Error(`No encoder for node: ${JSON.stringify(node)}`);
  }