github.com/goplus/gogen@v1.16.0/internal/foo/foo.go (about)

     1  /*
     2   Copyright 2021 The GoPlus Authors (goplus.org)
     3   Licensed under the Apache License, Version 2.0 (the "License");
     4   you may not use this file except in compliance with the License.
     5   You may obtain a copy of the License at
     6       http://www.apache.org/licenses/LICENSE-2.0
     7   Unless required by applicable law or agreed to in writing, software
     8   distributed under the License is distributed on an "AS IS" BASIS,
     9   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    10   See the License for the specific language governing permissions and
    11   limitations under the License.
    12  */
    13  
    14  package foo
    15  
    16  import (
    17  	"github.com/goplus/gogen/internal/bar"
    18  )
    19  
    20  const (
    21  	GopPackage = true // to indicate this is a Go+ package
    22  )
    23  
    24  func CallBar() *bar.Game {
    25  	return nil
    26  }
    27  
    28  // -----------------------------------------------------------------------------
    29  
    30  type nodeSetIt struct {
    31  }
    32  
    33  func (p *nodeSetIt) Next() (key int, val string, ok bool) {
    34  	return
    35  }
    36  
    37  // -----------------------------------------------------------------------------
    38  
    39  type NodeSet struct {
    40  }
    41  
    42  func (p NodeSet) Gop_Enum() *nodeSetIt {
    43  	return &nodeSetIt{}
    44  }
    45  
    46  func (p NodeSet) Len__0() int {
    47  	return 0
    48  }
    49  
    50  func (p NodeSet) Attr__0(k string, exactlyOne ...bool) (text string, err error) {
    51  	return
    52  }
    53  
    54  func (p NodeSet) Attr__1(k, v string) (ret NodeSet) {
    55  	return
    56  }
    57  
    58  // -----------------------------------------------------------------------------
    59  
    60  type barIt struct {
    61  }
    62  
    63  func (p barIt) Next() (val string, ok bool) {
    64  	return
    65  }
    66  
    67  type Bar struct {
    68  }
    69  
    70  func (p *Bar) Gop_Enum() barIt {
    71  	return barIt{}
    72  }
    73  
    74  // -----------------------------------------------------------------------------
    75  
    76  type Foo struct {
    77  }
    78  
    79  func (p *Foo) Gop_Enum(c func(v string)) {
    80  }
    81  
    82  func (a Foo) Gop_Add(b Foo) Foo {
    83  	return Foo{}
    84  }
    85  
    86  // -----------------------------------------------------------------------------
    87  
    88  type Foo2 struct {
    89  }
    90  
    91  func (p Foo2) Gop_Enum(c func(k int, v string)) {
    92  }
    93  
    94  // -----------------------------------------------------------------------------
    95  
    96  type Foo3 struct {
    97  }
    98  
    99  func (p Foo3) Gop_Enum(c func(k int, v string)) int {
   100  	return 0
   101  }
   102  
   103  // -----------------------------------------------------------------------------
   104  
   105  type Foo4 struct {
   106  }
   107  
   108  func (p Foo4) Gop_Enum(c func()) {
   109  }
   110  
   111  // -----------------------------------------------------------------------------
   112  
   113  type NodeSeter interface {
   114  	Len__0() int
   115  	Attr__0(k string, exactlyOne ...bool) (text string, err error)
   116  	Attr__1(k, v string) (ret NodeSeter)
   117  }
   118  
   119  // -----------------------------------------------------------------------------