summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.c b/main.c
index b2f31dd..41efb2d 100644
--- a/main.c
+++ b/main.c
@@ -77,9 +77,11 @@ int main(int argc,char **argv){
return 1;
}
- AST *ast=parse(source);
+ char *errmsg;
+ AST *ast=parse(source,&errmsg);
if(ast==NULL){
- fprintf(stderr,"Parsing error!\n");
+ fprintf(stderr,"%s\n",errmsg);
+ free(errmsg);
return 1;
}
ast_debug(stderr,ast);