Open xianlinc opened 5 months ago
Introduced a new package called ast_printer to print ast.Node[ast.NodeType] to solidity source code. Right now, we do not support the printing of all the nodes, and we haven't tested it rigorously yet, but would love to get some feedback on what changes need to be made to integrate this into the codebase 🤩
ast_printer
ast.Node[ast.NodeType]
Heres an example of how you would use this:
func printRoot(root *ast.RootNode) { str, ok := ast_printer.Print(root.GetSourceUnits()[0]) if !ok { zap.L().Error("Failed to print root") } fmt.Println(str) }
Introduced a new package called
ast_printer
to printast.Node[ast.NodeType]
to solidity source code. Right now, we do not support the printing of all the nodes, and we haven't tested it rigorously yet, but would love to get some feedback on what changes need to be made to integrate this into the codebase 🤩Heres an example of how you would use this: