Parse default dialect and omit when printing.

This commit is contained in:
chriseth
2020-01-29 17:25:25 +01:00
parent 90c98a3289
commit fbe5bb0cce
10 changed files with 27 additions and 10 deletions
+9 -1
View File
@@ -30,10 +30,16 @@ namespace solidity::yul
{
struct Dialect;
/**
* Converts a parsed Yul AST into readable string representation.
* Ignores source locations.
* If a dialect is provided, the dialect's default type is omitted.
*/
class AsmPrinter
{
public:
explicit AsmPrinter() {}
AsmPrinter() {}
explicit AsmPrinter(Dialect const& _dialect): m_dialect(&_dialect) {}
std::string operator()(Literal const& _literal) const;
std::string operator()(Identifier const& _identifier) const;
@@ -53,6 +59,8 @@ public:
private:
std::string formatTypedName(TypedName _variable) const;
std::string appendTypeName(YulString _type) const;
Dialect const* m_dialect = nullptr;
};
}