Mau.Parser.Tag (mau v0.8.0)

View Source

Tag parsing for the Mau template engine.

Handles parsing of template tags within {% %} blocks:

  • Assignment tags (assign)
  • Conditional tags (if, elsif, else, endif)
  • Loop tags (for, endfor)

Summary

Functions

Assignment tag parsing - {% assign variable = expression %}.

Else tag parsing - {% else %}.

Elsif tag parsing - {% elsif condition %}.

Endfor tag parsing - {% endfor %}.

Endif tag parsing - {% endif %}.

For tag parsing - {% for item in collection %}.

If tag parsing - {% if condition %}.

Functions

assign_tag(basic_identifier, pipe_expression, optional_whitespace, required_whitespace)

Assignment tag parsing - {% assign variable = expression %}.

Requires: basic_identifier, pipe_expression, optional_whitespace, required_whitespace from the main parser context.

else_tag()

Else tag parsing - {% else %}.

elsif_tag(pipe_expression, required_whitespace)

Elsif tag parsing - {% elsif condition %}.

Requires: pipe_expression, required_whitespace from the main parser context.

endfor_tag()

Endfor tag parsing - {% endfor %}.

endif_tag()

Endif tag parsing - {% endif %}.

for_tag(basic_identifier, pipe_expression, required_whitespace)

For tag parsing - {% for item in collection %}.

Requires: basic_identifier, pipe_expression, required_whitespace from the main parser context.

if_tag(pipe_expression, required_whitespace)

If tag parsing - {% if condition %}.

Requires: pipe_expression, required_whitespace from the main parser context.