Refactor array element type checks
Remove checks that would never fail, and refactor the functions into
more self-contained checks. For example, it doesn't make sense to
check the qualifier from the part of the type that doesn't contain the
qualifier.
This prepares for adding the parsing of arrays of arrays.
BUG=angleproject:2125
TEST=angle_unittests
Change-Id: I1144bee35d2b04c7cb22e2bb7e17307298e35f8c
Reviewed-on: https://chromium-review.googlesource.com/629016
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/ParseContext.h b/src/compiler/translator/ParseContext.h
index 52edb4f..784de13 100644
--- a/src/compiler/translator/ParseContext.h
+++ b/src/compiler/translator/ParseContext.h
@@ -125,7 +125,7 @@
// Returns a sanitized array size to use (the size is at least 1).
unsigned int checkIsValidArraySize(const TSourceLoc &line, TIntermTyped *expr);
bool checkIsValidQualifierForArray(const TSourceLoc &line, const TPublicType &elementQualifier);
- bool checkIsValidTypeForArray(const TSourceLoc &line, const TPublicType &elementType);
+ bool checkArrayElementIsNotArray(const TSourceLoc &line, const TPublicType &elementType);
bool checkIsNonVoid(const TSourceLoc &line, const TString &identifier, const TBasicType &type);
bool checkIsScalarBool(const TSourceLoc &line, const TIntermTyped *type);
void checkIsScalarBool(const TSourceLoc &line, const TPublicType &pType);