const moo = require('moo')
const IndentationLexer = require('moo-indentation-lexer')
const mooLexer = moo.compile({ ... })
const lexer = new IndentationLexer({ lexer: mooLexer })
lexer.reset('...')
lexer.next()
const mooLexer = moo.compile({
WS: /[ \t]+/,
comment: /\/\/.*?$/,
...,
NL: { match: /\n/, lineBreaks: true }
})
const lexer = new IndentationLexer({
lexer: mooLexer,
indentationType: 'WS',
newlineType: 'NL',
commentType: 'comment',
indentName: 'indent',
dedentName: 'dedent',
enclosingPunctuations: { '[': ']', '<': '>' },
separators: [',']
})