no-context / moo

Optimised tokenizer/lexer generator! 🐄 Uses /y for performance. Moo.
BSD 3-Clause "New" or "Revised" License
817 stars 65 forks source link

moo.keywords is not defined #128

Closed HKalbasi closed 4 years ago

HKalbasi commented 5 years ago

In the readme example,

moo.compile({
      IDEN: {match: /[a-zA-Z]+/, type: moo.keywords({
        KW: ['while', 'if', 'else', 'moo', 'cows'],
      })},
      SPACE: {match: /\s+/, lineBreaks: true},
    })

Is not working, I think it should be replaced with

moo.compile({
      IDEN: {match: /[a-zA-Z]+/, keywords : {
        KW: ['while', 'if', 'else', 'moo', 'cows'],
      }},
      SPACE: {match: /\s+/, lineBreaks: true},
    })
tjvr commented 5 years ago

I think you need to upgrade moo :)