LexLuthor.Runner (lex_luthor v0.1.2) View Source

This module runs a Lexer module against an input string.

You don't use it directly as YourModule.lex/1 is defined on your module when you use LexLuthor.

Link to this section Summary

Functions

Process a string against a given Lexer module and rules.

Link to this section Functions

Link to this function

lex(module, rules, string)

View Source

Specs

lex(atom(), [{atom(), Regex.t(), String.t()}], String.t()) ::
  {:ok, non_neg_integer()}

Process a string against a given Lexer module and rules.

  • module the module in which the lexer is defined.
  • rules an array of rules to apply to the input string.
  • string the input string to be lexed.