MCPcopy Create free account
hub / github.com/csyonghe/Spire / SkipToMatchingToken

Function SkipToMatchingToken

Source/SpireCore/Parser.cpp:210–224  ·  view source on GitHub ↗

Skip balanced

Source from the content-addressed store, hash-verified

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.

Callers 1

SkipBalancedTokenFunction · 0.85

Calls 4

SkipBalancedTokenFunction · 0.85
IsAtEndMethod · 0.80
PeekTokenTypeMethod · 0.80
AdvanceTokenMethod · 0.80

Tested by

no test coverage detected