updated algorithm for bit finding...now to figure out literal value

tiny fixups

changed location of the check

got rid of extra space and fixed a couple of things

added binary results bits

change back literal value
This commit is contained in:
VoR0220 committed 2016-05-09 11:41:03 -05:00
1 parent 5bddb2d6ff
commit bfc238c8d1
6 files changed
+105 -146

No files matched your search

+2 -4
View File
@@ -104,10 +104,8 @@ void ReferencesResolver::endVisit(ArrayTypeName const& _typeName)
if (!length->annotation().type)
ConstantEvaluator e(*length);
auto const* lengthType = dynamic_cast<RationalNumberType const*>(length->annotation().type.get());
if (!lengthType)
fatalTypeError(length->location(), "Invalid array length.");
else if (lengthType->denominator() != 1)
fatalTypeError(length->location(), "Invalid input for array length, expected integer.");
if (!lengthType || lengthType->denominator() != 1)
fatalTypeError(length->location(), "Invalid array length, expected integer literal.");
else
_typeName.annotation().type = make_shared<ArrayType>(DataLocation::Storage, baseType, lengthType->literalValue(nullptr));
}