aboutsummaryrefslogtreecommitdiff
path: root/pc.y
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-08-17 11:34:48 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-08-17 11:34:48 -0400
commit06ebf6a87ca1db975bdbf4f7f3126ea7c26ddde6 (patch)
tree03215f60ea0c776e60f38288470dac10546ad501 /pc.y
parentee6c598892518d956388bb008095de6d4d7fe123 (diff)
Add basic type checking
Squashed commit of WIP-type_check@5dadc4f5667ae69a709dd45c020780f2f424d67e
Diffstat (limited to 'pc.y')
-rw-r--r--pc.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/pc.y b/pc.y
index 81cb69b..ed4872c 100644
--- a/pc.y
+++ b/pc.y
@@ -1,6 +1,7 @@
%{
#include <stdlib.h>
#include <stddef.h>
+#include <assert.h>
#include "node.h"
#include "scope.h"
@@ -92,6 +93,7 @@ program
compound_statement
'.'
{
+ set_ret_type($9);
print_tree($9);
}
;
@@ -158,6 +160,7 @@ sub_prog_declaration
sub_prog_declarations
compound_statement
{
+ set_ret_type($4);
print_tree($4);
pop_scope(&cur_scope);
}