diff options
author | Adrian Thurston <thurston@complang.org> | 2015-01-18 16:59:32 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-01-18 16:59:32 -0500 |
commit | 7c402fcd65b36a20c8f7059b551e99212fa4adae (patch) | |
tree | 852717acbe7385d5e981847cdef1d1b4ad943fab /src/tree.c | |
parent | e295b7169e3e234994202322737e0e2a337c9311 (diff) | |
download | colm-7c402fcd65b36a20c8f7059b551e99212fa4adae.tar.gz |
some cleanup in the pointer
Diffstat (limited to 'src/tree.c')
-rw-r--r-- | src/tree.c | 30 |
1 files changed, 9 insertions, 21 deletions
@@ -180,20 +180,21 @@ Tree *constructString( Program *prg, Head *s ) return (Tree*)str; } -Pointer *colm_construct_pointer( Program *prg, Value value ) +Tree *colm_construct_pointer( Program *prg, Value value ) { - Kid *kid = kidAllocate( prg ); - kid->tree = value; - kid->next = prg->origHeap; - prg->origHeap = kid; - Pointer *pointer = (Pointer*) treeAllocate( prg ); pointer->id = LEL_ID_PTR; - pointer->value = kid; + pointer->value = value; - return pointer; + return (Tree*)pointer; } +Value colm_get_pointer_val( Tree *ptr ) +{ + return ((Pointer*)ptr)->value; +} + + Tree *constructTerm( Program *prg, Word id, Head *tokdata ) { LangElInfo *lelInfo = prg->rtd->lelInfo; @@ -1288,19 +1289,6 @@ Tree *getFieldSplit( Program *prg, Tree *tree, Word field ) return split; } -Tree *colm_get_pointer_val( Pointer *ptr ) -{ - return ptr->value->tree; -} - -Tree *getPtrValSplit( Program *prg, Pointer *ptr ) -{ - Tree *val = ptr->value->tree; - Tree *split = splitTree( prg, val ); - ptr->value->tree = split; - return split; -} - /* This must traverse in the same order that the bindId assignments are done * in. */ int matchPattern( Tree **bindings, Program *prg, long pat, Kid *kid, int checkNext ) |