diff options
author | Teddy <[email protected]> | 2014-04-05 16:00:49 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2014-04-05 16:00:49 +0800 |
commit | cf59bbeb4d738688837f858c5ddc6c152ecc6dbe (patch) | |
tree | 09cd700ab81a0545d5c9c41791ab3639e4fbf60d | |
parent | d30f1626370880275c0e046e31c2d9942ab2fd3a (diff) |
...
-rw-r--r-- | ast.c | 8 | ||||
-rw-r--r-- | ast.h | 2 | ||||
-rw-r--r-- | main.c | 1 |
3 files changed, 6 insertions, 5 deletions
@@ -367,13 +367,13 @@ char *cnode_debug_type_repr(CNode *ast) { assert(type); } if (aptr == abuff) - sprintf(buffer, "%s(%d:%d)", type, - ast->loc.row, ast->loc.col); + sprintf(buffer, "%s(%d:%d)->(var:%lx, type:%lx)", type, + ast->loc.row, ast->loc.col, (size_t)ast->ext.var, (size_t)ast->ext.type); else { *aptr = '\0'; - sprintf(buffer, "%s:%s(%d:%d)", type, abuff, - ast->loc.row, ast->loc.col); + sprintf(buffer, "%s:%s(%d:%d)->(var:%lx, type:%lx)", type, abuff, + ast->loc.row, ast->loc.col, (size_t)ast->ext.var, (size_t)ast->ext.type); } return buffer; } @@ -45,7 +45,7 @@ typedef struct CNode { int subtype; char *strval; } rec; - union { + struct { CType *type; CVar *var; } ext; @@ -46,6 +46,7 @@ void print_ast() { void print_sem() { yyparse(); semantics_check(ast_root); + cnode_debug_print(ast_root, 1); } void print_help() { |