HLSL: 1) Implement lookahead buffers/stacks for token advance/recede, 2) use it for cast operation.
The grammar now accepts type casts, like "(int)x", but that has to be disambiguated from "(a + b)", needed deeper lookahead and backing up than what existed so far.
This commit is contained in:
@@ -57,7 +57,7 @@ struct HlslToken {
|
||||
HlslToken() : isType(false), string(nullptr), symbol(nullptr) { loc.init(); }
|
||||
TSourceLoc loc; // location of token in the source
|
||||
EHlslTokenClass tokenClass; // what kind of token it is
|
||||
bool isType; // true if the token represents a user type
|
||||
bool isType; // true if the token represents a type
|
||||
union { // what data the token holds
|
||||
glslang::TString *string; // for identifiers
|
||||
int i; // for literals
|
||||
|
||||
Reference in New Issue
Block a user