Eden.Lexer

A module that implements a lexer for the edn format through its only function tokenize/1.

Summary

tokenize(input, opts \\ [location: false])

Takes a string and returns a list of tokens

Functions

tokenize(input, opts \\ [location: false])

Takes a string and returns a list of tokens.

Options:

  • :location - a boolean that determines wether the location information should be included with each token. Columns are one-based and columns are zero-based. The default value for :location is false.

Examples

iex> Eden.Lexer.tokenize("nil")
[%Eden.Lexer.Token{type: nil, value: "nil"}]

iex> Eden.Lexer.tokenize("nil", location: true)
[%Eden.Lexer.Token{location: %{col: 0, line: 1}, type: nil, value: "nil"}]