diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index 36540bc08..d791a8a06 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -456,15 +456,13 @@ bool ASTJsonConverter::visit(ArrayTypeName const& _node) bool ASTJsonConverter::visit(InlineAssembly const& _node) { Json::Value externalReferences(Json::arrayValue); - for (auto const& it : _node.annotation().externalReferences) - { + for (auto const& it: _node.annotation().externalReferences) if (it.first) { Json::Value tuple(Json::objectValue); tuple[it.first->name.str()] = inlineAssemblyIdentifierToJson(it); externalReferences.append(tuple); } - } setJsonNode(_node, "InlineAssembly", { make_pair("operations", Json::Value(yul::AsmPrinter()(_node.operations()))), make_pair("externalReferences", std::move(externalReferences)) diff --git a/scripts/check_style.sh b/scripts/check_style.sh index 01e50662a..afecc06bc 100755 --- a/scripts/check_style.sh +++ b/scripts/check_style.sh @@ -18,6 +18,7 @@ fi FORMATERROR=$( ( git grep -nIE "\<(if|for)\(" -- '*.h' '*.cpp' # no space after "if" or "for" + git grep -nIE "\\s*\([^=]*\>\s:\s.*\)" -- '*.h' '*.cpp' # no space before range based for-loop git grep -nIE "\\s*\(.*\)\s*\{\s*$" -- '*.h' '*.cpp' # "{\n" on same line as "if" / "for" git grep -nIE "[,\(<]\s*const " -- '*.h' '*.cpp' # const on left side of type git grep -nIE "^\s*(static)?\s*const " -- '*.h' '*.cpp' # const on left side of type (beginning of line) diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index b88284b08..e49359ecd 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -1102,8 +1102,7 @@ void CommandLineInterface::handleAst(string const& _argStr) for (auto const& sourceCode: m_sourceCodes) asts.push_back(&m_compiler->ast(sourceCode.first)); map gasCosts; - for (auto const& contract : m_compiler->contractNames()) - { + for (auto const& contract: m_compiler->contractNames()) if (auto const* assemblyItems = m_compiler->runtimeAssemblyItems(contract)) { auto ret = GasEstimator::breakToStatementLevel( @@ -1114,8 +1113,6 @@ void CommandLineInterface::handleAst(string const& _argStr) gasCosts[it.first] += it.second; } - } - bool legacyFormat = !m_args.count(g_argAstCompactJson); if (m_args.count(g_argOutputDir)) {