view test/parse_args.tema @ 30:54539dff18ca

Allow access to the calling (outer) context. Start parse_args implementation.
author Mikhail Kryshen <mikhail@kryshen.net>
date Fri, 15 May 2009 03:07:16 +0400
parents
children
line source
1 <%define#parse_args
2 <%set:stop <%next_arg\%>%>
3 <%while#
4 <%super#<%has_more_data\%>%>
5 <%and not equal:<%set:name <%super#<%next_arg\%>%>%> <%stop\%>%>
6 <%and super#<%set:arg_<%outer#<%name\%>%> <%next_arg\%>%>%>
7 %>
8 %>
10 <%define#test
11 <%silent parse_args:g%>\
12 *<%arg_a\%>*
13 *<%arg_b\%>*
14 *<%arg_g\%>*
15 **<%data\%>**
16 %>
18 <%test:
19 a 1
20 b 2
21 g 3 4 5 6
22 %>