Lines Matching full:reflect
13 "reflect"
49 func dump(msg string, val reflect.Value) {
59 m := make(map[string]reflect.Value)
60 pat := reflect.ValueOf(pattern)
61 repl := reflect.ValueOf(replace)
63 var rewriteVal func(val reflect.Value) reflect.Value
64 rewriteVal = func(val reflect.Value) reflect.Value {
67 return reflect.Value{}
74 val = subst(m, repl, reflect.ValueOf(val.Interface().(ast.Node).Pos()))
79 r := apply(rewriteVal, reflect.ValueOf(p)).Interface().(*ast.File)
85 func set(x, y reflect.Value) {
105 objectPtrNil = reflect.ValueOf((*ast.Object)(nil))
106 scopePtrNil = reflect.ValueOf((*ast.Scope)(nil))
108 identType = reflect.TypeOf((*ast.Ident)(nil))
109 objectPtrType = reflect.TypeOf((*ast.Object)(nil))
110 positionType = reflect.TypeOf(token.NoPos)
111 callExprType = reflect.TypeOf((*ast.CallExpr)(nil))
112 scopePtrType = reflect.TypeOf((*ast.Scope)(nil))
116 // To avoid extra conversions, f operates on the reflect.Value form.
117 func apply(f func(reflect.Value) reflect.Value, val reflect.Value) reflect.Value {
119 return reflect.Value{}
134 switch v := reflect.Indirect(val); v.Kind() {
135 case reflect.Slice:
140 case reflect.Struct:
145 case reflect.Interface:
160 func match(m map[string]reflect.Value, pattern, val reflect.Value) bool {
210 p := reflect.Indirect(pattern)
211 v := reflect.Indirect(val)
217 case reflect.Slice:
228 case reflect.Struct:
236 case reflect.Interface:
248 func subst(m map[string]reflect.Value, pattern reflect.Value, pos reflect.Value) reflect.Value {
250 return reflect.Value{}
258 return subst(nil, old, reflect.Value{})
273 case reflect.Slice:
274 v := reflect.MakeSlice(p.Type(), p.Len(), p.Len())
280 case reflect.Struct:
281 v := reflect.New(p.Type()).Elem()
287 case reflect.Ptr:
288 v := reflect.New(p.Type()).Elem()
294 case reflect.Interface:
295 v := reflect.New(p.Type()).Elem()