I use the Perl Template Toolkit to create C files. I really want to be able to include #line directives in my C code so that error messages from the C compiler send me to the right place (template file) and not to the wrong place (template output) . However, I do not know how to do this. The only result I got from Google is an unanswered message on the Template Toolkit mailing list.
I can imagine a painful decision, for example, to read the template file myself and add line numbers, but does anyone have a trick or even a reasonable way to get the line numbers of the source file in the Template Toolkit?
user181548
source
share