Browse Source

Indentation fixes

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
fc6210e00f
  1. 2
      libsolidity/Parser.cpp
  2. 66
      libsolidity/Token.h
  3. 2
      libsolidity/Types.cpp
  4. 4
      test/SolidityNameAndTypeResolution.cpp

2
libsolidity/Parser.cpp

@ -289,7 +289,7 @@ ASTPointer<EnumDefinition> Parser::parseEnumDefinition()
break; break;
expectToken(Token::Comma); expectToken(Token::Comma);
if (m_scanner->getCurrentToken() != Token::Identifier) { if (m_scanner->getCurrentToken() != Token::Identifier) {
BOOST_THROW_EXCEPTION(createParserError("Expected Identifier after ,")); BOOST_THROW_EXCEPTION(createParserError("Expected Identifier after ','"));
} }
} }

66
libsolidity/Token.h

@ -72,26 +72,26 @@ namespace solidity
T(EOS, "EOS", 0) \ T(EOS, "EOS", 0) \
\ \
/* Punctuators (ECMA-262, section 7.7, page 15). */ \ /* Punctuators (ECMA-262, section 7.7, page 15). */ \
T(LParen, "(", 0) \ T(LParen, "(", 0) \
T(RParen, ")", 0) \ T(RParen, ")", 0) \
T(LBrack, "[", 0) \ T(LBrack, "[", 0) \
T(RBrack, "]", 0) \ T(RBrack, "]", 0) \
T(LBrace, "{", 0) \ T(LBrace, "{", 0) \
T(RBrace, "}", 0) \ T(RBrace, "}", 0) \
T(Colon, ":", 0) \ T(Colon, ":", 0) \
T(Semicolon, ";", 0) \ T(Semicolon, ";", 0) \
T(Period, ".", 0) \ T(Period, ".", 0) \
T(Conditional, "?", 3) \ T(Conditional, "?", 3) \
T(Arrow, "=>", 0) \ T(Arrow, "=>", 0) \
\ \
/* Assignment operators. */ \ /* Assignment operators. */ \
/* IsAssignmentOp() relies on this block of enum values being */ \ /* IsAssignmentOp() relies on this block of enum values being */ \
/* contiguous and sorted in the same order!*/ \ /* contiguous and sorted in the same order!*/ \
T(Assign, "=", 2) \ T(Assign, "=", 2) \
/* The following have to be in exactly the same order as the simple binary operators*/ \ /* The following have to be in exactly the same order as the simple binary operators*/ \
T(AssignBitOr, "|=", 2) \ T(AssignBitOr, "|=", 2) \
T(AssignBitXor, "^=", 2) \ T(AssignBitXor, "^=", 2) \
T(AssignBitAnd, "&=", 2) \ T(AssignBitAnd, "&=", 2) \
T(AssignShl, "<<=", 2) \ T(AssignShl, "<<=", 2) \
T(AssignSar, ">>=", 2) \ T(AssignSar, ">>=", 2) \
T(AssignShr, ">>>=", 2) \ T(AssignShr, ">>>=", 2) \
@ -107,9 +107,9 @@ namespace solidity
T(Comma, ",", 1) \ T(Comma, ",", 1) \
T(Or, "||", 4) \ T(Or, "||", 4) \
T(And, "&&", 5) \ T(And, "&&", 5) \
T(BitOr, "|", 8) \ T(BitOr, "|", 8) \
T(BitXor, "^", 9) \ T(BitXor, "^", 9) \
T(BitAnd, "&", 10) \ T(BitAnd, "&", 10) \
T(SHL, "<<", 11) \ T(SHL, "<<", 11) \
T(SAR, ">>", 11) \ T(SAR, ">>", 11) \
T(SHR, ">>>", 11) \ T(SHR, ">>>", 11) \
@ -123,19 +123,19 @@ namespace solidity
/* Compare operators sorted by precedence. */ \ /* Compare operators sorted by precedence. */ \
/* IsCompareOp() relies on this block of enum values */ \ /* IsCompareOp() relies on this block of enum values */ \
/* being contiguous and sorted in the same order! */ \ /* being contiguous and sorted in the same order! */ \
T(Equal, "==", 6) \ T(Equal, "==", 6) \
T(NotEqual, "!=", 6) \ T(NotEqual, "!=", 6) \
T(LessThan, "<", 7) \ T(LessThan, "<", 7) \
T(GreaterThan, ">", 7) \ T(GreaterThan, ">", 7) \
T(LessThanOrEqual, "<=", 7) \ T(LessThanOrEqual, "<=", 7) \
T(GreaterThanOrEqual, ">=", 7) \ T(GreaterThanOrEqual, ">=", 7) \
K(In, "in", 7) \ K(In, "in", 7) \
\ \
/* Unary operators. */ \ /* Unary operators. */ \
/* IsUnaryOp() relies on this block of enum values */ \ /* IsUnaryOp() relies on this block of enum values */ \
/* being contiguous and sorted in the same order! */ \ /* being contiguous and sorted in the same order! */ \
T(Not, "!", 0) \ T(Not, "!", 0) \
T(BitNot, "~", 0) \ T(BitNot, "~", 0) \
T(Inc, "++", 0) \ T(Inc, "++", 0) \
T(Dec, "--", 0) \ T(Dec, "--", 0) \
K(Delete, "delete", 0) \ K(Delete, "delete", 0) \
@ -168,7 +168,7 @@ namespace solidity
K(Switch, "switch", 0) \ K(Switch, "switch", 0) \
K(Var, "var", 0) \ K(Var, "var", 0) \
K(While, "while", 0) \ K(While, "while", 0) \
K(Enum, "enum", 0) \ K(Enum, "enum", 0) \
\ \
/* Ether subdenominations */ \ /* Ether subdenominations */ \
K(SubWei, "wei", 0) \ K(SubWei, "wei", 0) \
@ -316,15 +316,15 @@ namespace solidity
K(Text, "text", 0) \ K(Text, "text", 0) \
K(Real, "real", 0) \ K(Real, "real", 0) \
K(UReal, "ureal", 0) \ K(UReal, "ureal", 0) \
T(TypesEnd, NULL, 0) /* used as type enum end marker */ \ T(TypesEnd, NULL, 0) /* used as type enum end marker */ \
\ \
/* Literals */ \ /* Literals */ \
K(NullLiteral, "null", 0) \ K(NullLiteral, "null", 0) \
K(TrueLiteral, "true", 0) \ K(TrueLiteral, "true", 0) \
K(FalseLiteral, "false", 0) \ K(FalseLiteral, "false", 0) \
T(Number, NULL, 0) \ T(Number, NULL, 0) \
T(StringLiteral, NULL, 0) \ T(StringLiteral, NULL, 0) \
T(CommentLiteral, NULL, 0) \ T(CommentLiteral, NULL, 0) \
\ \
/* Identifiers (not keywords or future reserved words). */ \ /* Identifiers (not keywords or future reserved words). */ \
T(Identifier, NULL, 0) \ T(Identifier, NULL, 0) \

