diff options
| author | Shinya Sato <shinnya.sato@gmail.com> | 2022-05-02 09:49:01 +0900 |
|---|---|---|
| committer | Shinya Sato <shinnya.sato@gmail.com> | 2022-05-02 09:49:01 +0900 |
| commit | 8c7809d024e85d0a8acfb794a4db41b0e4bc13e6 (patch) | |
| tree | 25ac81bad7be415d7cf75457275f7161d79f9f10 /src/ast.c | |
| parent | 429543c748aaf81b2a4207318eb5a05259469b21 (diff) | |
| download | inpla-8c7809d024e85d0a8acfb794a4db41b0e4bc13e6.tar.gz inpla-8c7809d024e85d0a8acfb794a4db41b0e4bc13e6.zip | |
v0.8.2-1
Diffstat (limited to 'src/ast.c')
| -rw-r--r-- | src/ast.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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; } } |
