AstToString converts an Ast back to a string if possible. Note, the conversion may not be an exact replica of the original expression, but will produce a string that is semantically equivalent and whose textual representation is stable.
(a *Ast)
| 99 | // Note, the conversion may not be an exact replica of the original expression, but will produce |
| 100 | // a string that is semantically equivalent and whose textual representation is stable. |
| 101 | func AstToString(a *Ast) (string, error) { |
| 102 | return ExprToString(a.NativeRep().Expr(), a.NativeRep().SourceInfo()) |
| 103 | } |
| 104 | |
| 105 | // ExprToString converts an AST Expr node back to a string using macro call tracking metadata from |
| 106 | // source info if any macros are encountered within the expression. |