2
libsolidity/Types.cpp

@ -953,7 +953,7 @@ MemberList const& TypeType::getMembers() const
{ {
EnumDefinition const& enumDef = dynamic_cast<EnumType const&>(*m_actualType).getEnumDefinition(); EnumDefinition const& enumDef = dynamic_cast<EnumType const&>(*m_actualType).getEnumDefinition();
for (ASTPointer<EnumDeclaration> const& enumValue: enumDef.getMembers()) for (ASTPointer<EnumDeclaration> const& enumValue: enumDef.getMembers())
members.insert(make_pair(enumValue->getName(), make_shared<EnumType>(enumDef))); members.insert(make_pair(enumValue->getName(), make_shared<EnumType>(enumDef)));
m_members.reset(new MemberList(members)); m_members.reset(new MemberList(members));
} }
m_members.reset(new MemberList(members)); m_members.reset(new MemberList(members));

4
test/SolidityNameAndTypeResolution.cpp

@ -1063,8 +1063,8 @@ BOOST_AUTO_TEST_CASE(enum_duplicate_values)
enum ActionChoices { GoLeft, GoRight, GoLeft, Sit }; enum ActionChoices { GoLeft, GoRight, GoLeft, Sit };
function test() function test()
{ {
a = 1; a = 1;
b = 2; b = 2;
} }
uint256 a; uint256 a;
uint64 b; uint64 b;

Loading…
Cancel
Save