diff options
author | Adrian Thurston <thurston@colm.net> | 2018-05-13 12:25:23 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2018-05-13 12:28:29 -0400 |
commit | 0c242026b82798da7d25d4a3e52bf06dde0ac14d (patch) | |
tree | 7543aa70a3853833f70ce11f9762b36fa2636a78 /src/synthesis.cc | |
parent | 47d60422cc5744cd3b75a6926ec4f1e7b2ae0ae3 (diff) | |
download | colm-0c242026b82798da7d25d4a3e52bf06dde0ac14d.tar.gz |
added a SEND_EOF instruction
Gives us something to land on when we skip over parsing machinery before and
EOS send. Also will try to use this to set EOF bit, hopefully allowing us to
unify FRAG and FINISH parse operations.
Diffstat (limited to 'src/synthesis.cc')
-rw-r--r-- | src/synthesis.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/synthesis.cc b/src/synthesis.cc index 198f0fa4..dc9289d8 100644 --- a/src/synthesis.cc +++ b/src/synthesis.cc @@ -1050,6 +1050,7 @@ void LangVarRef::callOperation( Compiler *pd, CodeVect &code, VarRefLookup &look if ( isFinishCall( lookup ) ) { code.append( IN_GET_PARSER_STREAM ); + code.append( IN_SEND_EOF ); LangTerm::parseFinish( pd, code, 0 ); @@ -1423,7 +1424,6 @@ UniqueType *LangTerm::evaluateConstruct( Compiler *pd, CodeVect &code ) const void LangTerm::parseFrag( Compiler *pd, CodeVect &code, int stopId ) { - /* Parse instruction. */ code.append( IN_PARSE_LOAD ); code.append( IN_PARSE_FRAG_W ); code.appendHalf( stopId ); @@ -1609,6 +1609,7 @@ UniqueType *LangTerm::evaluateParse( Compiler *pd, CodeVect &code, * Finish operation */ + code.append( IN_SEND_EOF ); parseFinish( pd, code, stopId ); /* Pull out the error and save it off. */ @@ -1709,8 +1710,10 @@ void LangTerm::evaluateSendParser( Compiler *pd, CodeVect &code, bool strings ) parseFrag( pd, code, 0 ); } - if ( eof ) + if ( eof ) { + code.append( IN_SEND_EOF ); parseFinish( pd, code, 0 ); + } } UniqueType *LangTerm::evaluateSend( Compiler *pd, CodeVect &code ) const |