Given a template input like

int x;
[% FOR I IN (a,b,c) %]
int [% I %];
[% END %]
int y;

in a file "in.c.tmpl", I want to add line numbering to the output, so
that the output file "in.c" looks something like this:

#line 1 "in.c.tmpl"
int x;
#line 4 "in.c"
int a;
int b;
int c;
#line 5 "in.c.tmpl"
int y;

I have been reading the template toolkit documentation such as

http://template-toolkit.org/docs/manual/Internals.html

but cannot see exactly what kinds of steps I would need to take to
implement something like this. Can anyone point me in the right
direction?

_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to