diff options
author | Teddy <ted.sybil@gmail.com> | 2014-04-06 02:17:58 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2014-04-06 02:17:58 +0800 |
commit | e1fd11de0bad5fa1a852b8fa497b572555448c5a (patch) | |
tree | d98caebc238b8f7ab6a7804c9f03d0d6c374b31d /ast.c | |
parent | cf59bbeb4d738688837f858c5ddc6c152ecc6dbe (diff) |
complex pointer support
Diffstat (limited to 'ast.c')
-rw-r--r-- | ast.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -156,20 +156,18 @@ CNode *cnode_create_decl(CNode *type, CNode *init_declrs) { return decl; } -CNode *cnode_create_func(CNode *type, CNode *plain_decl, CNode *params, CNode *stmt) { +CNode *cnode_create_func(CNode *type, CNode *declr, CNode *stmt) { CNode *func = NEW_CNODE; #ifdef CIBIC_DEBUG assert(type->next == NULL); - assert(plain_decl->next == NULL); - assert(params->next == NULL); + assert(declr->next == NULL); assert(stmt->next == NULL); #endif func->type = FUNC_DEF; func->next = NULL; func->chd = stmt; - stmt->next = params; - params->next = plain_decl; - plain_decl->next = type; + stmt->next = declr; + declr->next = type; return func; } @@ -227,7 +225,7 @@ char *cnode_debug_type_repr(CNode *ast) { switch (ast->type) { case PROG: type = "prog"; break; - case FUNC_DEF: type = "func"; break; + case FUNC_DEF: type = "func_def"; break; case DECLS: type = "prg_decls"; break; case FUNCS: type = "prg_funcs"; break; case DECL: type = "decl"; break; |