LibJudge.Tokenizer (lib_judge v0.4.0) View Source

Tokenizer for the MTG Comprehensive Rules

Link to this section Summary

Link to this section Types

Specs

contents() :: {:contents, [rule() | String.t()]}

Specs

effective_date() :: {:effective_date, Date.t()}

Specs

glossary() :: {:glossary, [glossary_item()]}

Specs

glossary_item() :: {name :: String.t(), definition :: String.t()}

Specs

intro() :: {:intro, String.t()}

Specs

rule() ::
  {:rule,
   {type :: LibJudge.Rule.rule_type(), rule :: LibJudge.Rule.t(),
    body :: String.t(), examples :: [String.t()]}}

Specs

title() :: {:title, String.t()}

Specs

token() ::
  title() | effective_date() | intro() | contents() | rule() | glossary()

Specs

token_type() ::
  :title | :effective_date | :intro | :contents | :rule | :glossary

Link to this section Functions

Specs

tokenize(binary()) :: [token()]