summaryrefslogtreecommitdiffstats
path: root/source/slang/preprocessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/preprocessor.cpp')
-rw-r--r--source/slang/preprocessor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/preprocessor.cpp b/source/slang/preprocessor.cpp
index a186ce201..a4cccf4f4 100644
--- a/source/slang/preprocessor.cpp
+++ b/source/slang/preprocessor.cpp
@@ -1921,6 +1921,9 @@ static Token ReadToken(Preprocessor* preprocessor)
{
// Look at the next raw token in the input.
Token const& token = PeekRawToken(preprocessor);
+ if (token.Type == TokenType::EndOfFile)
+ return token;
+
// If we have a directive (`#` at start of line) then handle it
if ((token.Type == TokenType::Pound) && (token.flags & TokenFlag::AtStartOfLine))
@@ -1980,7 +1983,7 @@ static void FinalizePreprocessor(
while (input)
{
PreprocessorInputStream* parent = input->parent;
- DestroyInputStream(preprocessor, input);
+ EndInputStream(preprocessor, input);
input = parent;
}