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

Function EndInputStream

Source/SpireCore/Preprocessor.cpp:216–234  ·  view source on GitHub ↗

Called when we reach the end of an input stream. Performs some validation and then destroys the input stream if required.

Source from the content-addressed store, hash-verified

214// Called when we reach the end of an input stream.
215// Performs some validation and then destroys the input stream if required.
216static void EndInputStream(Preprocessor* preprocessor, PreprocessorInputStream* inputStream)
217{
218 // If there are any conditionals that weren't completed, then it is an error
219 if (inputStream->conditional)
220 {
221 PreprocessorConditional* conditional = inputStream->conditional;
222
223 GetSink(preprocessor)->diagnose(conditional->ifToken.Position, Diagnostics::endOfFileInPreprocessorConditional);
224
225 while (conditional)
226 {
227 PreprocessorConditional* parent = conditional->parent;
228 DestroyConditional(conditional);
229 conditional = parent;
230 }
231 }
232
233 DestroyInputStream(preprocessor, inputStream);
234}
235
236// Consume one token from an input stream
237static Token AdvanceRawToken(PreprocessorInputStream* inputStream)

Callers 1

AdvanceRawTokenFunction · 0.85

Calls 4

GetSinkFunction · 0.85
DestroyConditionalFunction · 0.85
DestroyInputStreamFunction · 0.85
diagnoseMethod · 0.80

Tested by

no test coverage detected