@@ -121,47 +121,7 @@ impl<'a> VM<'a> {
121121 HeapObj :: BigInt ( b) => b. to_decimal ( ) ,
122122 HeapObj :: Type ( name) => format ! ( "<class '{}'>" , name) ,
123123 HeapObj :: Func ( i, _, _) => format ! ( "<function {}>" , i) ,
124- HeapObj :: BoundMethod ( _, id) => match id {
125- BuiltinMethodId :: ListAppend => "<built-in method append>" . into ( ) ,
126- BuiltinMethodId :: DictKeys => "<built-in method keys>" . into ( ) ,
127- BuiltinMethodId :: DictValues => "<built-in method values>" . into ( ) ,
128- BuiltinMethodId :: DictItems => "<built-in method items>" . into ( ) ,
129- BuiltinMethodId :: StrUpper => "<built-in method upper>" . into ( ) ,
130- BuiltinMethodId :: StrLower => "<built-in method lower>" . into ( ) ,
131- BuiltinMethodId :: StrStrip => "<built-in method strip>" . into ( ) ,
132- BuiltinMethodId :: StrSplit => "<built-in method split>" . into ( ) ,
133- BuiltinMethodId :: StrJoin => "<built-in method join>" . into ( ) ,
134- BuiltinMethodId :: StrReplace => "<built-in method replace>" . into ( ) ,
135- BuiltinMethodId :: StrStartswith => "<built-in method startswith>" . into ( ) ,
136- BuiltinMethodId :: StrEndswith => "<built-in method endswith>" . into ( ) ,
137- BuiltinMethodId :: StrFind => "<built-in method find>" . into ( ) ,
138- BuiltinMethodId :: StrCount => "<built-in method count>" . into ( ) ,
139- BuiltinMethodId :: ListSort => "<built-in method sort>" . into ( ) ,
140- BuiltinMethodId :: ListReverse => "<built-in method reverse>" . into ( ) ,
141- BuiltinMethodId :: ListPop => "<built-in method pop>" . into ( ) ,
142- BuiltinMethodId :: ListInsert => "<built-in method insert>" . into ( ) ,
143- BuiltinMethodId :: ListRemove => "<built-in method remove>" . into ( ) ,
144- BuiltinMethodId :: ListIndex => "<built-in method index>" . into ( ) ,
145- BuiltinMethodId :: ListCount => "<built-in method count>" . into ( ) ,
146- BuiltinMethodId :: DictGet => "<built-in method get>" . into ( ) ,
147- BuiltinMethodId :: DictUpdate => "<built-in method update>" . into ( ) ,
148- BuiltinMethodId :: DictPop => "<built-in method pop>" . into ( ) ,
149- BuiltinMethodId :: DictSetDefault => "<built-in method setdefault>" . into ( ) ,
150- BuiltinMethodId :: StrLstrip => "<built-in method lstrip>" . into ( ) ,
151- BuiltinMethodId :: StrRstrip => "<built-in method rstrip>" . into ( ) ,
152- BuiltinMethodId :: StrIsDigit => "<built-in method isdigit>" . into ( ) ,
153- BuiltinMethodId :: StrIsAlpha => "<built-in method isalpha>" . into ( ) ,
154- BuiltinMethodId :: StrIsAlnum => "<built-in method isalnum>" . into ( ) ,
155- BuiltinMethodId :: StrCapitalize => "<built-in method capitalize>" . into ( ) ,
156- BuiltinMethodId :: StrTitle => "<built-in method title>" . into ( ) ,
157- BuiltinMethodId :: StrCenter => "<built-in method center>" . into ( ) ,
158- BuiltinMethodId :: StrZfill => "<built-in method zfill>" . into ( ) ,
159- BuiltinMethodId :: ListExtend => "<built-in method extend>" . into ( ) ,
160- BuiltinMethodId :: ListClear => "<built-in method clear>" . into ( ) ,
161- BuiltinMethodId :: ListCopy => "<built-in method copy>" . into ( ) ,
162- } ,
163- HeapObj :: Slice ( s, e, st) => format ! ( "slice({}, {}, {})" ,
164- self . display( * s) , self . display( * e) , self . display( * st) ) ,
124+ HeapObj :: Slice ( s, e, st) => format ! ( "slice({}, {}, {})" , self . display( * s) , self . display( * e) , self . display( * st) ) ,
165125 HeapObj :: Range ( s, e, st) => if * st == 1 {
166126 format ! ( "range({}, {})" , s, e)
167127 } else {
@@ -173,9 +133,8 @@ impl<'a> VM<'a> {
173133 } else {
174134 format ! ( "({})" , self . join_reprs( t. iter( ) ) )
175135 } ,
176- HeapObj :: Dict ( d) => format ! ( "{{{}}}" , d. borrow( ) . iter( )
177- . map( |( k, v) | format!( "{}: {}" , self . repr( k) , self . repr( v) ) )
178- . collect:: <Vec <_>>( ) . join( ", " ) ) ,
136+ HeapObj :: Dict ( d) => format ! ( "{{{}}}" , d. borrow( ) . iter( ) . map( |( k, v) | format!( "{}: {}" , self . repr( k) , self . repr( v) ) ) . collect:: <Vec <_>>( ) . join( ", " ) ) ,
137+ HeapObj :: BoundMethod ( _, id) => format ! ( "<built-in method {}>" , id. name( ) ) ,
179138 HeapObj :: Set ( s) => {
180139 let mut items: Vec < Val > = s. borrow ( ) . iter ( ) . cloned ( ) . collect ( ) ;
181140 if items. is_empty ( ) { return "set()" . into ( ) ; }
0 commit comments