summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2012-05-17 09:40:45 -0400
committerAdrian Thurston <thurston@complang.org>2012-05-17 09:40:45 -0400
commit7ea2a24ea16d4a649d244c5e2eca3b3ba2e73736 (patch)
treef393444c34c2f45558a760582dff8d19f7ed4043
parentd8eb27193f257c02a492dd7dec180682028bf591 (diff)
downloadcolm-7ea2a24ea16d4a649d244c5e2eca3b3ba2e73736.tar.gz
The prepParseTree function can go away.
-rw-r--r--colm/bytecode.c17
-rw-r--r--colm/bytecode.h1
2 files changed, 0 insertions, 18 deletions
diff --git a/colm/bytecode.c b/colm/bytecode.c
index df2208b1..91aad54b 100644
--- a/colm/bytecode.c
+++ b/colm/bytecode.c
@@ -159,21 +159,6 @@ void vm_grow( Program *prg )
debug( REALM_BYTECODE, "growing stack\n" );
}
-Tree *prepParseTree( Program *prg, Tree **sp, Tree *tree )
-{
- /* Seems like we need to always copy here. If it isn't a parse tree it
- * needs to be made into one. If it is then we need to make a new one in
- * case the old one is still in use by some parsing routine. The case were
- * we might be able to avoid a copy would be that it's a parse tree
- * already, but it's owning parser is completely finished with it. */
-
- debug( REALM_BYTECODE, "copying tree in send function\n" );
-
- Kid *unused = 0;
- tree = copyRealTree( prg, tree, 0, &unused );
- return tree;
-}
-
void parserSetContext( Program *prg, Tree **sp, Parser *parser, Tree *val )
{
parser->pdaRun->context = splitTree( prg, val );
@@ -216,7 +201,6 @@ Word streamAppend( Program *prg, Tree **sp, Tree *input, InputStream *inputStrea
appendStream( inputStream, input );
}
else {
- input = prepParseTree( prg, sp, input );
treeUpref( input );
appendTree( inputStream, input );
}
@@ -374,7 +358,6 @@ long streamPush( Program *prg, Tree **sp, FsmRun *fsmRun, InputStream *in, Tree
return length;
}
else {
- tree = prepParseTree( prg, sp, tree );
treeUpref( tree );
streamPushTree( fsmRun, in, tree, ignore );
return -1;
diff --git a/colm/bytecode.h b/colm/bytecode.h
index f00759a6..27fe071a 100644
--- a/colm/bytecode.h
+++ b/colm/bytecode.h
@@ -469,7 +469,6 @@ Tree *splitTree( struct ColmProgram *prg, Tree *t );
void rcodeDownrefAll( struct ColmProgram *prg, Tree **sp, RtCodeVect *cv );
void commitFull( struct ColmProgram *prg, Tree **sp, PdaRun *pdaRun, long commitReduce );
Tree *getParsedRoot( PdaRun *pdaRun, int stop );
-Tree *prepParseTree( struct ColmProgram *prg, Tree **sp, Tree *tree );
void splitRef( struct ColmProgram *prg, Tree ***sp, Ref *fromRef );
void allocGlobal( struct ColmProgram *prg );