Add arrays of arrays grammar, and adapt existing 1D array semantics to keep working as before.

Also add buffer and shared keywords and grammar, which brings the grammar up to 4.3.

N.B. There is a problem for "shared": it is both a keyword (as a storage qualifier) and an identifier (for layouts).

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@19947 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2012-12-12 21:26:43 +00:00
parent e320a1854b
commit fabf3e4058
4 changed files with 71 additions and 187 deletions

View file

@ -745,17 +745,16 @@ bool TParseContext::arrayQualifierErrorCheck(int line, TPublicType type)
}
//
// See if this type can be an array.
// Require array to have size
//
// Returns true if there is an error.
//
bool TParseContext::arrayTypeErrorCheck(int line, TPublicType type)
bool TParseContext::arraySizeRequiredErrorCheck(int line, int& size)
{
//
// Can the type be an array?
//
if (type.array) {
error(line, "cannot declare arrays of arrays", TType(type).getCompleteString().c_str(), "");
if (size == 0) {
error(line, "array size required", "", "");
size = 1;
return true;
}