Skip balanced
| 208 | |
| 209 | // Skip balanced |
| 210 | static CoreLib::Text::TokenType SkipToMatchingToken( |
| 211 | TokenReader* reader, |
| 212 | CoreLib::Text::TokenType tokenType) |
| 213 | { |
| 214 | for (;;) |
| 215 | { |
| 216 | if (reader->IsAtEnd()) return TokenType::EndOfFile; |
| 217 | if (reader->PeekTokenType() == tokenType) |
| 218 | { |
| 219 | reader->AdvanceToken(); |
| 220 | return tokenType; |
| 221 | } |
| 222 | SkipBalancedToken(reader); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | // Is the given token type one that is used to "close" a |
| 227 | // balanced construct. |
no test coverage detected