/* * blogc: A blog compiler. * Copyright (C) 2014-2019 Rafael G. Martins * * This program can be distributed under the terms of the BSD License. * See the file LICENSE. */ #include #include #include "template-parser.h" #include "debug.h" static const char* get_operator(blogc_template_operator_t op) { if (op & BLOGC_TEMPLATE_OP_NEQ) return "!="; if (op & BLOGC_TEMPLATE_OP_EQ) { if (op & BLOGC_TEMPLATE_OP_LT) return "<="; else if (op & BLOGC_TEMPLATE_OP_GT) return ">="; return "=="; } if (op & BLOGC_TEMPLATE_OP_LT) return "<"; else if (op & BLOGC_TEMPLATE_OP_GT) return ">"; return ""; } void blogc_debug_template(sb_slist_t *ast) { for (sb_slist_t *tmp = ast; tmp != NULL; tmp = tmp->next) { blogc_template_node_t *data = tmp->data; fprintf(stderr, "DEBUG: