Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
fca624550f | |||
b5b12171e1 |
3 changed files with 32 additions and 2 deletions
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
## Upcoming Changes
|
## Upcoming Changes
|
||||||
|
|
||||||
|
## Version 1.7
|
||||||
|
|
||||||
|
Fix usage of indexing in `IF`.
|
||||||
|
Note this is used like `{{{!IF SomeVar[2]==true}}}`.
|
||||||
|
|
||||||
## Version 1.6
|
## Version 1.6
|
||||||
|
|
||||||
Fix usage of `IF` with a `FOREACH` variable when the `IF` is nested in the
|
Fix usage of `IF` with a `FOREACH` variable when the `IF` is nested in the
|
||||||
|
|
|
@ -36,6 +36,29 @@ HTML='''
|
||||||
{{{!ENDIF}}}
|
{{{!ENDIF}}}
|
||||||
{{{!ENDFOREACH}}}
|
{{{!ENDFOREACH}}}
|
||||||
|
|
||||||
|
Again with IFs:<br>
|
||||||
|
|
||||||
|
{{{!IF EachIfTest_Array[0]==true}}}
|
||||||
|
EachIfTest_Array entry is <b>true</b>. <br>
|
||||||
|
{{{!ELSE}}}
|
||||||
|
EachIfTest_Array entry is <b>false</b>. <br>
|
||||||
|
{{{!ENDIF}}}
|
||||||
|
{{{!IF EachIfTest_Array[1]==true}}}
|
||||||
|
EachIfTest_Array entry is <b>true</b>. <br>
|
||||||
|
{{{!ELSE}}}
|
||||||
|
EachIfTest_Array entry is <b>false</b>. <br>
|
||||||
|
{{{!ENDIF}}}
|
||||||
|
{{{!IF EachIfTest_Array[2]==true}}}
|
||||||
|
EachIfTest_Array entry is <b>true</b>. <br>
|
||||||
|
{{{!ELSE}}}
|
||||||
|
EachIfTest_Array entry is <b>false</b>. <br>
|
||||||
|
{{{!ENDIF}}}
|
||||||
|
{{{!IF EachIfTest_Array[3]==true}}}
|
||||||
|
EachIfTest_Array entry is <b>true</b>. <br>
|
||||||
|
{{{!ELSE}}}
|
||||||
|
EachIfTest_Array entry is <b>false</b>. <br>
|
||||||
|
{{{!ENDIF}}}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<h2>Test IF/FOREACH Expr</h2>
|
<h2>Test IF/FOREACH Expr</h2>
|
||||||
|
|
||||||
|
|
|
@ -229,10 +229,12 @@ int c_simple_http_internal_parse_if_expression(
|
||||||
fprintf(stderr, "ERROR No closing \"]\"! %s\n", var);
|
fprintf(stderr, "ERROR No closing \"]\"! %s\n", var);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (
|
} else if (
|
||||||
idx + 1 < var_size && var[idx] == '!' && var[idx + 1] == '=') {
|
idx + 2 < var_size && var[idx + 1] == '!' && var[idx + 2] == '=') {
|
||||||
|
++idx;
|
||||||
break;
|
break;
|
||||||
} else if (
|
} else if (
|
||||||
idx + 1 < var_size && var[idx] == '=' && var[idx + 1] == '=') {
|
idx + 2 < var_size && var[idx + 1] == '=' && var[idx + 2] == '=') {
|
||||||
|
++idx;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "ERROR Invalid expression after \"]\"! %s\n", var);
|
fprintf(stderr, "ERROR Invalid expression after \"]\"! %s\n", var);
|
||||||
|
|
Loading…
Reference in a new issue