HLSL: Non-functional: Don't process function name/parameters before expected a function declaration.
This commit is contained in:
parent
b7201f8ee6
commit
78388726eb
@ -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.1882"
|
||||
#define GLSLANG_DATE "07-Mar-2017"
|
||||
#define GLSLANG_REVISION "Overload400-PrecQual.1885"
|
||||
#define GLSLANG_DATE "08-Mar-2017"
|
||||
|
||||
@ -326,6 +326,8 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
|
||||
HlslToken idToken;
|
||||
TIntermAggregate* initializers = nullptr;
|
||||
while (acceptIdentifier(idToken)) {
|
||||
if (peekTokenClass(EHTokLeftParen)) {
|
||||
// looks like function parameters
|
||||
TString* fnName = idToken.string;
|
||||
|
||||
// Potentially rename shader entry point function. No-op most of the time.
|
||||
@ -333,7 +335,11 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
|
||||
|
||||
// function_parameters
|
||||
TFunction& function = *new TFunction(fnName, declaredType);
|
||||
if (acceptFunctionParameters(function)) {
|
||||
if (!acceptFunctionParameters(function)) {
|
||||
expected("function parameter list");
|
||||
return false;
|
||||
}
|
||||
|
||||
// post_decls
|
||||
acceptPostDecls(function.getWritableType().getQualifier());
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user