diff options
author | Adam NAILI | 2018-05-04 09:14:41 +0200 |
---|---|---|
committer | Adam NAILI | 2018-05-04 09:14:41 +0200 |
commit | 2ebd7d03e6d9ff5d8badc637ca4c6ab3c6db4e81 (patch) | |
tree | b50adeb1fc3189df196fef8c1dec40e32589a50d /src/symboltable.c | |
parent | c9c4fbbde6e4f4f3942777cd9930cf40375e0ea9 (diff) | |
download | tpc-compiler-2ebd7d03e6d9ff5d8badc637ca4c6ab3c6db4e81.tar.gz |
DIVSTAR working : 'It's working ! It's working' said Anakin
Diffstat (limited to 'src/symboltable.c')
-rw-r--r-- | src/symboltable.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/symboltable.c b/src/symboltable.c index 5c63d3f..d20b0dc 100644 --- a/src/symboltable.c +++ b/src/symboltable.c | |||
@@ -94,6 +94,12 @@ int loc_lookup(const char name[]) { | |||
94 | return loc_symbol_table.entries[count].type; | 94 | return loc_symbol_table.entries[count].type; |
95 | } | 95 | } |
96 | } | 96 | } |
97 | //Check in global table | ||
98 | for (count = 0; count < glo_symbol_table.size; count++) { | ||
99 | if (!strcmp(glo_symbol_table.entries[count].name, name)) { | ||
100 | return glo_symbol_table.entries[count].type; | ||
101 | } | ||
102 | } | ||
97 | fprintf(stderr, "No definition of the variable %s near line %d\n", name, | 103 | fprintf(stderr, "No definition of the variable %s near line %d\n", name, |
98 | lineno); | 104 | lineno); |
99 | return -1; | 105 | return -1; |