Commit 1c809955 by John Kessenich

Add ability to treat keywords as identifiers in versions that had not yet reserved the keyword.

Used this for precision keywords and double matrix keywords. Also added a few missing reserved words. Also removed redundant "syntax error" when there is a parse error. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20423 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 59ddbafb
#version 120
lowp vec3 a;
mediump float b;
highp int c;
float lowp;
float mediump;
float highp;
precision highp float;
float precision;
in vec4 i;
out vec4 o;
......
......@@ -6,11 +6,11 @@ int a = 0xffffffff; // 32 bits, a gets the value -1
//int b = 0xffffffffU; // ERROR: can't convert uint to int
uint c = 0xffffffff; // 32 bits, c gets the value 0xFFFFFFFF
//uint d = 0xffffffffU; // 32 bits, d gets the value 0xFFFFFFFF
int e = -1; // the literal is “1”, then negation is performed,
int e = -1; // the literal is "1", then negation is performed,
// and the resulting non-literal 32-bit signed
// bit pattern of 0xFFFFFFFF is assigned, giving e
// the value of -1.
//uint f = -1u; // the literal is “1u”, then negation is performed,
//uint f = -1u; // the literal is "1u", then negation is performed,
// and the resulting non-literal 32-bit unsigned
// bit pattern of 0xFFFFFFFF is assigned, giving f
// the value of 0xFFFFFFFF.
......
......@@ -73,6 +73,7 @@ Jutta Degener, 1995
#endif
%}
%union {
struct {
TSourceLoc line;
......@@ -1664,6 +1665,7 @@ storage_qualifier
parseContext.checkDeprecated($1.line, ENoProfile, 140, "attribute");
parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "attribute");
parseContext.requireNotRemoved($1.line, EEsProfile, 300, "attribute");
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "attribute"))
parseContext.recover();
......@@ -1674,6 +1676,7 @@ storage_qualifier
| VARYING {
parseContext.checkDeprecated($1.line, ENoProfile, 140, "varying");
parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "varying");
parseContext.requireNotRemoved($1.line, EEsProfile, 300, "varying");
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "varying"))
parseContext.recover();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment