Package documentation

lexie

1.0.0

By Peregrine Finch

Lexie holding up the letter tiles of her name

lexie

Package Version Hex Docs Tests

Generate Pooka lexers, source spans and syntax highlighters from TOML.

sh
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:

Pooka
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.