PP: Recognize the '::' token, and translate appropriately to GLSL/HLSL token.

This commit is contained in:
John Kessenich 2017-03-10 18:03:43 -07:00
parent 6212e86faa
commit 523e20dc02
8 changed files with 26 additions and 3 deletions

View file

@ -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.1892"
#define GLSLANG_DATE "09-Mar-2017"
#define GLSLANG_REVISION "Overload400-PrecQual.1897"
#define GLSLANG_DATE "10-Mar-2017"

View file

@ -701,6 +701,10 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
case PpAtomDecrement: return DEC_OP;
case PpAtomIncrement: return INC_OP;
case PpAtomColonColon:
parseContext.error(loc, "not supported", "::", "");
break;
case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT;
case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT;
case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT;

View file

@ -120,6 +120,8 @@ const struct {
{ PpAtomDecrement, "--" },
{ PpAtomIncrement, "++" },
{ PpAtomColonColon, "::" },
{ PpAtomDefine, "define" },
{ PpAtomUndef, "undef" },
{ PpAtomIf, "if" },

View file

@ -691,6 +691,12 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
pp->parseContext.ppError(ppToken->loc, "End of line in string", "string", "");
}
return PpAtomConstString;
case ':':
ch = getch();
if (ch == ':')
return PpAtomColonColon;
ungetch();
return ':';
}
ch = getch();

View file

@ -117,6 +117,8 @@ enum EFixedAtoms {
PpAtomDecrement,
PpAtomIncrement,
PpAtomColonColon,
PpAtomPaste,
// Constants