mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
yul: adds reindent() function to reindent yul source code and makes use of it in IRGenerator.
This function does count curly and round braces and reindents accordingly the beginning of each line. It does consider line-comments (// and ///) but not multiline comments (/* ... */).
This commit is contained in:
committed by
chriseth
parent
5329a84912
commit
0fd1db533e
@@ -30,6 +30,7 @@
|
||||
#include <libsolidity/codegen/CompilerUtils.h>
|
||||
|
||||
#include <libyul/AssemblyStack.h>
|
||||
#include <libyul/Utilities.h>
|
||||
|
||||
#include <libdevcore/CommonData.h>
|
||||
#include <libdevcore/Whiskers.h>
|
||||
@@ -45,8 +46,7 @@ using namespace dev::solidity;
|
||||
|
||||
pair<string, string> IRGenerator::run(ContractDefinition const& _contract)
|
||||
{
|
||||
// TODO Would be nice to pretty-print this while retaining comments.
|
||||
string ir = generate(_contract);
|
||||
string const ir = yul::reindent(generate(_contract));
|
||||
|
||||
yul::AssemblyStack asmStack(m_evmVersion, yul::AssemblyStack::Language::StrictAssembly, m_optimiserSettings);
|
||||
if (!asmStack.parseAndAnalyze("", ir))
|
||||
|
||||
Reference in New Issue
Block a user