ExprToString converts an AST Expr node back to a string using macro call tracking metadata from source info if any macros are encountered within the expression.
(e ast.Expr, info *ast.SourceInfo, opts ...ASTFormatOption)
| 149 | // ExprToString converts an AST Expr node back to a string using macro call tracking metadata from |
| 150 | // source info if any macros are encountered within the expression. |
| 151 | func ExprToString(e ast.Expr, info *ast.SourceInfo, opts ...ASTFormatOption) (string, error) { |
| 152 | unparserOpts := make([]parser.UnparserOption, len(opts)) |
| 153 | for i, opt := range opts { |
| 154 | unparserOpts[i] = opt() |
| 155 | } |
| 156 | return parser.Unparse(e, info, unparserOpts...) |
| 157 | } |
| 158 | |
| 159 | // RefValueToValue converts between ref.Val and google.api.expr.v1alpha1.Value. |
| 160 | // The result Value is the serialized proto form. The ref.Val must not be error or unknown. |