PP: #include: add names to error messages, so that lexical analysis can be tested.
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
// For the version, it uses the latest git tag followed by the number of commits.
|
||||
// For the date, it uses the current date (when then script is run).
|
||||
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1742"
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1744"
|
||||
#define GLSLANG_DATE "05-Jan-2017"
|
||||
|
||||
@@ -596,9 +596,9 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
|
||||
token = scanToken(ppToken);
|
||||
if (token != '\n') {
|
||||
if (token == EndOfInput)
|
||||
parseContext.ppError(ppToken->loc, "expected newline", "#include", "");
|
||||
parseContext.ppError(ppToken->loc, "expected newline after header name:", "#include", "%s", filename.c_str());
|
||||
else
|
||||
parseContext.ppError(ppToken->loc, "extra content after header name", "#include", "");
|
||||
parseContext.ppError(ppToken->loc, "extra content after header name:", "#include", "%s", filename.c_str());
|
||||
} else {
|
||||
TShader::Includer::IncludeResult* res = includer.include(filename.c_str(), includeType, currentSourceFile.c_str(), includeStack.size() + 1);
|
||||
if (res && !res->file_name.empty()) {
|
||||
@@ -619,7 +619,7 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
|
||||
std::string message =
|
||||
res ? std::string(res->file_data, res->file_length)
|
||||
: std::string("Could not process include directive");
|
||||
parseContext.ppError(directiveLoc, message.c_str(), "#include", "");
|
||||
parseContext.ppError(directiveLoc, message.c_str(), "#include", "for header name: %s", filename.c_str());
|
||||
if (res) {
|
||||
includer.releaseInclude(res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user