mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Parse default dialect and omit when printing.
This commit is contained in:
+9
-1
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user