diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-09 21:00:12 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-09 21:00:12 +0800 |
commit | 6f621f8486ca6685b29008cb66ea6a819d7c91dc (patch) | |
tree | 32cca3cea5809732c55a2da23587e238d554049c /AST.cpp | |
parent | 75a5c20f541a7dc41f80bdb3b4fe3478d18ad4fe (diff) | |
download | dexon-solidity-6f621f8486ca6685b29008cb66ea6a819d7c91dc.tar.gz dexon-solidity-6f621f8486ca6685b29008cb66ea6a819d7c91dc.tar.zst dexon-solidity-6f621f8486ca6685b29008cb66ea6a819d7c91dc.zip |
Changing Solidity Code to use CamelCase enum values
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -247,7 +247,7 @@ void StructDefinition::checkRecursion() const << errinfo_comment("Recursive struct definition.")); definitionsSeen.insert(def); for (ASTPointer<VariableDeclaration> const& member: def->getMembers()) - if (member->getType()->getCategory() == Type::Category::STRUCT) + if (member->getType()->getCategory() == Type::Category::Struct) { UserDefinedTypeName const& typeName = dynamic_cast<UserDefinedTypeName const&>(*member->getTypeName()); queue.push_back(&dynamic_cast<StructDefinition const&>(*typeName.getReferencedDeclaration())); @@ -384,14 +384,14 @@ void VariableDefinition::checkTypeRequirements() // no type declared and no previous assignment, infer the type m_value->checkTypeRequirements(); TypePointer type = m_value->getType(); - if (type->getCategory() == Type::Category::INTEGER_CONSTANT) + if (type->getCategory() == Type::Category::IntegerConstant) { auto intType = dynamic_pointer_cast<IntegerConstantType const>(type)->getIntegerType(); if (!intType) BOOST_THROW_EXCEPTION(m_value->createTypeError("Invalid integer constant " + type->toString())); type = intType; } - else if (type->getCategory() == Type::Category::VOID) + else if (type->getCategory() == Type::Category::Void) BOOST_THROW_EXCEPTION(m_variable->createTypeError("var cannot be void type")); m_variable->setType(type); } @@ -406,7 +406,7 @@ void Assignment::checkTypeRequirements() if (!m_leftHandSide->getType()->isValueType() && !m_leftHandSide->isLocalLValue()) BOOST_THROW_EXCEPTION(createTypeError("Assignment to non-local non-value lvalue.")); m_type = m_leftHandSide->getType(); - if (m_assigmentOperator == Token::ASSIGN) + if (m_assigmentOperator == Token::Assign) m_rightHandSide->expectType(*m_type); else { @@ -425,7 +425,7 @@ void Assignment::checkTypeRequirements() void ExpressionStatement::checkTypeRequirements() { m_expression->checkTypeRequirements(); - if (m_expression->getType()->getCategory() == Type::Category::INTEGER_CONSTANT) + if (m_expression->getType()->getCategory() == Type::Category::IntegerConstant) if (!dynamic_pointer_cast<IntegerConstantType const>(m_expression->getType())->getIntegerType()) BOOST_THROW_EXCEPTION(m_expression->createTypeError("Invalid integer constant.")); } @@ -449,9 +449,9 @@ void Expression::requireLValue() void UnaryOperation::checkTypeRequirements() { - // INC, DEC, ADD, SUB, NOT, BIT_NOT, DELETE + // INC, DEC, ADD, SUB, NOT, BitNot, DELETE m_subExpression->checkTypeRequirements(); - if (m_operator == Token::Value::INC || m_operator == Token::Value::DEC || m_operator == Token::Value::DELETE) + if (m_operator == Token::Value::Inc || m_operator == Token::Value::Dec || m_operator == Token::Value::Delete) m_subExpression->requireLValue(); m_type = m_subExpression->getType()->unaryOperatorResult(m_operator); if (!m_type) @@ -553,7 +553,7 @@ void FunctionCall::checkTypeRequirements() bool FunctionCall::isTypeConversion() const { - return m_expression->getType()->getCategory() == Type::Category::TYPE; + return m_expression->getType()->getCategory() == Type::Category::Type; } void NewExpression::checkTypeRequirements() @@ -577,13 +577,13 @@ void MemberAccess::checkTypeRequirements() BOOST_THROW_EXCEPTION(createTypeError("Member \"" + *m_memberName + "\" not found or not " "visible in " + type.toString())); //@todo later, this will not always be STORAGE - m_lvalue = type.getCategory() == Type::Category::STRUCT ? Declaration::LValueType::STORAGE : Declaration::LValueType::NONE; + m_lvalue = type.getCategory() == Type::Category::Struct ? Declaration::LValueType::STORAGE : Declaration::LValueType::NONE; } void IndexAccess::checkTypeRequirements() { m_base->checkTypeRequirements(); - if (m_base->getType()->getCategory() != Type::Category::MAPPING) + if (m_base->getType()->getCategory() != Type::Category::Mapping) BOOST_THROW_EXCEPTION(m_base->createTypeError("Indexed expression has to be a mapping (is " + m_base->getType()->toString() + ")")); MappingType const& type = dynamic_cast<MappingType const&>(*m_base->getType()); |