x_component v0.1.0 X.Parser View Source

X template parser module.

Link to this section Summary

Functions

Converts given tokens into X template AST.

Link to this section Functions

Converts given tokens into X template AST.

Example

iex> X.Parser.call([
...> {: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'}
...> ])
[
  {{: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},
      [
        {{:text_group, {25, 1}, 'span'},
         [{{:tag_output, {25, 1}, 'a ', true}, []}]}
      ]}
   ]}
]