|
Tomas wrote:
BTW, I wonder why they dropped the original idea of CGILua of having Lua values in <> free markers, so they appear in the static previsualization of the template page, whilst Lua expressions were in <> markers, hidden from user?I didn't understand your point here. The old version had a strange marker ($|...|$) HTML editors don't understand by default. The other markers were always between HTML comments (<!-- ... -->), but they're not Lua (<!--$$ LOOP start='...' test='...' action='...' $$-->). The new preprocessor is more compatible with XML and translates the code to a string. There are not new constructors: everything should be done with pure Lua. Don't you think it's a better way?
Yes, indeed. I just liked the idea of being able to drop the template on a browser window and see an approximation of what it will look like, without preprocessing (where are the variables within tables, for example, etc.). Now, I played a bit with the concept, and it doesn't work so nice :-( so I bet your approach is the best, the reason you give above are good. I believe I took the idea of building a Lua program out of the template from your code (and perhaps Aranha's). Hard to say exactly, between the code I read, the code I understood, the code I dreamed, the post-processing of this all in my head...
Anyway, I started to do my own template engine, trying to take good ideas fromWe would like to hear suggestions and critics!
Of course, if time allows. I only took a look at your code, and hadn't time to test it for real. I should give it a test, to see if it is robust against some pitfalls I see :-) Perhaps my idea of doing a pure C processor is stupid and indeed doing it in Lua is better. I am still uncomfortable with RegEx (will that match that and not that?). And perhaps your code is too "simple" and nice and I feel the need to do things the complex way... :-P
No promises here, but thanks for your time and kindness. -- --=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=-- Philippe Lhoste (Paris -- France) Professional programmer and amateur artist http://jove.prohosting.com/~philho/ (outdated) http://philho.multimania.com (in French, for files to download) --=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--