History

prep for type dump functionality

Ge Wang committed 5 years ago

Commit 5f0f95d1 parent 438fb826 files · +77 −39Browse files

Showing the changes to src/core/chuck_oo.cpp (1 of 6 files). Show all

Unified · Split

src/core/chuck_oo.cpp+9−16
@@ -347,34 +347,27 @@ Chuck_Object::~Chuck_Object() · 346 unmodified lines
347347 // name: dump()
348348 // desc: output current state (can be overridden)
349349 //-----------------------------------------------------------------------------
350−void Chuck_Object::dump() // 1.4.1.0
350+void Chuck_Object::dump() // 1.4.1.1 (ge)
351351 {
352− // TODO: implement!
352+ // need type info
353+ Chuck_Type * type = this->type_ref;
354+
355+ // output state with type info
356+ type->dump( this );
353357 }
354358
355359
356360
357361
358362 //-----------------------------------------------------------------------------
359−// name: apropos()
360−// desc: output interface (can be overriden; but probably shouldn't be)
363+// name: help()
364+// desc: output type info (can be overriden; but probably shouldn't be)
361365 //-----------------------------------------------------------------------------
362−void Chuck_Object::apropos() // 1.4.1.0
366+void Chuck_Object::help() // 1.4.1.0 (ge)
363367 {
364368 // type to unpack
365369 Chuck_Type * type = this->type_ref;
366370
367− // if type is generic "@array"
368− if( type->xid == te_array )
369− {
370− // get more specific
371− Chuck_Array * arr = (Chuck_Array *)this;
372− // however, a number of chuck array allocations still do not
373− // set the m_array_type member; update to this only if it exists
374− if( arr->m_array_type != NULL )
375− type = arr->m_array_type;
376− }
377−
378371 // unpack type and output its info
379372 type->apropos();
380373 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t