src/lexer.h

changeset 81
071715c17296
parent 80
2ed3430fdd08
child 82
841562f5a32f
equal deleted inserted replaced
80:2ed3430fdd08 81:071715c17296
61 void must_be (e_token tok); 61 void must_be (e_token tok);
62 bool peek_next (token* tk = null); 62 bool peek_next (token* tk = null);
63 63
64 inline bool has_valid_token() const 64 inline bool has_valid_token() const
65 { 65 {
66 return (is_at_end() == false && m_token_position != m_tokens.begin() - 1); 66 return (m_token_position < m_tokens.end() && m_token_position >= m_tokens.begin());
67 } 67 }
68 68
69 inline token* get_token() const 69 inline token* get_token() const
70 { 70 {
71 assert (has_valid_token() == true); 71 assert (has_valid_token() == true);

mercurial