diff options
author | Adrian Thurston <thurston@complang.org> | 2011-12-31 04:04:11 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2011-12-31 04:04:11 +0000 |
commit | 479c6d56944987cf855cf23d80b38403f22ac8a5 (patch) | |
tree | 1d0560c29c7f25ecd47df02e802320d936d9d38c /colm/pdarun.c | |
parent | 07874ce4541a8938cad3d9b85d45b44690205962 (diff) | |
download | colm-479c6d56944987cf855cf23d80b38403f22ac8a5.tar.gz |
Need to clear any buffered data when dropping back into the bytecode loop from
the parser. refs #341.
Diffstat (limited to 'colm/pdarun.c')
-rw-r--r-- | colm/pdarun.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/colm/pdarun.c b/colm/pdarun.c index 0cad30b5..b901570d 100644 --- a/colm/pdarun.c +++ b/colm/pdarun.c @@ -389,10 +389,21 @@ void detachIgnores( Program *prg, Tree **sp, PdaRun *pdaRun, FsmRun *fsmRun, Kid treeDownref( prg, sp, leftIgnore ); } +void clearBuffered( FsmRun *fsmRun ) +{ + /* If there is data in the current buffer then send the whole send back + * should be in this buffer. */ + if ( fsmRun->tokstart != 0 ) + fsmRun->p = fsmRun->pe = fsmRun->tokstart; + else + fsmRun->pe = fsmRun->p; +} + /* Stops on: * PcrRevToken */ + static long sendBack( Program *prg, Tree **sp, PdaRun *pdaRun, FsmRun *fsmRun, InputStream *inputStream, Kid *input, long entry ) { |