diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-08-17 21:57:11 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-08-17 21:57:11 +0200 |
commit | e7b8610da9c93ec8b2578924eecd4861fcb23eab (patch) | |
tree | 61f63d9fd7ab424105b6e5fcf55fc28a46e39a44 | |
parent | 5c0965f636358aed11499a95cc12387fe5e06047 (diff) |
Fix error reporting after 1d274cd
-rw-r--r-- | error.txt | 3 | ||||
-rw-r--r-- | parser.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/error.txt b/error.txt new file mode 100644 index 0000000..14bcb38 --- /dev/null +++ b/error.txt @@ -0,0 +1,3 @@ +def main(){ + print(if 1 kaas; else swag); +} @@ -686,9 +686,7 @@ AST* parse(const char *source,char **errmsg){ int reslen; AST *pr=parseprogram(source,&reslen); source+=reslen; - Token next=nexttoken(&source,false); - DBG(printtoken(stderr,next,"afterparse")); - if(next.type!=TT_EOF||!pr){ + if(lasttoken.type!=TT_EOF||!pr){ *errmsg=reportparseerror(source); if(pr)ast_free(pr); return NULL; |