diff options
author | Adrian Thurston <thurston@complang.org> | 2012-05-04 20:59:42 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-05-04 22:09:00 -0400 |
commit | 1ba64e84b6f0c4053e8a88e39501c22b9732f602 (patch) | |
tree | ae85704b2604298458518f6b9804062b27633f37 | |
parent | d53be0d4dc6e8cb6309385c7c1addf0edc5cc280 (diff) | |
download | colm-1ba64e84b6f0c4053e8a88e39501c22b9732f602.tar.gz |
Fixes for attaching ignores. Missed some enters into shadow trees.
-rw-r--r-- | colm/pdarun.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/colm/pdarun.c b/colm/pdarun.c index 51aa7dd6..19aecceb 100644 --- a/colm/pdarun.c +++ b/colm/pdarun.c @@ -268,8 +268,8 @@ void detachIgnores( Program *prg, Tree **sp, PdaRun *pdaRun, FsmRun *fsmRun, Kid /* Right ignore are immediately discarded since they are copies of * left-ignores. */ Tree *rightIgnore = 0; - if ( pdaRun->tokenList != 0 && pdaRun->tokenList->kid->tree->flags & AF_RIGHT_IL_ATTACHED ) { - Kid *riKid = treeRightIgnoreKid( prg, pdaRun->tokenList->kid->tree ); + if ( pdaRun->tokenList != 0 && pt(pdaRun->tokenList->kid->tree)->shadow->tree->flags & AF_RIGHT_IL_ATTACHED ) { + Kid *riKid = treeRightIgnoreKid( prg, pt(pdaRun->tokenList->kid->tree)->shadow->tree ); /* If the right ignore has a left ignore, then that was the original * right ignore. */ @@ -284,8 +284,8 @@ void detachIgnores( Program *prg, Tree **sp, PdaRun *pdaRun, FsmRun *fsmRun, Kid else { rightIgnore = riKid->tree; treeUpref( rightIgnore ); - removeRightIgnore( prg, sp, pdaRun->tokenList->kid->tree ); - pdaRun->tokenList->kid->tree->flags &= ~AF_RIGHT_IL_ATTACHED; + removeRightIgnore( prg, sp, pt(pdaRun->tokenList->kid->tree)->shadow->tree ); + pt(pdaRun->tokenList->kid->tree)->shadow->tree->flags &= ~AF_RIGHT_IL_ATTACHED; } } @@ -657,10 +657,10 @@ void attachIgnore( Program *prg, Tree **sp, PdaRun *pdaRun, Kid *input ) input->tree->flags |= AF_LEFT_IL_ATTACHED; if ( pdaRun->tokenList != 0 ) { - if ( pdaRun->tokenList->kid->tree->flags & AF_RIGHT_IGNORE ) { + if ( pt(pdaRun->tokenList->kid->tree)->shadow->tree->flags & AF_RIGHT_IGNORE ) { /* The previous token already has a right ignore. Merge by * attaching it as a left ignore of the new list. */ - Kid *curIgnore = treeRightIgnoreKid( prg, pdaRun->tokenList->kid->tree ); + Kid *curIgnore = treeRightIgnoreKid( prg, pt(pdaRun->tokenList->kid->tree)->shadow->tree ); attachLeftIgnore( prg, (Tree*)rightIgnore, (IgnoreList*)curIgnore->tree ); /* Replace the current ignore. */ @@ -670,10 +670,10 @@ void attachIgnore( Program *prg, Tree **sp, PdaRun *pdaRun, Kid *input ) } else { /* Attach The ignore list. */ - attachRightIgnore( prg, pdaRun->tokenList->kid->tree, rightIgnore ); + attachRightIgnore( prg, pt(pdaRun->tokenList->kid->tree)->shadow->tree, rightIgnore ); } - pdaRun->tokenList->kid->tree->flags |= AF_RIGHT_IL_ATTACHED; + pt(pdaRun->tokenList->kid->tree)->shadow->tree->flags |= AF_RIGHT_IL_ATTACHED; } } else { |