-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathxtypes.go
More file actions
700 lines (662 loc) · 17.8 KB
/
Copy pathxtypes.go
File metadata and controls
700 lines (662 loc) · 17.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
/*
* Copyright (c) 2022 The GoPlus Authors (goplus.org). All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ixgo
import (
"fmt"
"go/token"
"go/types"
"log"
"reflect"
"strconv"
"strings"
"sync"
"sync/atomic"
"unsafe"
"github.com/goplus/ixgo/internal/typesutil"
"github.com/goplus/reflectx"
"golang.org/x/tools/go/ssa"
"golang.org/x/tools/go/types/typeutil"
)
var (
tyEmptyStruct = reflect.TypeOf((*struct{})(nil)).Elem()
tyEmptyPtr = reflect.TypeOf((*struct{})(nil))
tyEmptyMap = reflect.TypeOf((*map[struct{}]struct{})(nil)).Elem()
tyEmptySlice = reflect.TypeOf((*[]struct{})(nil)).Elem()
tyEmptyArray = reflect.TypeOf((*[0]struct{})(nil)).Elem()
tyEmptyChan = reflect.TypeOf((*chan struct{})(nil)).Elem()
tyEmptyFunc = reflect.TypeOf((*func())(nil)).Elem()
tyUnusedFunc = reflect.TypeOf((*func(_unused))(nil)).Elem()
)
type _unused struct{}
/*
Array
Chan
Func
Interface
Map
Ptr
Slice
String
Struct
UnsafePointer
*/
func emptyType(kind reflect.Kind) reflect.Type {
switch kind {
case reflect.Array:
return tyEmptyArray
case reflect.Chan:
return tyEmptyChan
case reflect.Func:
return tyEmptyFunc
case reflect.Interface:
return tyEmptyInterface
case reflect.Map:
return tyEmptyMap
case reflect.Ptr:
return tyEmptyPtr
case reflect.Slice:
return tyEmptySlice
case reflect.Struct:
return tyEmptyStruct
default:
return xtypeTypes[kind]
}
}
func toMockType(typ types.Type) reflect.Type {
switch t := typ.(type) {
case *types.Basic:
kind := t.Kind()
if kind > types.Invalid && kind < types.UntypedNil {
return xtypeTypes[kind]
}
panic(fmt.Errorf("toMockType: invalid type %v", typ))
case *types.Pointer:
return tyEmptyPtr
case *types.Slice:
return tyEmptySlice
case *types.Array:
e := toMockType(t.Elem())
return reflect.ArrayOf(int(t.Len()), e)
case *types.Map:
return tyEmptyMap
case *types.Chan:
return tyEmptyChan
case *types.Struct:
n := t.NumFields()
fs := make([]reflect.StructField, n)
for i := 0; i < n; i++ {
ft := t.Field(i)
fs[i].Name = "F" + strconv.Itoa(i)
fs[i].Type = toMockType(ft.Type())
fs[i].Anonymous = ft.Embedded()
}
return reflect.StructOf(fs)
case *types.Named:
return toMockType(typ.Underlying())
case *types.Interface:
return tyEmptyInterface
case *types.Signature:
in := t.Params().Len()
out := t.Results().Len()
if in+out == 0 {
return tyEmptyFunc
}
ins := make([]reflect.Type, in)
outs := make([]reflect.Type, out)
variadic := t.Variadic()
if variadic {
for i := 0; i < in-1; i++ {
ins[i] = tyEmptyStruct
}
ins[in-1] = tyEmptySlice
} else {
for i := 0; i < in; i++ {
ins[i] = tyEmptyStruct
}
}
for i := 0; i < out; i++ {
outs[i] = tyEmptyStruct
}
return reflect.FuncOf(ins, outs, variadic)
case *types.Alias:
return toMockType(types.Unalias(t))
default:
panic(fmt.Errorf("toEmptyType: unreachable %T", typ))
}
}
var xtypeTypes = [...]reflect.Type{
types.Bool: reflect.TypeOf(false),
types.Int: reflect.TypeOf(0),
types.Int8: reflect.TypeOf(int8(0)),
types.Int16: reflect.TypeOf(int16(0)),
types.Int32: reflect.TypeOf(int32(0)),
types.Int64: reflect.TypeOf(int64(0)),
types.Uint: reflect.TypeOf(uint(0)),
types.Uint8: reflect.TypeOf(uint8(0)),
types.Uint16: reflect.TypeOf(uint16(0)),
types.Uint32: reflect.TypeOf(uint32(0)),
types.Uint64: reflect.TypeOf(uint64(0)),
types.Uintptr: reflect.TypeOf(uintptr(0)),
types.Float32: reflect.TypeOf(float32(0)),
types.Float64: reflect.TypeOf(float64(0)),
types.Complex64: reflect.TypeOf(complex64(0)),
types.Complex128: reflect.TypeOf(complex128(0)),
types.String: reflect.TypeOf(""),
types.UnsafePointer: reflect.TypeOf(unsafe.Pointer(nil)),
types.UntypedBool: reflect.TypeOf(false),
types.UntypedInt: reflect.TypeOf(0),
types.UntypedRune: reflect.TypeOf('a'),
types.UntypedFloat: reflect.TypeOf(0.1),
types.UntypedComplex: reflect.TypeOf(0 + 1i),
types.UntypedString: reflect.TypeOf(""),
}
type FindMethod interface {
FindMethod(mtyp reflect.Type, fn *types.Func) func([]reflect.Value) []reflect.Value
}
type TypesRecord struct {
ctx *Context
rctx *reflectx.Context // reflectx context
prog *ssa.Program
loader Loader
finder FindMethod
rcache map[reflect.Type]types.Type
tcache *typeutil.Map
ncache *typeutil.Map //nested cache
fntargs string //reflect type arguments used to instantiate the current func
nested map[*types.Named]int
nstack nestedStack
ninst int // nested instance counter
}
type mfnKey struct {
typ reflect.Type
name string
indexs string
pointer bool
indirect bool
}
type mfnValue struct {
fn func([]reflect.Value) []reflect.Value
id int
}
func indexsToString(index []int) string {
var sb strings.Builder
for _, v := range index {
sb.WriteByte('.')
sb.WriteString(strconv.Itoa(v))
}
return sb.String()
}
func (r *TypesRecord) Release() {
r.loader = nil
r.rcache = nil
r.tcache = nil
r.ncache = nil
r.finder = nil
r.nested = nil
}
func NewTypesRecord(ctx *Context, rctx *reflectx.Context, prog *ssa.Program, loader Loader, finder FindMethod, nested map[*types.Named]int) *TypesRecord {
return &TypesRecord{
ctx: ctx,
rctx: rctx,
prog: prog,
loader: loader,
finder: finder,
rcache: make(map[reflect.Type]types.Type),
tcache: &typeutil.Map{},
nested: nested,
}
}
func (r *TypesRecord) LookupLocalTypes(rt reflect.Type) (typ types.Type, ok bool) {
typ, ok = r.rcache[rt]
return
}
func (r *TypesRecord) LookupTypes(rt reflect.Type) (typ types.Type, ok bool) {
typ, ok = r.loader.LookupTypes(rt)
if !ok {
typ, ok = r.rcache[rt]
}
return
}
func (r *TypesRecord) saveType(typ types.Type, rt reflect.Type, nested bool) {
r.rcache[rt] = typ
if nested {
r.ncache.Set(typ, rt)
return
}
r.tcache.Set(typ, rt)
return
}
func (r *TypesRecord) ToType(typ types.Type) (reflect.Type, bool) {
if rt, ok, nested := r.lookupCache(typ); ok {
return rt, nested
}
var nested bool
var rt reflect.Type
switch t := typ.(type) {
case *types.Basic:
kind := t.Kind()
if kind > types.Invalid && kind < types.UntypedNil {
rt = xtypeTypes[kind]
}
case *types.Pointer:
var elem reflect.Type
elem, nested = r.ToType(t.Elem())
rt = reflect.PtrTo(elem)
case *types.Slice:
var elem reflect.Type
elem, nested = r.ToType(t.Elem())
rt = reflect.SliceOf(elem)
case *types.Array:
var elem reflect.Type
elem, nested = r.ToType(t.Elem())
rt = reflect.ArrayOf(int(t.Len()), elem)
case *types.Map:
key, n1 := r.ToType(t.Key())
elem, n2 := r.ToType(t.Elem())
nested = n1 || n2
rt = reflect.MapOf(key, elem)
case *types.Chan:
var elem reflect.Type
elem, nested = r.ToType(t.Elem())
rt = reflect.ChanOf(toReflectChanDir(t.Dir()), elem)
case *types.Struct:
rt, nested = r.toStructType(t, true)
case *types.Named:
rt, nested = r.toNamedType(t)
case *types.Interface:
rt, nested = r.toInterfaceType(t)
case *types.Signature:
in, n1 := r.ToTypeList(t.Params())
out, n2 := r.ToTypeList(t.Results())
nested = n1 || n2
b := t.Variadic()
if b && len(in) > 0 {
last := in[len(in)-1]
if last.Kind() == reflect.String {
in[len(in)-1] = reflect.TypeOf([]byte{})
}
}
rt = reflect.FuncOf(in, out, b)
case *types.Tuple:
_, nested = r.ToTypeList(t)
rt = reflect.TypeOf((*_tuple)(nil)).Elem()
case *types.Alias:
return r.ToType(types.Unalias(t))
default:
panic(fmt.Errorf("ToType: not handled %T", typ))
}
r.saveType(typ, rt, nested)
return rt, nested
}
type _tuple struct{}
func (r *TypesRecord) toInterfaceType(t *types.Interface) (reflect.Type, bool) {
n := t.NumMethods()
if n == 0 {
return tyEmptyInterface, false
}
var nested bool
ms := make([]reflect.Method, n)
for i := 0; i < n; i++ {
fn := t.Method(i)
mtyp, n := r.ToType(fn.Type())
if n {
nested = true
}
ms[i] = reflect.Method{
Name: fn.Name(),
Type: mtyp,
}
if pkg := fn.Pkg(); pkg != nil {
ms[i].PkgPath = pkg.Path()
}
}
rctxInterfaceOfMu.Lock()
defer rctxInterfaceOfMu.Unlock()
return r.rctx.InterfaceOf(nil, ms), nested
}
func (r *TypesRecord) toNamedType(t *types.Named) (reflect.Type, bool) {
if rt, ok := r.loader.LookupReflect(t); ok {
return rt, false
}
ut := t.Underlying()
pkgpath, name, typeargs, nested := r.extractNamed(t, false)
if pkgpath == "" {
if name == "error" {
return tyErrorInterface, false
}
return r.ToType(ut)
}
etyp := toMockType(ut)
typ := reflectx.NamedTypeOf(pkgpath, name, etyp)
var hasMethod bool
var methods []*types.Selection
if _, ok := ut.(*types.Interface); !ok {
var pcount, mcount int
methods, pcount, mcount = r.extractMethodSet(t)
if hasMethod = pcount > 0; hasMethod {
typ = r.rctx.NewMethodSet(typ, mcount, pcount)
}
}
r.saveType(t, typ, nested)
var utype reflect.Type
if st, ok := ut.(*types.Struct); ok {
utype, _ = r.toStructType(st, false)
} else {
utype, _ = r.ToType(ut)
}
reflectx.SetUnderlying(typ, utype)
if typeargs {
pkgpath, name, _, _ = r.extractNamed(t, true)
reflectx.SetTypeName(typ, pkgpath, name)
}
if hasMethod {
r.setMethods(typ, methods)
}
return typ, nested
}
// extractMethodSet builds the combined method list for T. For each method in
// the pointer-receiver set, it prefers the value-receiver selection when one
// exists at an equal or shallower embedding depth (shorter Index), since that
// selection is the canonical one for non-pointer dispatch.
func (r *TypesRecord) extractMethodSet(T types.Type) (methods []*types.Selection, pcount int, mcount int) {
pmset := r.prog.MethodSets.MethodSet(types.NewPointer(T))
pcount = pmset.Len()
if pcount == 0 {
return
}
mset := r.prog.MethodSets.MethodSet(T)
mcount = mset.Len()
if !typesutil.SupportsGenericMethods {
methods = make([]*types.Selection, pcount)
if mcount == 0 {
for i := 0; i < pcount; i++ {
methods[i] = pmset.At(i)
}
} else {
mcache := make(map[string]*types.Selection)
for i := 0; i < mcount; i++ {
meth := mset.At(i)
mcache[meth.Obj().Name()] = meth
}
for i := 0; i < pcount; i++ {
meth := pmset.At(i)
// Prefer the value-receiver selection (m) only when its embedding depth
// is no greater than the pointer-receiver entry (meth). A deeper m would
// mean meth is the more direct promotion and should not be replaced.
if m, ok := mcache[meth.Obj().Name()]; ok && len(meth.Index()) >= len(m.Index()) {
meth = m
}
methods[i] = meth
}
}
} else {
methods = make([]*types.Selection, pcount)
if mcount == 0 {
for i, index, n := 0, 0, pcount; i < n; i++ {
meth := pmset.At(i)
if isGenericMethod(meth) {
pcount--
continue
}
methods[index] = meth
index++
}
methods = methods[:pcount]
} else {
mcache := make(map[string]*types.Selection)
for i, n := 0, mcount; i < n; i++ {
meth := mset.At(i)
if isGenericMethod(meth) {
mcount--
continue
}
mcache[meth.Obj().Name()] = meth
}
for i, index, n := 0, 0, pcount; i < n; i++ {
meth := pmset.At(i)
if isGenericMethod(meth) {
pcount--
continue
}
// Prefer the value-receiver selection (m) only when its embedding depth
// is no greater than the pointer-receiver entry (meth). A deeper m would
// mean meth is the more direct promotion and should not be replaced.
if m, ok := mcache[meth.Obj().Name()]; ok && len(meth.Index()) >= len(m.Index()) {
meth = m
}
methods[index] = meth
index++
}
methods = methods[:pcount]
}
}
return
}
func (r *TypesRecord) toStructType(t *types.Struct, mset bool) (reflect.Type, bool) {
n := t.NumFields()
if n == 0 {
return tyEmptyStruct, false
}
var nested bool
flds := make([]reflect.StructField, n)
for i := 0; i < n; i++ {
f := t.Field(i)
typ, n := r.ToType(f.Type())
if n {
nested = true
}
flds[i] = r.toStructField(f, typ, t.Tag(i))
}
typ := r.toStruct(flds)
if mset {
methods, pcount, mcount := r.extractMethodSet(t)
if pcount > 0 {
typ = r.rctx.NewMethodSet(typ, mcount, pcount)
r.setMethods(typ, methods)
}
}
return typ, nested
}
func (r *TypesRecord) toStruct(flds []reflect.StructField) reflect.Type {
rctxStructOfMu.Lock()
defer rctxStructOfMu.Unlock()
return r.rctx.StructOf(flds)
}
func (r *TypesRecord) toStructField(v *types.Var, typ reflect.Type, tag string) reflect.StructField {
name := v.Name()
fld := reflect.StructField{
Name: name,
Type: typ,
Tag: reflect.StructTag(tag),
Anonymous: v.Anonymous(),
}
if !token.IsExported(name) {
if pkg := v.Pkg(); pkg != nil {
fld.PkgPath = pkg.Path()
} else {
// fix golang.org/x/tools@v0.29 or higher invalid prog.RuntimeTypes struct{in string; out string}
fld.PkgPath = "_"
}
}
return fld
}
func (r *TypesRecord) ToTypeList(tuple *types.Tuple) ([]reflect.Type, bool) {
n := tuple.Len()
if n == 0 {
return nil, false
}
var nested bool
var ne bool
list := make([]reflect.Type, n)
for i := 0; i < n; i++ {
list[i], ne = r.ToType(tuple.At(i).Type())
if ne {
nested = true
}
}
return list, nested
}
func isPointer(typ types.Type) bool {
_, ok := typ.Underlying().(*types.Pointer)
return ok
}
func embedFunc(typ reflect.Type, name string, idx []int, pointer bool, indirect bool, variadic bool) func([]reflect.Value) []reflect.Value {
switch kind := typ.Kind(); kind {
case reflect.Interface:
if variadic {
return func(args []reflect.Value) []reflect.Value {
v := reflectx.FieldByIndexX(args[0], idx[:len(idx)-1])
return v.MethodByName(name).CallSlice(args[1:])
}
}
return func(args []reflect.Value) []reflect.Value {
v := reflectx.FieldByIndexX(args[0], idx[:len(idx)-1])
return v.MethodByName(name).Call(args[1:])
}
case reflect.Ptr:
if pointer {
m, _ := reflectx.MethodByName(typ, name)
if variadic {
return func(args []reflect.Value) []reflect.Value {
args[0] = reflectx.FieldByIndexX(args[0].Elem(), idx[:len(idx)-1]).Addr()
return m.Func.CallSlice(args)
}
}
return func(args []reflect.Value) []reflect.Value {
args[0] = reflectx.FieldByIndexX(args[0].Elem(), idx[:len(idx)-1]).Addr()
return m.Func.Call(args)
}
}
fallthrough
default:
if indirect && kind != reflect.Ptr {
typ = reflect.PointerTo(typ)
}
m, _ := reflectx.MethodByName(typ, name)
if variadic {
return func(args []reflect.Value) []reflect.Value {
args[0] = reflectx.FieldByIndexX(args[0], idx[:len(idx)-1])
return m.Func.CallSlice(args)
}
}
return func(args []reflect.Value) []reflect.Value {
args[0] = reflectx.FieldByIndexX(args[0], idx[:len(idx)-1])
return m.Func.Call(args)
}
}
}
// mfnMap and mfnId are process-global: they cache embed-func closures across
// all Context instances. Entries are never evicted. Closures stored here must
// not capture any per-Context state.
var (
mfnId int64
mfnMap sync.Map
)
var (
rctxMethodMu sync.Mutex // reflectx set method mutex
rctxInterfaceOfMu sync.Mutex // reflectx interfaceof mutex
rctxStructOfMu sync.Mutex // reflectx structof mutex
)
func (r *TypesRecord) setMethods(typ reflect.Type, methods []*types.Selection) {
numMethods := len(methods)
ms := make([]reflectx.Method, numMethods)
checkXGo := r.ctx.Mode&CheckGopOverloadFunc != 0
for i := 0; i < numMethods; i++ {
fn := methods[i].Obj().(*types.Func)
sig := methods[i].Type().(*types.Signature)
pointer := isPointer(sig.Recv().Type())
mtyp, _ := r.ToType(sig)
var mfn func(args []reflect.Value) []reflect.Value
idx := methods[i].Index()
var mid int
if checkXGo && isXGoOverloadFunc(sig) {
mid = -1
} else if len(idx) > 1 {
indirect := methods[i].Indirect()
rtyp := fn.Type().Underlying().(*types.Signature).Recv().Type()
rt, _ := r.ToType(rtyp)
key := mfnKey{typ: rt, name: fn.Name(), indexs: indexsToString(idx), pointer: pointer, indirect: indirect}
actual, ok := mfnMap.Load(key)
if !ok {
variadic := mtyp.IsVariadic()
v := &mfnValue{
fn: embedFunc(rt, fn.Name(), idx, pointer, indirect, variadic),
id: int(atomic.AddInt64(&mfnId, 1)),
}
actual, _ = mfnMap.LoadOrStore(key, v)
}
v := actual.(*mfnValue)
mfn = v.fn
mid = v.id
} else {
mfn = r.finder.FindMethod(mtyp, fn)
}
var pkgpath string
if pkg := fn.Pkg(); pkg != nil {
pkgpath = pkg.Path()
}
ms[i] = reflectx.MakeMethod(fn.Name(), pkgpath, pointer, mtyp, mfn)
ms[i].FuncId = mid
}
rctxMethodMu.Lock()
err := r.rctx.SetRawMethods(typ, ms)
rctxMethodMu.Unlock()
if err != nil {
log.Fatalf("SetRawMethods %v err, %v\n", typ, err)
}
}
func toReflectChanDir(d types.ChanDir) reflect.ChanDir {
switch d {
case types.SendRecv:
return reflect.BothDir
case types.SendOnly:
return reflect.SendDir
case types.RecvOnly:
return reflect.RecvDir
}
return 0
}
func (r *TypesRecord) Load(pkg *ssa.Package) {
checked := make(map[types.Type]bool)
for _, v := range pkg.Members {
typ := v.Type()
if checked[typ] {
continue
}
checked[typ] = true
if hasTypeParam(typ) {
continue
}
r.ToType(typ)
}
}
const (
overloadArgs = "__xgo_overload_args__"
)
func isXGoOverloadFunc(sig *types.Signature) bool {
if sig.Params().Len() == 1 {
if param := sig.Params().At(0); param.Name() == overloadArgs {
if typ, ok := param.Type().(*types.Interface); ok && typ.NumExplicitMethods() == 1 {
if sig, ok := typ.ExplicitMethod(0).Type().(*types.Signature); ok {
if recv := sig.Recv(); recv != nil {
return true
}
}
}
}
}
return false
}