How to use the moo.error function in moo

To help you get started, we’ve selected a few moo 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 tracespace / tracespace / packages / parser / src / lexer / rules.ts View on Github external
match: /(?:[CFSBHZ][\d.]+)+/,
    value: text => {
      const diameterMatch = text.match(/C[\d.]+/)
      return diameterMatch ? diameterMatch[0] : ''
  [Tokens.COORD_CHAR]: /[XYZIJA]/,
  [Tokens.NUMBER]: /(?:[+-])?[\d.]+/,
  [Tokens.WORD]: /[a-zA-Z]+/,
  [Tokens.WHITESPACE]: /[ \t]+/,
  [Tokens.NEWLINE]: {
    match: /\r?\n/,
    lineBreaks: true,
  [Tokens.CATCHALL]: /[\S]/,
  [Tokens.ERROR]: moo.error,


Optimised tokenizer/lexer generator! 🐄 Much performance. Moo!

Latest version published 1 year ago

Package Health Score

74 / 100
Full package analysis