github.com/traefik/yaegi@v0.15.1/stdlib/go1_19_fmt.go (about)

     1  // Code generated by 'yaegi extract fmt'. DO NOT EDIT.
     2  
     3  //go:build go1.19 && !go1.20
     4  // +build go1.19,!go1.20
     5  
     6  package stdlib
     7  
     8  import (
     9  	"fmt"
    10  	"reflect"
    11  )
    12  
    13  func init() {
    14  	Symbols["fmt/fmt"] = map[string]reflect.Value{
    15  		// function, constant and variable definitions
    16  		"Append":   reflect.ValueOf(fmt.Append),
    17  		"Appendf":  reflect.ValueOf(fmt.Appendf),
    18  		"Appendln": reflect.ValueOf(fmt.Appendln),
    19  		"Errorf":   reflect.ValueOf(fmt.Errorf),
    20  		"Fprint":   reflect.ValueOf(fmt.Fprint),
    21  		"Fprintf":  reflect.ValueOf(fmt.Fprintf),
    22  		"Fprintln": reflect.ValueOf(fmt.Fprintln),
    23  		"Fscan":    reflect.ValueOf(fmt.Fscan),
    24  		"Fscanf":   reflect.ValueOf(fmt.Fscanf),
    25  		"Fscanln":  reflect.ValueOf(fmt.Fscanln),
    26  		"Print":    reflect.ValueOf(fmt.Print),
    27  		"Printf":   reflect.ValueOf(fmt.Printf),
    28  		"Println":  reflect.ValueOf(fmt.Println),
    29  		"Scan":     reflect.ValueOf(fmt.Scan),
    30  		"Scanf":    reflect.ValueOf(fmt.Scanf),
    31  		"Scanln":   reflect.ValueOf(fmt.Scanln),
    32  		"Sprint":   reflect.ValueOf(fmt.Sprint),
    33  		"Sprintf":  reflect.ValueOf(fmt.Sprintf),
    34  		"Sprintln": reflect.ValueOf(fmt.Sprintln),
    35  		"Sscan":    reflect.ValueOf(fmt.Sscan),
    36  		"Sscanf":   reflect.ValueOf(fmt.Sscanf),
    37  		"Sscanln":  reflect.ValueOf(fmt.Sscanln),
    38  
    39  		// type definitions
    40  		"Formatter":  reflect.ValueOf((*fmt.Formatter)(nil)),
    41  		"GoStringer": reflect.ValueOf((*fmt.GoStringer)(nil)),
    42  		"ScanState":  reflect.ValueOf((*fmt.ScanState)(nil)),
    43  		"Scanner":    reflect.ValueOf((*fmt.Scanner)(nil)),
    44  		"State":      reflect.ValueOf((*fmt.State)(nil)),
    45  		"Stringer":   reflect.ValueOf((*fmt.Stringer)(nil)),
    46  
    47  		// interface wrapper definitions
    48  		"_Formatter":  reflect.ValueOf((*_fmt_Formatter)(nil)),
    49  		"_GoStringer": reflect.ValueOf((*_fmt_GoStringer)(nil)),
    50  		"_ScanState":  reflect.ValueOf((*_fmt_ScanState)(nil)),
    51  		"_Scanner":    reflect.ValueOf((*_fmt_Scanner)(nil)),
    52  		"_State":      reflect.ValueOf((*_fmt_State)(nil)),
    53  		"_Stringer":   reflect.ValueOf((*_fmt_Stringer)(nil)),
    54  	}
    55  }
    56  
    57  // _fmt_Formatter is an interface wrapper for Formatter type
    58  type _fmt_Formatter struct {
    59  	IValue  interface{}
    60  	WFormat func(f fmt.State, verb rune)
    61  }
    62  
    63  func (W _fmt_Formatter) Format(f fmt.State, verb rune) {
    64  	W.WFormat(f, verb)
    65  }
    66  
    67  // _fmt_GoStringer is an interface wrapper for GoStringer type
    68  type _fmt_GoStringer struct {
    69  	IValue    interface{}
    70  	WGoString func() string
    71  }
    72  
    73  func (W _fmt_GoStringer) GoString() string {
    74  	return W.WGoString()
    75  }
    76  
    77  // _fmt_ScanState is an interface wrapper for ScanState type
    78  type _fmt_ScanState struct {
    79  	IValue      interface{}
    80  	WRead       func(buf []byte) (n int, err error)
    81  	WReadRune   func() (r rune, size int, err error)
    82  	WSkipSpace  func()
    83  	WToken      func(skipSpace bool, f func(rune) bool) (token []byte, err error)
    84  	WUnreadRune func() error
    85  	WWidth      func() (wid int, ok bool)
    86  }
    87  
    88  func (W _fmt_ScanState) Read(buf []byte) (n int, err error) {
    89  	return W.WRead(buf)
    90  }
    91  func (W _fmt_ScanState) ReadRune() (r rune, size int, err error) {
    92  	return W.WReadRune()
    93  }
    94  func (W _fmt_ScanState) SkipSpace() {
    95  	W.WSkipSpace()
    96  }
    97  func (W _fmt_ScanState) Token(skipSpace bool, f func(rune) bool) (token []byte, err error) {
    98  	return W.WToken(skipSpace, f)
    99  }
   100  func (W _fmt_ScanState) UnreadRune() error {
   101  	return W.WUnreadRune()
   102  }
   103  func (W _fmt_ScanState) Width() (wid int, ok bool) {
   104  	return W.WWidth()
   105  }
   106  
   107  // _fmt_Scanner is an interface wrapper for Scanner type
   108  type _fmt_Scanner struct {
   109  	IValue interface{}
   110  	WScan  func(state fmt.ScanState, verb rune) error
   111  }
   112  
   113  func (W _fmt_Scanner) Scan(state fmt.ScanState, verb rune) error {
   114  	return W.WScan(state, verb)
   115  }
   116  
   117  // _fmt_State is an interface wrapper for State type
   118  type _fmt_State struct {
   119  	IValue     interface{}
   120  	WFlag      func(c int) bool
   121  	WPrecision func() (prec int, ok bool)
   122  	WWidth     func() (wid int, ok bool)
   123  	WWrite     func(b []byte) (n int, err error)
   124  }
   125  
   126  func (W _fmt_State) Flag(c int) bool {
   127  	return W.WFlag(c)
   128  }
   129  func (W _fmt_State) Precision() (prec int, ok bool) {
   130  	return W.WPrecision()
   131  }
   132  func (W _fmt_State) Width() (wid int, ok bool) {
   133  	return W.WWidth()
   134  }
   135  func (W _fmt_State) Write(b []byte) (n int, err error) {
   136  	return W.WWrite(b)
   137  }
   138  
   139  // _fmt_Stringer is an interface wrapper for Stringer type
   140  type _fmt_Stringer struct {
   141  	IValue  interface{}
   142  	WString func() string
   143  }
   144  
   145  func (W _fmt_Stringer) String() string {
   146  	if W.WString == nil {
   147  		return ""
   148  	}
   149  	return W.WString()
   150  }