| 126 | return t; |
| 127 | } |
| 128 | Token TokenStream::peek(size_t i) |
| 129 | { |
| 130 | ARM_COMPUTE_ERROR_ON_MSG(_tokens.empty(), "TokenStream can never be empty"); |
| 131 | ARM_COMPUTE_ERROR_ON_MSG(i >= max_look_ahead, "TokenStream: Exceeding max look ahead"); |
| 132 | // NOTE: If i exceeds the stream (_istream.eof()), read() automatically appends a End token at the end |
| 133 | while (_istream && _tokens.size() <= i) |
| 134 | { |
| 135 | read(); |
| 136 | } |
| 137 | size_t ind = std::min(i, _tokens.size() - 1); |
| 138 | return _tokens[ind]; |
| 139 | } |
| 140 | |
| 141 | void advance(CharPosition &pos, char ch) |
| 142 | { |
no test coverage detected