view test/parse_args.tema @ 33:b637a4491862

Function data separator could be omitted if the data is empty.
author Mikhail Kryshen <mikhail@kryshen.net>
date Sat, 17 Oct 2009 03:39:07 +0400
parents 54539dff18ca
children
line wrap: on
line source

<%define#parse_args
  <%set:stop <%next_arg\%>%>
  <%while#
    <%super#<%has_more_data\%>%>
    <%and not equal:<%set:name <%super#<%next_arg\%>%>%> <%stop\%>%>
    <%and super#<%set:arg_<%outer#<%name\%>%> <%next_arg\%>%>%>
  %>
%>

<%define#test
  <%silent parse_args:g%>\
  *<%arg_a\%>*
  *<%arg_b\%>*
  *<%arg_g\%>*
  **<%data\%>**
%>

<%test:
  a 1
  b 2
  g 3 4 5 6
%>