hughperkins / Jinja2CppLight

(very) lightweight version of Jinja2 for C++
Mozilla Public License 2.0
145 stars 23 forks source link

if partial support #6

Closed mjfryc closed 7 years ago

mjfryc commented 7 years ago

I've added support for checking whether variable exists or not. It allows to create following conditions:

abc{% if True %}def{% endif %}ghi
abc{% if False %}def{% endif %}ghi
abc{% if not True %}def{% endif %}ghi
abc{% if not False %}def{% endif %}ghi
abc{% if its %}def{% endif %}ghi
abc{% if not its %}def{% endif %}ghi

It doesn't allow following syntax (yet): abc{% if its is defined %}def{% endif %}ghi

hughperkins commented 7 years ago

Cool! Sorry, I missed this earlier :-P Wasnt intentional, just somehow I just didnt quite notice it in my email.