summaryrefslogtreecommitdiffstats
path: root/src/ast.c
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2015-12-02 00:18:08 +0800
committerTing-Wei Lan <lantw44@gmail.com>2015-12-02 00:18:08 +0800
commitf2a04b9f3810d1c19f8359bf3f1dbbe38bf07097 (patch)
tree240f3b2b7dc52ba28da0829c977d4643282157b2 /src/ast.c
parent15d78a2151c63a45adfad9dc954f79eba9207dab (diff)
downloadcompiler2015-f2a04b9f3810d1c19f8359bf3f1dbbe38bf07097.tar
compiler2015-f2a04b9f3810d1c19f8359bf3f1dbbe38bf07097.tar.gz
compiler2015-f2a04b9f3810d1c19f8359bf3f1dbbe38bf07097.tar.bz2
compiler2015-f2a04b9f3810d1c19f8359bf3f1dbbe38bf07097.tar.lz
compiler2015-f2a04b9f3810d1c19f8359bf3f1dbbe38bf07097.tar.xz
compiler2015-f2a04b9f3810d1c19f8359bf3f1dbbe38bf07097.tar.zst
compiler2015-f2a04b9f3810d1c19f8359bf3f1dbbe38bf07097.zip
Drop line_number and prog global variables
All important states should be stored in the local struct allocated in main function.
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/ast.c b/src/ast.c
index eb3ac54..c1e9b12 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -9,8 +9,6 @@
#include <stdlib.h>
-extern int line_number;
-
AST_NODE *Allocate(AST_TYPE type)
{
AST_NODE *temp;
@@ -22,7 +20,6 @@ AST_NODE *Allocate(AST_TYPE type)
temp->parent = NULL;
// Notice that leftmostSibling is not initialized as NULL
temp->leftmostSibling = temp;
- temp->linenumber = line_number;
return temp;
}