Browse Source

Stylistic changes.

cl-refactor
Christian 10 years ago
parent
commit
c00153e5c1
  1. 8
      libevmcore/Assembly.cpp
  2. 2
      libsolidity/AST.h
  3. 6
      libsolidity/Types.cpp
  4. 2
      libsolidity/grammar.txt

8
libevmcore/Assembly.cpp

@ -60,7 +60,13 @@ int AssemblyItem::deposit() const
{
case Operation:
return instructionInfo((Instruction)(byte)m_data).ret - instructionInfo((Instruction)(byte)m_data).args;
case Push: case PushString: case PushTag: case PushData: case PushSub: case PushSubSize: case PushProgramSize:
case Push:
case PushString:
case PushTag:
case PushData:
case PushSub:
case PushSubSize:
case PushProgramSize:
return 1;
case Tag:
return 0;

2
libsolidity/AST.h

@ -763,7 +763,7 @@ public:
std::vector<ASTPointer<Expression const>> getArguments() const { return {m_arguments.begin(), m_arguments.end()}; }
/// Returns the referenced contract. Can only be called after type checking.
ContractDefinition const* getContract() const { return m_contract; }
ContractDefinition const* getContract() const { if (asserts(m_contract)) BOOST_THROW_EXCEPTION(InternalCompilerError()); else return m_contract; }
private:
ASTPointer<Identifier> m_contractName;

6
libsolidity/Types.cpp

@ -314,9 +314,9 @@ shared_ptr<FunctionType const> const& ContractType::getConstructorType() const
{
if (!m_constructorType)
{
FunctionDefinition const* constr = m_contract.getConstructor();
if (constr)
m_constructorType = make_shared<FunctionType const>(*constr);
FunctionDefinition const* constructor = m_contract.getConstructor();
if (constructor)
m_constructorType = make_shared<FunctionType const>(*constructor);
else
m_constructorType = make_shared<FunctionType const>(TypePointers(), TypePointers());
}

2
libsolidity/grammar.txt

@ -29,7 +29,7 @@ Expression = Assignment | UnaryOperation | BinaryOperation | FunctionCall | NewE
MemberAccess | PrimaryExpression
// The expression syntax is actually much more complicated
Assignment = Expression (AssignmentOp Expression)
FunctionCall = Expression '(' ( Expression ( ',' Expression )* ) ')'
FunctionCall = Expression '(' Expression ( ',' Expression )* ')'
NewExpression = 'new' Identifier '(' ( Expression ( ',' Expression )* ) ')'
MemberAccess = Expression '.' Identifier
IndexAccess = Expression '[' Expresison ']'

Loading…
Cancel
Save