aboutsummaryrefslogtreecommitdiffstats
path: root/src/template-parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-04-19 00:06:56 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-04-19 00:06:56 -0300
commit30e5e6890682d4759e6dcdfc833a666e0ab3f7a2 (patch)
treed225bd39fcf99b14bc5f9ad8c1bfeedb2d5ab04d /src/template-parser.c
parentde39a41da62c4b3820b4805ddb7c4970c36bc257 (diff)
downloadblogc-30e5e6890682d4759e6dcdfc833a666e0ab3f7a2.tar.gz
blogc-30e5e6890682d4759e6dcdfc833a666e0ab3f7a2.tar.bz2
blogc-30e5e6890682d4759e6dcdfc833a666e0ab3f7a2.zip
added renderer, without tests
Diffstat (limited to 'src/template-parser.c')
-rw-r--r--src/template-parser.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/template-parser.c b/src/template-parser.c
index 1038190..d176288 100644
--- a/src/template-parser.c
+++ b/src/template-parser.c
@@ -53,8 +53,6 @@ blogc_template_parse(const char *src, size_t src_len, blogc_error_t **err)
size_t start = 0;
size_t end = 0;
- char *tmp = NULL;
-
unsigned int if_count = 0;
b_slist_t *stmts = NULL;
@@ -340,6 +338,15 @@ blogc_template_parse(const char *src, size_t src_len, blogc_error_t **err)
current++;
}
+ if (*err == NULL) {
+ if (if_count != 0)
+ *err = blogc_error_new_printf(BLOGC_ERROR_TEMPLATE_PARSER,
+ "%d 'if' statements were not closed!", if_count);
+ else if (block_state != BLOCK_CLOSED)
+ *err = blogc_error_new(BLOGC_ERROR_TEMPLATE_PARSER,
+ "A block was not closed!");
+ }
+
if (*err != NULL) {
if (stmt != NULL) {
free(stmt->value);