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

Function PeekToken

Source/SpireCore/Preprocessor.cpp:715–726  ·  view source on GitHub ↗

Read one token with macro-expansion enabled. Note that because triggering macro expansion may involve changing the input-stream state, this operation *can* have side effects.

Source from the content-addressed store, hash-verified

713// involve changing the input-stream state, this
714// operation *can* have side effects.
715static Token PeekToken(Preprocessor* preprocessor)
716{
717 // Check whether we need to macro expand at the cursor.
718 MaybeBeginMacroExpansion(preprocessor);
719
720 // Peek a raw token (now that expansion has been triggered)
721 return PeekRawToken(preprocessor);
722
723 // TODO: need a plan for how to handle token pasting
724 // here without it being onerous. Would be nice if we
725 // didn't have to re-do pasting on a "peek"...
726}
727
728// Peek the type of the next token, including macro expansion.
729static CoreLib::Text::TokenType PeekTokenType(Preprocessor* preprocessor)

Callers 3

PeekTokenTypeFunction · 0.85
HandleLineDirectiveFunction · 0.85

Calls 3

MaybeBeginMacroExpansionFunction · 0.85
PeekRawTokenFunction · 0.85
IsEndOfLineFunction · 0.85

Tested by

no test coverage detected