Add "filter"
This commit is contained in:
parent
5edcf05d7a
commit
13bb7399aa
@ -370,6 +370,23 @@ char* compile(tSyntaxElement* syntaxtree) {
|
|||||||
|
|
||||||
compile_exit_tag(&result);
|
compile_exit_tag(&result);
|
||||||
|
|
||||||
|
} else if (strcmp(token->content.string, "filter") == 0) {
|
||||||
|
|
||||||
|
compile_enter_tag(&result);
|
||||||
|
|
||||||
|
string_append(&result, "filter ");
|
||||||
|
string_append_free(&result,compile_expression(token->next));
|
||||||
|
|
||||||
|
compile_exit_tag(&result);
|
||||||
|
|
||||||
|
string_append_free(&result,compile(token->next->next));
|
||||||
|
|
||||||
|
compile_enter_tag(&result);
|
||||||
|
|
||||||
|
string_append(&result, "endfilter");
|
||||||
|
|
||||||
|
compile_exit_tag(&result);
|
||||||
|
|
||||||
} else if (strcmp(token->content.string, "print") == 0) {
|
} else if (strcmp(token->content.string, "print") == 0) {
|
||||||
|
|
||||||
for(tSyntaxElement* i = token->next; i != NULL; i = i->next) {
|
for(tSyntaxElement* i = token->next; i != NULL; i = i->next) {
|
||||||
@ -487,6 +504,13 @@ char* compile(tSyntaxElement* syntaxtree) {
|
|||||||
string_append_free(&result, compile_expression(token->next->next));
|
string_append_free(&result, compile_expression(token->next->next));
|
||||||
compile_exit_tag(&result);
|
compile_exit_tag(&result);
|
||||||
|
|
||||||
|
} else if (strcmp(token->content.string, "quote") == 0) {
|
||||||
|
|
||||||
|
if (token->next->type == STRING)
|
||||||
|
string_append(&result,token->next->content.string);
|
||||||
|
else
|
||||||
|
string_append_free(&result,compile_expression(token->next));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
string_append(&result, "{#");
|
string_append(&result, "{#");
|
||||||
|
Loading…
Reference in New Issue
Block a user