NewAST creates a base AST instance with an ast.Expr and ast.SourceInfo value.
(e Expr, sourceInfo *SourceInfo)
| 106 | |
| 107 | // NewAST creates a base AST instance with an ast.Expr and ast.SourceInfo value. |
| 108 | func NewAST(e Expr, sourceInfo *SourceInfo) *AST { |
| 109 | if e == nil { |
| 110 | e = nilExpr |
| 111 | } |
| 112 | return &AST{ |
| 113 | expr: e, |
| 114 | sourceInfo: sourceInfo, |
| 115 | typeMap: make(map[int64]*types.Type), |
| 116 | refMap: make(map[int64]*ReferenceInfo), |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | // NewCheckedAST wraps an parsed AST and augments it with type and reference metadata. |
| 121 | func NewCheckedAST(parsed *AST, typeMap map[int64]*types.Type, refMap map[int64]*ReferenceInfo) *AST { |
no outgoing calls