GLSL: Fix #1358: Support "struct name", where name could be a user type

This commit is contained in:
John Kessenich 2018-06-11 19:25:24 -06:00
parent 1ea8f595f9
commit 2c8265bb62
4 changed files with 56 additions and 5 deletions

6
glslang/MachineIndependent/ScanContext.h Normal file → Executable file
View file

@ -50,7 +50,10 @@ class TParserToken;
class TScanContext {
public:
explicit TScanContext(TParseContextBase& pc) : parseContext(pc), afterType(false), field(false) { }
explicit TScanContext(TParseContextBase& pc) :
parseContext(pc),
afterType(false), afterStruct(false),
field(false) { }
virtual ~TScanContext() { }
static void fillInKeywordMap();
@ -76,6 +79,7 @@ protected:
TParseContextBase& parseContext;
bool afterType; // true if we've recognized a type, so can only be looking for an identifier
bool afterStruct; // true if we've recognized the STRUCT keyword, so can only be looking for an identifier
bool field; // true if we're on a field, right after a '.'
TSourceLoc loc;
TParserToken* parserToken;