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
347// name: dump()347// name: dump()
348// desc: output current state (can be overridden)348// desc: output current state (can be overridden)
349//-----------------------------------------------------------------------------349//-----------------------------------------------------------------------------
350void Chuck_Object::dump() // 1.4.1.0350void Chuck_Object::dump() // 1.4.1.1 (ge)
351{351{
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 );
353}357}
354 358
355 359
356 360
357 361
358//-----------------------------------------------------------------------------362//-----------------------------------------------------------------------------
359// name: apropos()363// name: help()
360// desc: output interface (can be overriden; but probably shouldn't be)364// desc: output type info (can be overriden; but probably shouldn't be)
361//-----------------------------------------------------------------------------365//-----------------------------------------------------------------------------
362void Chuck_Object::apropos() // 1.4.1.0366void Chuck_Object::help() // 1.4.1.0 (ge)
363{367{
364 // type to unpack368 // type to unpack
365 Chuck_Type * type = this->type_ref;369 Chuck_Type * type = this->type_ref;
366 370
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
378 // unpack type and output its info371 // unpack type and output its info
379 type->apropos();372 type->apropos();
380}373}

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