aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-04-04 05:09:45 +0800
committerTeddy <ted.sybil@gmail.com>2014-04-04 05:09:45 +0800
commita05cc73c7519d7802c222921bf3b3c5b045b17f1 (patch)
treea472fc056d45753fc7e8449be67caca6e9503a88 /main.c
parenta52fc0e7c5d05c7a4b18d8520826e448576826f9 (diff)
add scope
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index 17a10ad..ff70bf9 100644
--- a/main.c
+++ b/main.c
@@ -44,7 +44,11 @@ void print_ast() {
void print_sem() {
yyparse();
- semantics_check(ast_root);
+ if (ast_root)
+ {
+ semantics_check(ast_root);
+ }
+ else exit(1);
}
void print_help() {