HLSL: Implement basic "struct" grammar.
This commit is contained in:
@@ -282,10 +282,14 @@ void C_DECL HlslParseContext::ppWarn(const TSourceLoc& loc, const char* szReason
|
||||
//
|
||||
// Handle seeing a variable identifier in the grammar.
|
||||
//
|
||||
TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, const TString* string)
|
||||
TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symbol, const TString* string)
|
||||
{
|
||||
TSymbol* symbol = symbolTable.find(*string);
|
||||
TIntermTyped* node = nullptr;
|
||||
if (symbol == nullptr)
|
||||
symbol = symbolTable.find(*string);
|
||||
if (symbol && symbol->getAsVariable() && symbol->getAsVariable()->isUserType()) {
|
||||
error(loc, "expected symbol, not user-defined type", string->c_str(), "");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Error check for requiring specific extensions present.
|
||||
if (symbol && symbol->getNumExtensions())
|
||||
@@ -306,6 +310,7 @@ TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, const TStr
|
||||
|
||||
const TVariable* variable;
|
||||
const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : nullptr;
|
||||
TIntermTyped* node = nullptr;
|
||||
if (anon) {
|
||||
// It was a member of an anonymous container.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user