aboutsummaryrefslogtreecommitdiff
path: root/ctemplates.c
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-12-30 02:40:44 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-12-30 02:40:44 -0500
commit843d57b03549ed0481e6a4e39a1fdb0fa3311929 (patch)
treeadbbd62789a1cce4e70b358301377522afd8dadc /ctemplates.c
parent9c8bf52be1fe1af8830327c375d644ecfdb5f5c1 (diff)
downloadlibctemplates-843d57b03549ed0481e6a4e39a1fdb0fa3311929.tar.gz
libctemplates-843d57b03549ed0481e6a4e39a1fdb0fa3311929.tar.bz2
libctemplates-843d57b03549ed0481e6a4e39a1fdb0fa3311929.zip
Added more docmentation
Added some more documentation, and removed some extranious prints
Diffstat (limited to 'ctemplates.c')
-rw-r--r--ctemplates.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ctemplates.c b/ctemplates.c
index faf4334..dd981ac 100644
--- a/ctemplates.c
+++ b/ctemplates.c
@@ -680,10 +680,10 @@ parse_variable(struct TMPL_token* head, struct TMPL_buf* errbuf){
int attribs_length = head->length - TAG_VAR_LENGTH;
int in_name = kmp(start_of_attribs,attribs_length,ATTRIBUTE_VARNAME,ATTRIBUTE_VARNAME_LENGTH);
int in_default = kmp(start_of_attribs,attribs_length,ATTRIBUTE_DEFAULT,ATTRIBUTE_DEFAULT_LENGTH);
- if(in_name == -1 && DEBUGGING){
- char buf[ERR_MSG_LEN];
- snprintf(buf,ERR_MSG_LEN,"Parsing error: Could not find name=\"name\" near %s\n",head->start);
- bputs(errbuf,buf);
+ if(in_name == -1){
+ bputs(errbuf,"Parsing error: Could not find \"name\" field in variable near");
+ bputsn(errbuf,head->start,ERR_MSG_LEN);
+ bputs(errbuf,"\n");
}
if(in_name >= 0){
char* start_of_name = start_of_attribs + in_name + ATTRIBUTE_VARNAME_LENGTH;
@@ -830,10 +830,10 @@ compile(char* tmplstr){
ret->out = alloc_tmpl_buf();
ret->errout = alloc_tmpl_buf();
struct TMPL_token* tokens = TMPL_tokenize(tmplstr,slen);
- print_tokens(tokens);
struct TMPL_tagnode* ast = parse(tokens,ret->errout);
- print_ast(ast);
if(ast == NULL){
+ //size_t dummy;
+ //printf("error: %s\n",bstringify(ret->errout,&dummy));
}else{
ret->roottag = ast;
}