diff options
Diffstat (limited to 'src/parse/tokenstream.cpp')
-rw-r--r-- | src/parse/tokenstream.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parse/tokenstream.cpp b/src/parse/tokenstream.cpp index 0182e548..9a961a04 100644 --- a/src/parse/tokenstream.cpp +++ b/src/parse/tokenstream.cpp @@ -73,17 +73,17 @@ void TokenStream::putback(Token tok) eTokenType TokenStream::lookahead(unsigned int i) { const unsigned int MAX_LOOKAHEAD = 3; - + if( m_cache_valid ) { if( i == 0 ) return m_cache.type(); i --; } - + if( i >= MAX_LOOKAHEAD ) throw ParseError::BugCheck("Excessive lookahead"); - + while( i >= m_lookahead.size() ) { DEBUG("lookahead - read #" << m_lookahead.size()); @@ -91,7 +91,7 @@ eTokenType TokenStream::lookahead(unsigned int i) auto hygiene = this->realGetHygiene(); m_lookahead.push_back( ::std::make_pair(mv$(tok), mv$(hygiene)) ); } - + DEBUG("lookahead(" << i << ") = " << m_lookahead[i]); return m_lookahead[i].first.type(); } |