x_component v0.1.0 X.Tokenizer View Source

X template tokenizer module.

Link to this section Summary

Functions

Parses given string or charlist into X template tokens. See X.Ast for tokens type definition.

Link to this section Functions

Parses given string or charlist into X template tokens. See X.Ast for tokens type definition.

Example

iex> X.Tokenizer.call("<div><span class='test'>{{ a }}</span></div>")
[
  {:tag_start, {1, 1}, 'div', [], nil, nil, false, false, false},
  {:tag_start, {6, 1}, 'span', [{:tag_attr, {12, 1}, 'class', 'test', false}],
   nil, nil, false, false, false},
  {:tag_output, {25, 1}, 'a ', true},
  {:tag_end, {32, 1}, 'span'},
  {:tag_end, {39, 1}, 'div'}
]