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