Closed saleyn closed 9 years ago
+1
This is already the case as far as I can tell.
With only one difference - the endmacro keyword has to be written .endmacro - otherwise it looks like a template.
Jonathan
On 11/05/15 06:44, Eric Voskuil wrote:
+1
— Reply to this email directly or view it on GitHub https://github.com/imatix/gsl/issues/97#issuecomment-100697830.
You are right indeed. It's the '.' before endmacro that was throwing things off. Sorry for noise.
It seems to me that it would be very useful to switch between template/script mode automatically depending on the use of function/macro keyword.
Presently the syntax forces you to write:
I propose to make a change so that the use of "macro" keyword in the script mode would automatically switch to template mode in the body of that macro (if not already in the template mode), and vice versa (use of "function" keyword would automatically switch to script mode in the body of the function if not already in the script mode):
I would've submitted a pull request as I thought this was a simple change, but frankly after looking at the source code for 20min, couldn't find a place where the template mode is being set when evaluating the function/macro. :(