Refactor type_specifier_nonarray parsing to reduce code repetition
When type_specifier_nonarray gets parsed the scope gets saved into
TType and the code becomes repetitive. Setting of the scope is moved
to type_specifier_no_prec as it occurs less times.
BUG=angleproject:911
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I6da5fe7bc2d60ba2996221af71b719b818f5e9b1
Reviewed-on: https://chromium-review.googlesource.com/380535
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/compiler/translator/SymbolTable.h b/src/compiler/translator/SymbolTable.h
index 60e0b99..f092412 100644
--- a/src/compiler/translator/SymbolTable.h
+++ b/src/compiler/translator/SymbolTable.h
@@ -471,15 +471,15 @@
bool setDefaultPrecision(const TPublicType &type, TPrecision prec)
{
- if (!SupportsPrecision(type.type))
+ if (!SupportsPrecision(type.getBasicType()))
return false;
- if (type.type == EbtUInt)
+ if (type.getBasicType() == EbtUInt)
return false; // ESSL 3.00.4 section 4.5.4
if (type.isAggregate())
return false; // Not allowed to set for aggregate types
int indexOfLastElement = static_cast<int>(precisionStack.size()) - 1;
// Uses map operator [], overwrites the current value
- (*precisionStack[indexOfLastElement])[type.type] = prec;
+ (*precisionStack[indexOfLastElement])[type.getBasicType()] = prec;
return true;
}