-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macros within comments are executed #23
Comments
Thanks for your report. But, as you mentioned, parser which doesn't use syntax tree is not appropriate to make complex template engine. So, I will try implementing own parser which uses syntax tree(and then, I think I should release it as v1.0.0). This change must take a lot of time, but I believe it’s necessary to make OteraEngine.jl practical. |
Okay sounds great! I guess the argument against is simplicity. As long as there is a good correspondence between the template language and Julia then lex+rewrite works just fine. On the other hand it could well be useful for some cases beyond nested comments like certain custom tags or something. Good luck either way. |
Now, v0.4.1 is available. But please note that this patch slows down the speed. |
Great! |
Thanks for the update! I think it is very close to working for my purposes, but I still have one more round of nits.
If I write something like the following:
Then currently the macros will be expanded first, which will mean my_macro is executed. This could cause problems, e.g. if
my_macro
isn't defined ormy_macro
contains an infinite loop or some bad side-effect.I guess possibly applying comments before macros would help.
P.S. You will probably not be able to implement nested comments without actually parsing into a tree, but these are a bit unusual. I thought I would just note this since Julia itself does support nested comments and I think that might be a point at which the "lex and rewrite" approach might break down.
The text was updated successfully, but these errors were encountered: