Package documentation
lexie
1.0.0
lexie
Generate Pooka lexers, source spans and syntax highlighters from TOML.
pooka add lexie --dev
pooka add poke --dev
pooka run -m lexie init
pooka run -m lexie
init creates an ignored .lexie/lexie.toml; running lexie writes the generated Pooka modules. In a project called language, the generated modules need only the standard library:
import language/syntax/lexer
import language/syntax/token
import poke/should
import pooka/list
test "recognises a keyword" {
let tokens = lexer.lex("let") |> list.map(fn(lexeme) { lexeme.token })
should.equal(tokens, [token.Let(), token.End()])
}
See the guide for the specification, and the API documentation for the rest.
Licence
Licensed under the Apache License, Version 2.0.