From 8c7809d024e85d0a8acfb794a4db41b0e4bc13e6 Mon Sep 17 00:00:00 2001 From: Shinya Sato Date: Mon, 2 May 2022 09:49:01 +0900 Subject: v0.8.2-1 --- src/ast.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ast.c') diff --git a/src/ast.c b/src/ast.c index 88a40ff..4e5b6af 100644 --- a/src/ast.c +++ b/src/ast.c @@ -11,7 +11,7 @@ #define MAX_SYMBOLS 256 typedef struct { char* sym[MAX_SYMBOLS]; - int val[MAX_SYMBOLS]; + long val[MAX_SYMBOLS]; int nth; } SymbolTable; @@ -71,9 +71,9 @@ int ast_getRecordedVal(int entry) { } -void recordVal(SymbolTable *table, char *name, int val) { +void recordVal(SymbolTable *table, char *name, long val) { int i; - + for (i=0; i< table->nth; i++) { if (strcmp(table->sym[i], name) == 0) { @@ -142,11 +142,11 @@ Ast *ast_makeSymbol(char *name) { return ptr; } -Ast *ast_makeInt(int num) { +Ast *ast_makeInt(long num) { Ast *ptr; ptr = ast_myalloc(); ptr->id = AST_INT; - ptr->intval = num; + ptr->longval = num; return ptr; } @@ -169,7 +169,7 @@ Ast *ast_makeAST(AST_ID id, Ast *left, Ast *right) { ptr = ast_myalloc(); ptr->id = AST_INT; - ptr->intval = ConstTable.val[entry]; + ptr->longval = ConstTable.val[entry]; return ptr; } } -- cgit v1.2.3