Ticket #1378: iglobals_hash_example.patch
| File iglobals_hash_example.patch, 1.2 KB (added by cotto, 3 years ago) |
|---|
-
src/pmc/parrotinterpreter.pmc
441 441 "outer"; "<item>" ... same for outer level 1 442 442 "outer"; "<item>"; level ... same for outer <level> 443 443 "globals" ... return global stash 444 "iglobals" ... return a string-indexed hash of iglobals 444 445 445 446 =cut 446 447 … … 562 563 return pmc_new(interp, enum_class_Hash); 563 564 } 564 565 566 name = CONST_STRING(interp, "iglobals"); 567 568 if (Parrot_str_equal(interp, item, name)) { 569 PMC *ig_hash = pmc_new(interp, enum_class_Hash); 570 PMC *one = pmc_new(interp, enum_class_Integer); 571 572 VTABLE_set_pmc_keyed_str(interp, ig_hash, CONST_STRING(interp, "classname_hash"), interp->class_hash); 573 574 VTABLE_set_integer_native(interp, one, 1); 575 VTABLE_setprop(interp, ig_hash, CONST_STRING(interp, "_ro"), one); 576 577 return ig_hash; 578 } 579 565 580 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND, 566 581 "No such item %Ss", item); 567 582 }
