cleanup
This commit is contained in:
parent
9b7eb28b84
commit
613c033b24
@ -27,7 +27,7 @@ void resolver::cleanup()
|
|||||||
|
|
||||||
auto resolver::opcode_id(const std::string& name) -> std::uint8_t
|
auto resolver::opcode_id(const std::string& name) -> std::uint8_t
|
||||||
{
|
{
|
||||||
const auto itr = opcode_map_rev.find(name);
|
const auto& itr = opcode_map_rev.find(name);
|
||||||
|
|
||||||
if (itr != opcode_map_rev.end())
|
if (itr != opcode_map_rev.end())
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@ auto resolver::opcode_id(const std::string& name) -> std::uint8_t
|
|||||||
|
|
||||||
auto resolver::opcode_name(std::uint8_t id) -> std::string
|
auto resolver::opcode_name(std::uint8_t id) -> std::string
|
||||||
{
|
{
|
||||||
const auto itr = opcode_map.find(id);
|
const auto& itr = opcode_map.find(id);
|
||||||
|
|
||||||
if (itr != opcode_map.end())
|
if (itr != opcode_map.end())
|
||||||
{
|
{
|
||||||
|
@ -984,6 +984,7 @@ auto stmt_list::print() const -> std::string
|
|||||||
|
|
||||||
std::string data;
|
std::string data;
|
||||||
bool last_special = false;
|
bool last_special = false;
|
||||||
|
bool last_devblock = false;
|
||||||
auto block_pad = indented(indent_);
|
auto block_pad = indented(indent_);
|
||||||
indent_ += 4;
|
indent_ += 4;
|
||||||
|
|
||||||
@ -994,13 +995,19 @@ auto stmt_list::print() const -> std::string
|
|||||||
|
|
||||||
for (const auto& stmt : list)
|
for (const auto& stmt : list)
|
||||||
{
|
{
|
||||||
if (&stmt != &list.front() && stmt.as_node->is_special_stmt() || last_special)
|
if ((&stmt != &list.front() && stmt.as_node->is_special_stmt() || last_special) && stmt != kind::stmt_dev && !last_devblock)
|
||||||
data += "\n";
|
data += "\n";
|
||||||
|
|
||||||
if (stmt == kind::stmt_dev)
|
if (stmt == kind::stmt_dev)
|
||||||
|
{
|
||||||
data += stmt.print();
|
data += stmt.print();
|
||||||
|
last_devblock = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
data += stmts_pad + stmt.print();
|
data += stmts_pad + stmt.print();
|
||||||
|
last_devblock = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (&stmt != &list.back())
|
if (&stmt != &list.back())
|
||||||
data += "\n";
|
data += "\n";
|
||||||
@ -1033,9 +1040,6 @@ auto stmt_dev::print() const -> std::string
|
|||||||
if (&stmt != &list->list.front() && stmt.as_node->is_special_stmt() || last_special)
|
if (&stmt != &list->list.front() && stmt.as_node->is_special_stmt() || last_special)
|
||||||
data += "\n";
|
data += "\n";
|
||||||
|
|
||||||
if (stmt == kind::stmt_dev)
|
|
||||||
data += stmt.print();
|
|
||||||
else
|
|
||||||
data += stmts_pad + stmt.print();
|
data += stmts_pad + stmt.print();
|
||||||
|
|
||||||
if (&stmt != &list->list.back())
|
if (&stmt != &list->list.back())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user