Ticket #71: class_registry.diff
File class_registry.diff, 81.8 KB (added by tewk, 13 years ago) |
---|
-
src/oo.c
45 45 __attribute__nonnull__(2) 46 46 __attribute__nonnull__(3); 47 47 48 static voidfail_if_type_exists(PARROT_INTERP, ARGIN(PMC *name))48 static INTVAL fail_if_type_exists(PARROT_INTERP, ARGIN(PMC *name)) 49 49 __attribute__nonnull__(1) 50 50 __attribute__nonnull__(2); 51 51 … … 423 423 return Parrot_mmd_func_names[idx]; 424 424 } 425 425 426 427 /*428 429 =item C<PMC * Parrot_class_lookup>430 431 Looks for the class named C<class_name> and returns it if it exists.432 Otherwise it returns C<PMCNULL>.433 434 =cut435 436 */437 438 PARROT_EXPORT439 PARROT_CAN_RETURN_NULL440 426 PARROT_WARN_UNUSED_RESULT 441 PMC * 442 Parrot_class_lookup(PARROT_INTERP, ARGIN(STRING *class_name)) 443 { 444 const INTVAL type = pmc_type(interp, class_name); 445 PMC *pmc; 427 INTVAL lookup_typeid_s(PARROT_INTERP, ARGIN(STRING *name)) { 428 PMC *string_pmc = pmc_new(interp, enum_class_String); 429 VTABLE_set_string_native(interp, string_pmc, name); 446 430 447 if (type <= 0) 448 return PMCNULL; 449 450 pmc = interp->vtables[type]->pmc_class; 451 PARROT_ASSERT(pmc); 452 return pmc; 431 return lookup_typeid(interp, string_pmc); 453 432 } 454 433 434 PARROT_WARN_UNUSED_RESULT 435 INTVAL lookup_typeid(PARROT_INTERP, ARGIN(PMC *name)) { 436 PMC *ns; 437 /* Fast select of behavior based on type of the lookup key */ 455 438 456 /* 439 switch (name->vtable->base_type) { 440 case enum_class_NameSpace: 441 ns = name; 442 break; 443 case enum_class_String: 444 case enum_class_Key: 445 case enum_class_ResizableStringArray: 446 { 447 PMC *base_ns; 448 base_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace, 449 CONTEXT(interp)->current_HLL); 450 ns = Parrot_get_namespace_keyed(interp, base_ns, name); 451 //ns = Parrot_get_namespace_autobase(interp, name); 452 } 453 break; 454 default: 455 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR, 456 "Unrecognized type name PMC type %Ss", name->vtable->whoami ); 457 break; 458 } 457 459 458 =item C<PMC * Parrot_class_lookup_p> 460 if (!PMC_IS_NULL(ns)) { 461 PMC *classobj = VTABLE_get_class(interp, ns); 462 if (!PMC_IS_NULL(classobj)) { 463 return VTABLE_type(interp, classobj); 464 } 465 } 459 466 460 Looks for the class named C<class_name> and returns it if it exists. 461 Otherwise it returns C<PMCNULL>. 467 if (name->vtable->base_type == enum_class_String) { 468 /* Look up a low-level class*/ 469 const INTVAL type = pmc_type(interp, VTABLE_get_string(interp, name)); 462 470 463 =cut 464 465 */ 466 467 PARROT_CAN_RETURN_NULL 468 PARROT_WARN_UNUSED_RESULT 469 PMC * 470 Parrot_class_lookup_p(PARROT_INTERP, ARGIN(PMC *class_name)) 471 { 472 const INTVAL type = pmc_type_p(interp, class_name); 473 PMC *pmc; 474 475 if (type <= 0) 476 return PMCNULL; 477 478 pmc = interp->vtables[type]->pmc_class; 479 PARROT_ASSERT(pmc); 480 return pmc; 471 /* Reject invalid type numbers */ 472 if (type > interp->n_vtable_max) 473 return 0; 474 else 475 return type; 476 } 477 return 0; 481 478 } 482 479 483 484 480 /* 485 481 486 482 =item C<static void fail_if_type_exists> … … 494 490 495 491 */ 496 492 497 static void493 static INTVAL 498 494 fail_if_type_exists(PARROT_INTERP, ARGIN(PMC *name)) 499 495 { 500 INTVAL type; 496 PMC *ns; 497 /* Parrot_printf(interp, "%Ss\n", VTABLE_get_repr(interp, name)); */ 498 /* Fast select of behavior based on type of the lookup key */ 499 switch (name->vtable->base_type) { 500 case enum_class_NameSpace: 501 /* Parrot_printf(interp, "%Ss\n", VTABLE_get_string(interp, name)); */ 502 ns = name; 503 break; 504 case enum_class_String: 505 { 506 /* Look up a low-level class and create a proxy */ 507 const INTVAL type = pmc_type(interp, VTABLE_get_string(interp, name)); 501 508 502 PMC * const classname_hash = interp->class_hash; 503 PMC * const type_pmc = (PMC *)VTABLE_get_pointer_keyed(interp, 504 classname_hash, name); 509 /* Reject invalid type numbers */ 510 if (type > interp->n_vtable_max || type <= 0) 511 return 1; 512 else { 513 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, 514 "native type with name '%s' already exists - " 515 "can't register Class", data_types[type].name); 516 } 517 } 518 break; 519 case enum_class_Key: 520 case enum_class_ResizableStringArray: 521 { 522 PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp, 523 interp->HLL_namespace, 524 CONTEXT(interp)->current_HLL); 525 ns = Parrot_get_namespace_keyed(interp, hll_ns, name); 505 526 506 if (PMC_IS_NULL(type_pmc) 507 || type_pmc->vtable->base_type == enum_class_NameSpace) 508 type = 0; 509 else 510 type = VTABLE_get_integer(interp, type_pmc); 527 } 528 break; 529 default: 530 { 531 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERP_ERROR, 532 "Unrecognized class name PMC type" ); 533 } 534 break; 535 } 511 536 512 if (type > enum_type_undef) { 513 STRING *classname; 514 515 if (VTABLE_isa(interp, name, CONST_STRING(interp, "ResizableStringArray"))) { 516 PMC * const base_ns = VTABLE_get_pmc_keyed_int(interp, 517 interp->HLL_namespace, 518 CONTEXT(interp)->current_HLL); 519 PMC *ns = Parrot_get_namespace_keyed(interp, 520 base_ns, name); 521 522 if (!PMC_IS_NULL(ns)) 523 classname = VTABLE_get_string(interp, ns); 524 else 525 classname = CONST_STRING(interp, ""); 537 if (!PMC_IS_NULL(ns)) { 538 PMC *classobj = VTABLE_get_class(interp, ns); 539 if (!PMC_IS_NULL(classobj)) { 540 STRING *classname = VTABLE_get_string(interp, ns); 541 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, 542 "Class %Ss already registered!\n", 543 string_escape_string(interp, classname)); 526 544 } 527 else528 classname = VTABLE_get_string(interp, name);529 530 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,531 "Class %Ss already registered!\n",532 string_escape_string(interp, classname));533 545 } 534 546 535 if (type < enum_type_undef) 536 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, 537 "native type with name '%s' already exists - " 538 "can't register Class", data_types[type].name); 547 return 0; 539 548 } 540 549 541 550 … … 547 556 already exists. The global type registry will go away eventually, but this 548 557 allows the new object metamodel to interact with the old one until it does. 549 558 559 Every type(PMCS, classes) gets a type number in the vtables table. 560 Essentially only CORE PMCs go in the class_hash now. 561 They are always registered with a String PMC as their name. 562 Classes are always registered with a namespace or a ResizableStringArray as their name. 563 550 564 =cut 551 565 552 566 */ … … 557 571 { 558 572 INTVAL type; 559 573 PMC *classname_hash, *item; 574 INTVAL name_is_string = fail_if_type_exists(interp, name); 560 575 561 fail_if_type_exists(interp, name);562 563 576 /* Type doesn't exist, so go ahead and register it. Lock interpreter so 564 577 * pt_shared_fixup() can safely do a type lookup. */ 565 578 LOCK_INTERPRETER(interp); … … 571 584 if (type >= interp->n_vtable_alloced) 572 585 parrot_realloc_vtables(interp); 573 586 574 /* set entry in name->type hash */ 575 item = pmc_new(interp, enum_class_Integer); 576 PMC_int_val(item) = type; 587 if (name_is_string) { 588 /* set entry in name->type hash */ 589 item = pmc_new(interp, enum_class_Integer); 590 PMC_int_val(item) = type; 577 591 578 VTABLE_set_pmc_keyed(interp, classname_hash, name, item); 592 VTABLE_set_pmc_keyed(interp, classname_hash, name, item); 593 } 579 594 UNLOCK_INTERPRETER(interp); 580 595 581 596 return type; … … 777 792 return; 778 793 } 779 794 780 type = pmc_type(interp, _class);795 type = lookup_typeid_s(interp, _class); 781 796 782 797 if (type == 0) 783 798 invalidate_all_caches(interp); -
src/ops/experimental.ops
165 165 =cut 166 166 167 167 inline op morph(invar PMC, in STR) { 168 INTVAL type = pmc_type(interp, $2);168 INTVAL type = lookup_typeid_s(interp, $2); 169 169 VTABLE_morph(interp, $1, type); 170 170 } 171 171 -
src/multidispatch.c
826 826 else if (string_equal(interp, type_name, CONST_STRING(interp, "FLOATVAL"))==0) 827 827 type = enum_type_FLOATVAL; 828 828 else 829 type = pmc_type(interp, type_name);829 type = lookup_typeid_s(interp, type_name); 830 830 831 831 VTABLE_set_integer_keyed_int(interp, multi_sig, i, type); 832 832 } … … 986 986 break; 987 987 } 988 988 989 type = pmc_type(interp, sig);989 type = lookup_typeid_s(interp, sig); 990 990 991 991 if (type == enum_type_undef) 992 992 return PMCNULL; 993 993 } 994 994 else 995 type = pmc_type_p(interp, sig_elem);995 type = lookup_typeid(interp, sig_elem); 996 996 997 997 /* create destination PMC only as necessary */ 998 998 if (PMC_IS_NULL(ar)) { -
src/pmc/class.pmc
218 218 CLASS_is_anon_CLEAR(self); 219 219 220 220 /* Register a type number for the class. */ 221 type_num = Parrot_oo_register_type(interp, n ame_arg);221 type_num = Parrot_oo_register_type(interp, new_namespace); 222 222 223 223 /* Link the type number with the class's vtable. */ 224 224 new_vtable = Parrot_clone_vtable(interp, self->vtable); -
src/pmc/string.pmc
977 977 } 978 978 979 979 VTABLE STRING* get_repr() { 980 return key_set_to_string(INTERP, SELF);980 return VTABLE_get_string(INTERP, SELF); 981 981 } 982 982 983 983 /* -
src/pmc/parrotinterpreter.pmc
83 83 for (i = s->n_vtable_max - 1; i >= start; --i) { 84 84 if (s->vtables[i] && s->vtables[i]->pmc_class && 85 85 PObj_is_class_TEST(s->vtables[i]->pmc_class)) { 86 STRING * const class_name = 87 VTABLE_get_string(s, s->vtables[i]->pmc_class); 88 PARROT_ASSERT(VTABLE_exists_keyed_str(d, 89 d->class_hash, class_name)); 86 STRING * const class_name = VTABLE_get_string(s, s->vtables[i]->pmc_class); 90 87 91 88 VTABLE_delete_keyed_str(d, d->class_hash, class_name); 92 89 -
src/pmc/fixedstringarray.pmc
475 475 476 476 /* 477 477 478 =item C<STRING *get_repr()> 479 480 Returns the Parrot string representation C<key>. 481 482 =cut 483 484 */ 485 486 VTABLE STRING *get_repr() { 487 STRING *res = CONST_STRING(INTERP, "[ "); 488 const INTVAL n = SELF.get_integer(); 489 INTVAL j; 490 491 for (j = 0; j < n; ++j) { 492 PMC * const val = SELF.get_pmc_keyed_int(j); 493 res = string_append(INTERP, res, CONST_STRING(INTERP, "\"")); 494 res = string_append(INTERP, res, VTABLE_get_repr(INTERP, val)); 495 res = string_append(INTERP, res, CONST_STRING(INTERP, "\"")); 496 497 if (j < n - 1) 498 res = string_append(INTERP, res, CONST_STRING(INTERP, ", ")); 499 } 500 501 res = string_append(INTERP, res, CONST_STRING(INTERP, " ]")); 502 return res; 503 } 504 505 506 507 /* 508 478 509 =back 479 510 480 511 =head2 Freeze/thaw Interface -
include/parrot/oo.h
163 163 __attribute__nonnull__(1) 164 164 __attribute__nonnull__(2); 165 165 166 PARROT_WARN_UNUSED_RESULT 167 INTVAL lookup_typeid_s(PARROT_INTERP, ARGIN(STRING *name)) 168 __attribute__nonnull__(1) 169 __attribute__nonnull__(2); 170 171 PARROT_WARN_UNUSED_RESULT 172 INTVAL lookup_typeid(PARROT_INTERP, ARGIN(PMC *name)) 173 __attribute__nonnull__(1) 174 __attribute__nonnull__(2); 175 166 176 void Parrot_oo_extract_methods_from_namespace(PARROT_INTERP, 167 177 ARGIN(PMC *self), 168 178 ARGIN(PMC *ns)) -
compilers/imcc/imcc.y
388 388 } 389 389 390 390 r[1] = rhs; 391 rhs->pmc_type = pmc_type(interp,391 rhs->pmc_type = lookup_typeid_s(interp, 392 392 string_from_cstring(interp, unquoted_name, name_length)); 393 393 394 394 mem_sys_free(unquoted_name); … … 834 834 | HLL_MAP STRINGC '=' STRINGC 835 835 { 836 836 Parrot_Context *ctx = CONTEXT(interp); 837 STRING * const built_in_name = 838 string_unescape_cstring(interp, $2+ 1, '"', NULL);839 STRING * const language_name =840 string_unescape_cstring(interp, $4 + 1, '"', NULL);837 STRING * const built_in_name = string_unescape_cstring(interp, $2 + 1, '"', NULL); 838 STRING * const language_name = string_unescape_cstring(interp, $4 + 1, '"', NULL); 839 int built_in_type = lookup_typeid_s(interp, built_in_name); 840 int language_type = lookup_typeid_s(interp, language_name); 841 841 842 int built_in_type = pmc_type(interp, built_in_name); 843 int language_type = pmc_type(interp, language_name); 844 845 Parrot_register_HLL_type(interp, ctx->current_HLL, 846 built_in_type, language_type); 842 Parrot_register_HLL_type(interp, ctx->current_HLL, built_in_type, language_type); 847 843 $$ = 0; 848 844 } 849 845 ; … … 1592 1588 { 1593 1589 /* there'd normally be a str_dup() here, but the lexer already 1594 1590 * copied the string, so it's safe to use directly */ 1595 if ((IMCC_INFO(interp)->cur_pmc_type = pmc_type(interp,1591 if ((IMCC_INFO(interp)->cur_pmc_type = lookup_typeid_s(interp, 1596 1592 string_from_cstring(interp, $1, 0))) <= 0) { 1597 1593 IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, 1598 1594 "Unknown PMC type '%s'\n", $1); -
compilers/imcc/pbc.c
1222 1222 if (!PMC_IS_NULL(classobj)) 1223 1223 sub_pmc = VTABLE_instantiate(interp, classobj, PMCNULL); 1224 1224 else { 1225 const INTVAL type = pmc_type(interp, classname);1225 const INTVAL type = lookup_typeid_s(interp, classname); 1226 1226 if (type <= 0) 1227 1227 Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NO_CLASS, 1228 1228 "Class '%Ss' specified in :instanceof(...) not found", -
compilers/imcc/imcparser.c
712 712 } 713 713 714 714 r[1] = rhs; 715 rhs->pmc_type = pmc_type(interp,715 rhs->pmc_type = lookup_typeid_s(interp, 716 716 string_from_cstring(interp, unquoted_name, name_length)); 717 717 718 718 mem_sys_free(unquoted_name); … … 1027 1027 SymReg * sr; 1028 1028 Instruction *i; 1029 1029 } 1030 /* Line 1 93of yacc.c. */1030 /* Line 187 of yacc.c. */ 1031 1031 #line 1021 "compilers/imcc/imcparser.c" 1032 1032 YYSTYPE; 1033 1033 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ … … 1468 1468 static const yytype_uint16 yyrline[] = 1469 1469 { 1470 1470 0, 772, 772, 776, 777, 781, 782, 783, 789, 795, 1471 796, 797, 798, 802, 803, 812, 817, 825, 834, 8 52,1472 8 52, 861, 861, 867, 867, 874, 875, 879, 880, 884,1473 88 5, 886, 887, 888, 889, 890, 893, 893, 902, 901,1474 9 13, 917, 925, 929, 933, 933, 945, 947, 951, 966,1475 97 4, 979, 983, 987, 978, 999, 1000, 1001, 1014, 1014,1476 101 8, 1032, 1036, 1042, 1051, 1057, 1066, 1072, 1081, 1087,1477 109 6, 1104, 1109, 1120, 1123, 1128, 1136, 1137, 1138, 1139,1478 11 40, 1151, 1162, 1165, 1167, 1172, 1171, 1204, 1205, 1209,1479 12 10, 1214, 1215, 1219, 1220, 1224, 1225, 1226, 1227, 1228,1480 122 9, 1230, 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1241,1481 124 6, 1250, 1255, 1259, 1263, 1268, 1277, 1278, 1282, 1287,1482 128 8, 1296, 1297, 1297, 1312, 1313, 1317, 1318, 1319, 1320,1483 13 21, 1322, 1327, 1327, 1330, 1338, 1338, 1344, 1345, 1350,1484 135 8, 1359, 1364, 1372, 1376, 1381, 1380, 1393, 1394, 1398,1485 139 9, 1409, 1413, 1423, 1431, 1432, 1444, 1448, 1450, 1451,1486 14 52, 1453, 1457, 1458, 1462, 1463, 1467, 1476, 1477, 1488,1487 149 5, 1504, 1514, 1515, 1520, 1521, 1522, 1522, 1538, 1542,1488 15 42, 1549, 1550, 1550, 1556, 1562, 1563, 1575, 1576, 1577,1489 157 8, 1579, 1580, 1584, 1585, 1586, 1587, 1591, 1604, 1606,1490 160 8, 1610, 1612, 1614, 1616, 1618, 1620, 1622, 1624, 1626,1491 162 8, 1632, 1634, 1636, 1639, 1646, 1645, 1654, 1655, 1656,1492 165 7, 1665, 1666, 1667, 1671, 1672, 1673, 1674, 1675, 1676,1493 167 7, 1678, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686,1494 168 7, 1688, 1689, 1690, 1691, 1692, 1693, 1699, 1698, 1710,1495 171 7, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726,1496 172 7, 1728, 1729, 1734, 1745, 1746, 1747, 1748, 1754, 1768,1497 177 4, 1780, 1779, 1788, 1789, 1799, 1809, 1815, 1824, 1828,1498 182 9, 1833, 1834, 1837, 1841, 1845, 1855, 1860, 1870, 1875,1499 187 9, 1880, 1884, 1888, 1892, 1899, 1903, 1907, 1914, 1915,1500 191 9, 1920, 1921, 1922, 1923, 1924, 1928, 1929, 1933, 1934,1501 193 8, 1939, 1943, 1944, 1951, 1958, 1959, 1960, 1964, 1965,1502 196 9, 1970, 1974, 1975, 1979, 1980, 1984, 1984, 1997, 1997,1503 20 10, 2011, 2019, 2028, 2029, 2030, 2031, 2032, 2036, 2037,1504 203 8, 20391471 796, 797, 798, 802, 803, 812, 817, 825, 834, 848, 1472 848, 857, 857, 863, 863, 870, 871, 875, 876, 880, 1473 881, 882, 883, 884, 885, 886, 889, 889, 898, 897, 1474 909, 913, 921, 925, 929, 929, 941, 943, 947, 962, 1475 970, 975, 979, 983, 974, 995, 996, 997, 1010, 1010, 1476 1014, 1028, 1032, 1038, 1047, 1053, 1062, 1068, 1077, 1083, 1477 1092, 1100, 1105, 1116, 1119, 1124, 1132, 1133, 1134, 1135, 1478 1136, 1147, 1158, 1161, 1163, 1168, 1167, 1200, 1201, 1205, 1479 1206, 1210, 1211, 1215, 1216, 1220, 1221, 1222, 1223, 1224, 1480 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1237, 1481 1242, 1246, 1251, 1255, 1259, 1264, 1273, 1274, 1278, 1283, 1482 1284, 1292, 1293, 1293, 1308, 1309, 1313, 1314, 1315, 1316, 1483 1317, 1318, 1323, 1323, 1326, 1334, 1334, 1340, 1341, 1346, 1484 1354, 1355, 1360, 1368, 1372, 1377, 1376, 1389, 1390, 1394, 1485 1395, 1405, 1409, 1419, 1427, 1428, 1440, 1444, 1446, 1447, 1486 1448, 1449, 1453, 1454, 1458, 1459, 1463, 1472, 1473, 1484, 1487 1491, 1500, 1510, 1511, 1516, 1517, 1518, 1518, 1534, 1538, 1488 1538, 1545, 1546, 1546, 1552, 1558, 1559, 1571, 1572, 1573, 1489 1574, 1575, 1576, 1580, 1581, 1582, 1583, 1587, 1600, 1602, 1490 1604, 1606, 1608, 1610, 1612, 1614, 1616, 1618, 1620, 1622, 1491 1624, 1628, 1630, 1632, 1635, 1642, 1641, 1650, 1651, 1652, 1492 1653, 1661, 1662, 1663, 1667, 1668, 1669, 1670, 1671, 1672, 1493 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1682, 1494 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1695, 1694, 1706, 1495 1713, 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1496 1723, 1724, 1725, 1730, 1741, 1742, 1743, 1744, 1750, 1764, 1497 1770, 1776, 1775, 1784, 1785, 1795, 1805, 1811, 1820, 1824, 1498 1825, 1829, 1830, 1833, 1837, 1841, 1851, 1856, 1866, 1871, 1499 1875, 1876, 1880, 1884, 1888, 1895, 1899, 1903, 1910, 1911, 1500 1915, 1916, 1917, 1918, 1919, 1920, 1924, 1925, 1929, 1930, 1501 1934, 1935, 1939, 1940, 1947, 1954, 1955, 1956, 1960, 1961, 1502 1965, 1966, 1970, 1971, 1975, 1976, 1980, 1980, 1993, 1993, 1503 2006, 2007, 2015, 2024, 2025, 2026, 2027, 2028, 2032, 2033, 1504 2034, 2035 1505 1505 }; 1506 1506 #endif 1507 1507 … … 2960 2960 #line 835 "compilers/imcc/imcc.y" 2961 2961 { 2962 2962 Parrot_Context *ctx = CONTEXT(interp); 2963 STRING * const built_in_name = 2964 string_unescape_cstring(interp, (yyvsp[(2) - (4)].s) + 1, '"', NULL);2965 STRING * const language_name =2966 string_unescape_cstring(interp, (yyvsp[(4) - (4)].s) + 1, '"', NULL);2963 STRING * const built_in_name = string_unescape_cstring(interp, (yyvsp[(2) - (4)].s) + 1, '"', NULL); 2964 STRING * const language_name = string_unescape_cstring(interp, (yyvsp[(4) - (4)].s) + 1, '"', NULL); 2965 int built_in_type = lookup_typeid_s(interp, built_in_name); 2966 int language_type = lookup_typeid_s(interp, language_name); 2967 2967 2968 int built_in_type = pmc_type(interp, built_in_name); 2969 int language_type = pmc_type(interp, language_name); 2970 2971 Parrot_register_HLL_type(interp, ctx->current_HLL, 2972 built_in_type, language_type); 2968 Parrot_register_HLL_type(interp, ctx->current_HLL, built_in_type, language_type); 2973 2969 (yyval.t) = 0; 2974 2970 } 2975 2971 break; 2976 2972 2977 2973 case 19: 2978 #line 8 52"compilers/imcc/imcc.y"2974 #line 848 "compilers/imcc/imcc.y" 2979 2975 { is_def = 1; } 2980 2976 break; 2981 2977 2982 2978 case 20: 2983 #line 8 53"compilers/imcc/imcc.y"2979 #line 849 "compilers/imcc/imcc.y" 2984 2980 { 2985 2981 mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1); 2986 2982 mem_sys_free((yyvsp[(4) - (6)].s)); … … 2989 2985 break; 2990 2986 2991 2987 case 21: 2992 #line 8 61"compilers/imcc/imcc.y"2988 #line 857 "compilers/imcc/imcc.y" 2993 2989 { is_def=1; } 2994 2990 break; 2995 2991 2996 2992 case 22: 2997 #line 8 62"compilers/imcc/imcc.y"2993 #line 858 "compilers/imcc/imcc.y" 2998 2994 { 2999 2995 (yyval.i) = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s)); 3000 2996 is_def = 0; … … 3002 2998 break; 3003 2999 3004 3000 case 23: 3005 #line 86 7"compilers/imcc/imcc.y"3001 #line 863 "compilers/imcc/imcc.y" 3006 3002 { is_def=1; } 3007 3003 break; 3008 3004 3009 3005 case 24: 3010 #line 86 8"compilers/imcc/imcc.y"3006 #line 864 "compilers/imcc/imcc.y" 3011 3007 { 3012 3008 (yyval.i) = mk_pmc_const_named(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s)); 3013 3009 is_def = 0; … … 3015 3011 break; 3016 3012 3017 3013 case 29: 3018 #line 88 4"compilers/imcc/imcc.y"3014 #line 880 "compilers/imcc/imcc.y" 3019 3015 { (yyval.i) = 0; } 3020 3016 break; 3021 3017 3022 3018 case 30: 3023 #line 88 5"compilers/imcc/imcc.y"3019 #line 881 "compilers/imcc/imcc.y" 3024 3020 { (yyval.i) = 0; } 3025 3021 break; 3026 3022 3027 3023 case 31: 3028 #line 88 6"compilers/imcc/imcc.y"3024 #line 882 "compilers/imcc/imcc.y" 3029 3025 { (yyval.i) = 0; } 3030 3026 break; 3031 3027 3032 3028 case 32: 3033 #line 88 7"compilers/imcc/imcc.y"3029 #line 883 "compilers/imcc/imcc.y" 3034 3030 { (yyval.i) = 0; } 3035 3031 break; 3036 3032 3037 3033 case 33: 3038 #line 88 8"compilers/imcc/imcc.y"3034 #line 884 "compilers/imcc/imcc.y" 3039 3035 { (yyval.i) = (yyvsp[(1) - (1)].i); } 3040 3036 break; 3041 3037 3042 3038 case 36: 3043 #line 8 93"compilers/imcc/imcc.y"3039 #line 889 "compilers/imcc/imcc.y" 3044 3040 { clear_state(interp); } 3045 3041 break; 3046 3042 3047 3043 case 37: 3048 #line 89 5"compilers/imcc/imcc.y"3044 #line 891 "compilers/imcc/imcc.y" 3049 3045 { 3050 3046 (yyval.i) = INS(interp, IMCC_INFO(interp)->cur_unit, 3051 3047 (yyvsp[(2) - (3)].s), 0, IMCC_INFO(interp)->regs, … … 3055 3051 break; 3056 3052 3057 3053 case 38: 3058 #line 902"compilers/imcc/imcc.y"3054 #line 898 "compilers/imcc/imcc.y" 3059 3055 { 3060 3056 imc_close_unit(interp, IMCC_INFO(interp)->cur_unit); 3061 3057 IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); … … 3063 3059 break; 3064 3060 3065 3061 case 39: 3066 #line 90 7"compilers/imcc/imcc.y"3062 #line 903 "compilers/imcc/imcc.y" 3067 3063 { 3068 3064 (yyval.i) = iSUBROUTINE(interp, 3069 3065 IMCC_INFO(interp)->cur_unit, … … 3073 3069 break; 3074 3070 3075 3071 case 40: 3076 #line 91 4"compilers/imcc/imcc.y"3072 #line 910 "compilers/imcc/imcc.y" 3077 3073 { 3078 3074 (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); 3079 3075 } 3080 3076 break; 3081 3077 3082 3078 case 41: 3083 #line 91 8"compilers/imcc/imcc.y"3079 #line 914 "compilers/imcc/imcc.y" 3084 3080 { 3085 3081 SymReg *r = mk_pasm_reg(interp, (yyvsp[(4) - (4)].s)); 3086 3082 set_lexical(interp, r, (yyvsp[(2) - (4)].s)); … … 3091 3087 break; 3092 3088 3093 3089 case 42: 3094 #line 92 5"compilers/imcc/imcc.y"3090 #line 921 "compilers/imcc/imcc.y" 3095 3091 { (yyval.i) = 0;} 3096 3092 break; 3097 3093 3098 3094 case 44: 3099 #line 9 33"compilers/imcc/imcc.y"3095 #line 929 "compilers/imcc/imcc.y" 3100 3096 { IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); } 3101 3097 break; 3102 3098 3103 3099 case 45: 3104 #line 93 6"compilers/imcc/imcc.y"3100 #line 932 "compilers/imcc/imcc.y" 3105 3101 { 3106 3102 /* if (optimizer_level & OPT_PASM) 3107 3103 imc_compile_unit(interp, IMCC_INFO(interp)->cur_unit); … … 3112 3108 break; 3113 3109 3114 3110 case 48: 3115 #line 9 52"compilers/imcc/imcc.y"3111 #line 948 "compilers/imcc/imcc.y" 3116 3112 { 3117 3113 int re_open = 0; 3118 3114 (yyval.i) = 0; … … 3127 3123 break; 3128 3124 3129 3125 case 49: 3130 #line 96 7"compilers/imcc/imcc.y"3126 #line 963 "compilers/imcc/imcc.y" 3131 3127 { 3132 3128 if (IMCC_INFO(interp)->in_slice) 3133 3129 IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, … … 3138 3134 break; 3139 3135 3140 3136 case 50: 3141 #line 97 4"compilers/imcc/imcc.y"3137 #line 970 "compilers/imcc/imcc.y" 3142 3138 { (yyval.sr) = NULL; } 3143 3139 break; 3144 3140 3145 3141 case 51: 3146 #line 97 9"compilers/imcc/imcc.y"3142 #line 975 "compilers/imcc/imcc.y" 3147 3143 { 3148 3144 IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PCCSUB); 3149 3145 } 3150 3146 break; 3151 3147 3152 3148 case 52: 3153 #line 9 83"compilers/imcc/imcc.y"3149 #line 979 "compilers/imcc/imcc.y" 3154 3150 { 3155 3151 iSUBROUTINE(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (3)].sr)); 3156 3152 } 3157 3153 break; 3158 3154 3159 3155 case 53: 3160 #line 98 7"compilers/imcc/imcc.y"3156 #line 983 "compilers/imcc/imcc.y" 3161 3157 { 3162 3158 IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(5) - (6)].t); 3163 3159 if (!IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid) { … … 3168 3164 break; 3169 3165 3170 3166 case 54: 3171 #line 99 5"compilers/imcc/imcc.y"3167 #line 991 "compilers/imcc/imcc.y" 3172 3168 { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; } 3173 3169 break; 3174 3170 3175 3171 case 55: 3176 #line 99 9"compilers/imcc/imcc.y"3172 #line 995 "compilers/imcc/imcc.y" 3177 3173 { (yyval.sr) = 0; } 3178 3174 break; 3179 3175 3180 3176 case 56: 3181 #line 1000"compilers/imcc/imcc.y"3177 #line 996 "compilers/imcc/imcc.y" 3182 3178 { (yyval.sr) = 0; } 3183 3179 break; 3184 3180 3185 3181 case 57: 3186 #line 1002"compilers/imcc/imcc.y"3182 #line 998 "compilers/imcc/imcc.y" 3187 3183 { 3188 3184 if (IMCC_INFO(interp)->adv_named_id) { 3189 3185 add_pcc_named_param(interp, IMCC_INFO(interp)->cur_call, … … 3196 3192 break; 3197 3193 3198 3194 case 58: 3199 #line 101 4"compilers/imcc/imcc.y"3195 #line 1010 "compilers/imcc/imcc.y" 3200 3196 { is_def=1; } 3201 3197 break; 3202 3198 3203 3199 case 59: 3204 #line 101 4"compilers/imcc/imcc.y"3200 #line 1010 "compilers/imcc/imcc.y" 3205 3201 { (yyval.sr) = (yyvsp[(3) - (3)].sr); is_def=0; } 3206 3202 break; 3207 3203 3208 3204 case 60: 3209 #line 101 9"compilers/imcc/imcc.y"3205 #line 1015 "compilers/imcc/imcc.y" 3210 3206 { 3211 3207 if ((yyvsp[(3) - (3)].t) & VT_UNIQUE_REG) 3212 3208 (yyval.sr) = mk_ident_ur(interp, (yyvsp[(2) - (3)].s), (yyvsp[(1) - (3)].t)); … … 3218 3214 break; 3219 3215 3220 3216 case 61: 3221 #line 10 32"compilers/imcc/imcc.y"3217 #line 1028 "compilers/imcc/imcc.y" 3222 3218 { (yyval.t) = 0; } 3223 3219 break; 3224 3220 3225 3221 case 62: 3226 #line 103 7"compilers/imcc/imcc.y"3222 #line 1033 "compilers/imcc/imcc.y" 3227 3223 { 3228 3224 (yyval.t) = 0; 3229 3225 IMCC_INFO(interp)->cur_unit->outer = mk_sub_address_fromc(interp, (yyvsp[(3) - (4)].s)); … … 3232 3228 break; 3233 3229 3234 3230 case 63: 3235 #line 10 43"compilers/imcc/imcc.y"3231 #line 1039 "compilers/imcc/imcc.y" 3236 3232 { 3237 3233 (yyval.t) = 0; 3238 3234 IMCC_INFO(interp)->cur_unit->outer = mk_const(interp, (yyvsp[(3) - (4)].s), 'S'); … … 3241 3237 break; 3242 3238 3243 3239 case 64: 3244 #line 10 52"compilers/imcc/imcc.y"3240 #line 1048 "compilers/imcc/imcc.y" 3245 3241 { 3246 3242 (yyval.t) = 0; 3247 3243 IMCC_INFO(interp)->cur_unit->vtable_name = NULL; … … 3250 3246 break; 3251 3247 3252 3248 case 65: 3253 #line 105 8"compilers/imcc/imcc.y"3249 #line 1054 "compilers/imcc/imcc.y" 3254 3250 { 3255 3251 (yyval.t) = 0; 3256 3252 IMCC_INFO(interp)->cur_unit->vtable_name = (yyvsp[(3) - (4)].s); … … 3259 3255 break; 3260 3256 3261 3257 case 66: 3262 #line 106 7"compilers/imcc/imcc.y"3258 #line 1063 "compilers/imcc/imcc.y" 3263 3259 { 3264 3260 (yyval.t) = P_METHOD; 3265 3261 IMCC_INFO(interp)->cur_unit->method_name = NULL; … … 3268 3264 break; 3269 3265 3270 3266 case 67: 3271 #line 10 73"compilers/imcc/imcc.y"3267 #line 1069 "compilers/imcc/imcc.y" 3272 3268 { 3273 3269 (yyval.t) = P_METHOD; 3274 3270 IMCC_INFO(interp)->cur_unit->method_name = (yyvsp[(3) - (4)].s); … … 3277 3273 break; 3278 3274 3279 3275 case 68: 3280 #line 10 82"compilers/imcc/imcc.y"3276 #line 1078 "compilers/imcc/imcc.y" 3281 3277 { 3282 3278 (yyval.t) = 0; 3283 3279 IMCC_INFO(interp)->cur_unit->ns_entry_name = NULL; … … 3286 3282 break; 3287 3283 3288 3284 case 69: 3289 #line 108 8"compilers/imcc/imcc.y"3285 #line 1084 "compilers/imcc/imcc.y" 3290 3286 { 3291 3287 (yyval.t) = 0; 3292 3288 IMCC_INFO(interp)->cur_unit->ns_entry_name = (yyvsp[(3) - (4)].s); … … 3295 3291 break; 3296 3292 3297 3293 case 70: 3298 #line 109 7"compilers/imcc/imcc.y"3294 #line 1093 "compilers/imcc/imcc.y" 3299 3295 { 3300 3296 (yyval.t) = 0; 3301 3297 IMCC_INFO(interp)->cur_unit->instance_of = (yyvsp[(3) - (4)].s); … … 3303 3299 break; 3304 3300 3305 3301 case 71: 3306 #line 110 5"compilers/imcc/imcc.y"3302 #line 1101 "compilers/imcc/imcc.y" 3307 3303 { 3308 3304 (yyval.t) = 0; 3309 3305 IMCC_INFO(interp)->cur_unit->subid = NULL; … … 3311 3307 break; 3312 3308 3313 3309 case 72: 3314 #line 11 10"compilers/imcc/imcc.y"3310 #line 1106 "compilers/imcc/imcc.y" 3315 3311 { 3316 3312 (yyval.t) = 0; 3317 3313 IMCC_INFO(interp)->cur_unit->subid = mk_const(interp, (yyvsp[(3) - (4)].s), 'S'); … … 3321 3317 break; 3322 3318 3323 3319 case 73: 3324 #line 11 20"compilers/imcc/imcc.y"3320 #line 1116 "compilers/imcc/imcc.y" 3325 3321 { 3326 3322 add_pcc_multi(IMCC_INFO(interp)->cur_call, NULL); 3327 3323 } 3328 3324 break; 3329 3325 3330 3326 case 74: 3331 #line 112 4"compilers/imcc/imcc.y"3327 #line 1120 "compilers/imcc/imcc.y" 3332 3328 { 3333 3329 (yyval.t) = 0; 3334 3330 add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr)); … … 3336 3332 break; 3337 3333 3338 3334 case 75: 3339 #line 112 9"compilers/imcc/imcc.y"3335 #line 1125 "compilers/imcc/imcc.y" 3340 3336 { 3341 3337 (yyval.t) = 0; 3342 3338 add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr)); … … 3344 3340 break; 3345 3341 3346 3342 case 76: 3347 #line 113 6"compilers/imcc/imcc.y"3343 #line 1132 "compilers/imcc/imcc.y" 3348 3344 { (yyval.sr) = mk_const(interp, "INTVAL", 'S'); } 3349 3345 break; 3350 3346 3351 3347 case 77: 3352 #line 113 7"compilers/imcc/imcc.y"3348 #line 1133 "compilers/imcc/imcc.y" 3353 3349 { (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); } 3354 3350 break; 3355 3351 3356 3352 case 78: 3357 #line 113 8"compilers/imcc/imcc.y"3353 #line 1134 "compilers/imcc/imcc.y" 3358 3354 { (yyval.sr) = mk_const(interp, "PMC", 'S'); } 3359 3355 break; 3360 3356 3361 3357 case 79: 3362 #line 113 9"compilers/imcc/imcc.y"3358 #line 1135 "compilers/imcc/imcc.y" 3363 3359 { (yyval.sr) = mk_const(interp, "STRING", 'S'); } 3364 3360 break; 3365 3361 3366 3362 case 80: 3367 #line 11 41"compilers/imcc/imcc.y"3363 #line 1137 "compilers/imcc/imcc.y" 3368 3364 { 3369 3365 SymReg *r; 3370 3366 if (strcmp((yyvsp[(1) - (1)].s), "_") != 0) … … 3378 3374 break; 3379 3375 3380 3376 case 81: 3381 #line 11 52"compilers/imcc/imcc.y"3377 #line 1148 "compilers/imcc/imcc.y" 3382 3378 { 3383 3379 SymReg *r; 3384 3380 if (strcmp((yyvsp[(1) - (1)].s), "_") != 0) … … 3392 3388 break; 3393 3389 3394 3390 case 82: 3395 #line 11 62"compilers/imcc/imcc.y"3391 #line 1158 "compilers/imcc/imcc.y" 3396 3392 { (yyval.sr) = (yyvsp[(2) - (3)].sr); } 3397 3393 break; 3398 3394 3399 3395 case 85: 3400 #line 11 72"compilers/imcc/imcc.y"3396 #line 1168 "compilers/imcc/imcc.y" 3401 3397 { 3402 3398 char name[128]; 3403 3399 SymReg *r, *r1; … … 3424 3420 break; 3425 3421 3426 3422 case 86: 3427 #line 1 200"compilers/imcc/imcc.y"3423 #line 1196 "compilers/imcc/imcc.y" 3428 3424 { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; } 3429 3425 break; 3430 3426 3431 3427 case 87: 3432 #line 120 4"compilers/imcc/imcc.y"3428 #line 1200 "compilers/imcc/imcc.y" 3433 3429 { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; } 3434 3430 break; 3435 3431 3436 3432 case 88: 3437 #line 120 5"compilers/imcc/imcc.y"3433 #line 1201 "compilers/imcc/imcc.y" 3438 3434 { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; } 3439 3435 break; 3440 3436 3441 3437 case 89: 3442 #line 120 9"compilers/imcc/imcc.y"3438 #line 1205 "compilers/imcc/imcc.y" 3443 3439 { (yyval.i) = NULL; } 3444 3440 break; 3445 3441 3446 3442 case 90: 3447 #line 12 10"compilers/imcc/imcc.y"3443 #line 1206 "compilers/imcc/imcc.y" 3448 3444 { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); } 3449 3445 break; 3450 3446 3451 3447 case 91: 3452 #line 121 4"compilers/imcc/imcc.y"3448 #line 1210 "compilers/imcc/imcc.y" 3453 3449 { (yyval.t) = 0; } 3454 3450 break; 3455 3451 3456 3452 case 93: 3457 #line 121 9"compilers/imcc/imcc.y"3453 #line 1215 "compilers/imcc/imcc.y" 3458 3454 { (yyval.t) = (yyvsp[(1) - (1)].t); } 3459 3455 break; 3460 3456 3461 3457 case 94: 3462 #line 12 20"compilers/imcc/imcc.y"3458 #line 1216 "compilers/imcc/imcc.y" 3463 3459 { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } 3464 3460 break; 3465 3461 3466 3462 case 95: 3467 #line 122 4"compilers/imcc/imcc.y"3463 #line 1220 "compilers/imcc/imcc.y" 3468 3464 { (yyval.t) = P_LOAD; } 3469 3465 break; 3470 3466 3471 3467 case 96: 3472 #line 122 5"compilers/imcc/imcc.y"3468 #line 1221 "compilers/imcc/imcc.y" 3473 3469 { (yyval.t) = P_INIT; } 3474 3470 break; 3475 3471 3476 3472 case 97: 3477 #line 122 6"compilers/imcc/imcc.y"3473 #line 1222 "compilers/imcc/imcc.y" 3478 3474 { (yyval.t) = P_MAIN; } 3479 3475 break; 3480 3476 3481 3477 case 98: 3482 #line 122 7"compilers/imcc/imcc.y"3478 #line 1223 "compilers/imcc/imcc.y" 3483 3479 { (yyval.t) = P_IMMEDIATE; } 3484 3480 break; 3485 3481 3486 3482 case 99: 3487 #line 122 8"compilers/imcc/imcc.y"3483 #line 1224 "compilers/imcc/imcc.y" 3488 3484 { (yyval.t) = P_POSTCOMP; } 3489 3485 break; 3490 3486 3491 3487 case 100: 3492 #line 122 9"compilers/imcc/imcc.y"3488 #line 1225 "compilers/imcc/imcc.y" 3493 3489 { (yyval.t) = P_ANON; } 3494 3490 break; 3495 3491 3496 3492 case 101: 3497 #line 12 30"compilers/imcc/imcc.y"3493 #line 1226 "compilers/imcc/imcc.y" 3498 3494 { (yyval.t) = P_NEED_LEX; } 3499 3495 break; 3500 3496 3501 3497 case 109: 3502 #line 12 42"compilers/imcc/imcc.y"3498 #line 1238 "compilers/imcc/imcc.y" 3503 3499 { 3504 3500 add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr)); 3505 3501 add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr)); … … 3507 3503 break; 3508 3504 3509 3505 case 110: 3510 #line 124 7"compilers/imcc/imcc.y"3506 #line 1243 "compilers/imcc/imcc.y" 3511 3507 { 3512 3508 add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); 3513 3509 } 3514 3510 break; 3515 3511 3516 3512 case 111: 3517 #line 12 51"compilers/imcc/imcc.y"3513 #line 1247 "compilers/imcc/imcc.y" 3518 3514 { 3519 3515 add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); 3520 3516 IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isNCI; … … 3522 3518 break; 3523 3519 3524 3520 case 112: 3525 #line 125 6"compilers/imcc/imcc.y"3521 #line 1252 "compilers/imcc/imcc.y" 3526 3522 { 3527 3523 add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); 3528 3524 } 3529 3525 break; 3530 3526 3531 3527 case 113: 3532 #line 12 60"compilers/imcc/imcc.y"3528 #line 1256 "compilers/imcc/imcc.y" 3533 3529 { 3534 3530 add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (3)].s), 'S')); 3535 3531 } 3536 3532 break; 3537 3533 3538 3534 case 114: 3539 #line 126 4"compilers/imcc/imcc.y"3535 #line 1260 "compilers/imcc/imcc.y" 3540 3536 { 3541 3537 add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr)); 3542 3538 add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr)); … … 3544 3540 break; 3545 3541 3546 3542 case 115: 3547 #line 126 9"compilers/imcc/imcc.y"3543 #line 1265 "compilers/imcc/imcc.y" 3548 3544 { 3549 3545 add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (5)].s), 'S')); 3550 3546 add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr)); … … 3552 3548 break; 3553 3549 3554 3550 case 116: 3555 #line 127 7"compilers/imcc/imcc.y"3551 #line 1273 "compilers/imcc/imcc.y" 3556 3552 { (yyval.sr) = 0; } 3557 3553 break; 3558 3554 3559 3555 case 117: 3560 #line 127 8"compilers/imcc/imcc.y"3556 #line 1274 "compilers/imcc/imcc.y" 3561 3557 { add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); } 3562 3558 break; 3563 3559 3564 3560 case 118: 3565 #line 12 82"compilers/imcc/imcc.y"3561 #line 1278 "compilers/imcc/imcc.y" 3566 3562 { (yyval.sr) = (yyvsp[(2) - (2)].sr); } 3567 3563 break; 3568 3564 3569 3565 case 119: 3570 #line 128 7"compilers/imcc/imcc.y"3566 #line 1283 "compilers/imcc/imcc.y" 3571 3567 { (yyval.sr) = 0; } 3572 3568 break; 3573 3569 3574 3570 case 120: 3575 #line 128 9"compilers/imcc/imcc.y"3571 #line 1285 "compilers/imcc/imcc.y" 3576 3572 { 3577 3573 if ((yyvsp[(2) - (3)].sr)) 3578 3574 add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); … … 3580 3576 break; 3581 3577 3582 3578 case 121: 3583 #line 129 6"compilers/imcc/imcc.y"3579 #line 1292 "compilers/imcc/imcc.y" 3584 3580 { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } 3585 3581 break; 3586 3582 3587 3583 case 122: 3588 #line 129 7"compilers/imcc/imcc.y"3584 #line 1293 "compilers/imcc/imcc.y" 3589 3585 { is_def=1; } 3590 3586 break; 3591 3587 3592 3588 case 123: 3593 #line 129 8"compilers/imcc/imcc.y"3589 #line 1294 "compilers/imcc/imcc.y" 3594 3590 { 3595 3591 IdList *l = (yyvsp[(4) - (4)].idlist); 3596 3592 SymReg *ignored; … … 3605 3601 break; 3606 3602 3607 3603 case 124: 3608 #line 13 12"compilers/imcc/imcc.y"3604 #line 1308 "compilers/imcc/imcc.y" 3609 3605 { (yyval.t) = 0; } 3610 3606 break; 3611 3607 3612 3608 case 125: 3613 #line 13 13"compilers/imcc/imcc.y"3609 #line 1309 "compilers/imcc/imcc.y" 3614 3610 { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } 3615 3611 break; 3616 3612 3617 3613 case 126: 3618 #line 131 7"compilers/imcc/imcc.y"3614 #line 1313 "compilers/imcc/imcc.y" 3619 3615 { (yyval.t) = VT_FLAT; } 3620 3616 break; 3621 3617 3622 3618 case 127: 3623 #line 131 8"compilers/imcc/imcc.y"3619 #line 1314 "compilers/imcc/imcc.y" 3624 3620 { (yyval.t) = VT_OPTIONAL; } 3625 3621 break; 3626 3622 3627 3623 case 128: 3628 #line 131 9"compilers/imcc/imcc.y"3624 #line 1315 "compilers/imcc/imcc.y" 3629 3625 { (yyval.t) = VT_OPT_FLAG; } 3630 3626 break; 3631 3627 3632 3628 case 129: 3633 #line 13 20"compilers/imcc/imcc.y"3629 #line 1316 "compilers/imcc/imcc.y" 3634 3630 { (yyval.t) = VT_NAMED; } 3635 3631 break; 3636 3632 3637 3633 case 130: 3638 #line 13 21"compilers/imcc/imcc.y"3634 #line 1317 "compilers/imcc/imcc.y" 3639 3635 { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; } 3640 3636 break; 3641 3637 3642 3638 case 131: 3643 #line 13 22"compilers/imcc/imcc.y"3639 #line 1318 "compilers/imcc/imcc.y" 3644 3640 { (yyval.t) = VT_UNIQUE_REG; } 3645 3641 break; 3646 3642 3647 3643 case 132: 3648 #line 132 7"compilers/imcc/imcc.y"3644 #line 1323 "compilers/imcc/imcc.y" 3649 3645 { begin_return_or_yield(interp, 0); } 3650 3646 break; 3651 3647 3652 3648 case 133: 3653 #line 132 9"compilers/imcc/imcc.y"3649 #line 1325 "compilers/imcc/imcc.y" 3654 3650 { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; } 3655 3651 break; 3656 3652 3657 3653 case 134: 3658 #line 13 31"compilers/imcc/imcc.y"3654 #line 1327 "compilers/imcc/imcc.y" 3659 3655 { 3660 3656 IMCC_INFO(interp)->asm_state = AsmDefault; 3661 3657 (yyval.i) = 0; … … 3663 3659 break; 3664 3660 3665 3661 case 135: 3666 #line 133 8"compilers/imcc/imcc.y"3662 #line 1334 "compilers/imcc/imcc.y" 3667 3663 { begin_return_or_yield(interp, 1); } 3668 3664 break; 3669 3665 3670 3666 case 136: 3671 #line 13 40"compilers/imcc/imcc.y"3667 #line 1336 "compilers/imcc/imcc.y" 3672 3668 { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; } 3673 3669 break; 3674 3670 3675 3671 case 137: 3676 #line 134 4"compilers/imcc/imcc.y"3672 #line 1340 "compilers/imcc/imcc.y" 3677 3673 { (yyval.sr) = 0; } 3678 3674 break; 3679 3675 3680 3676 case 138: 3681 #line 134 6"compilers/imcc/imcc.y"3677 #line 1342 "compilers/imcc/imcc.y" 3682 3678 { 3683 3679 if ((yyvsp[(1) - (2)].sr)) 3684 3680 add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr)); … … 3686 3682 break; 3687 3683 3688 3684 case 139: 3689 #line 13 51"compilers/imcc/imcc.y"3685 #line 1347 "compilers/imcc/imcc.y" 3690 3686 { 3691 3687 if ((yyvsp[(2) - (3)].sr)) 3692 3688 add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr)); … … 3694 3690 break; 3695 3691 3696 3692 case 140: 3697 #line 135 8"compilers/imcc/imcc.y"3693 #line 1354 "compilers/imcc/imcc.y" 3698 3694 { (yyval.sr) = 0; } 3699 3695 break; 3700 3696 3701 3697 case 141: 3702 #line 13 60"compilers/imcc/imcc.y"3698 #line 1356 "compilers/imcc/imcc.y" 3703 3699 { 3704 3700 if ((yyvsp[(1) - (2)].sr)) 3705 3701 add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr)); … … 3707 3703 break; 3708 3704 3709 3705 case 142: 3710 #line 136 5"compilers/imcc/imcc.y"3706 #line 1361 "compilers/imcc/imcc.y" 3711 3707 { 3712 3708 if ((yyvsp[(2) - (3)].sr)) 3713 3709 add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr)); … … 3715 3711 break; 3716 3712 3717 3713 case 143: 3718 #line 13 72"compilers/imcc/imcc.y"3714 #line 1368 "compilers/imcc/imcc.y" 3719 3715 { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } 3720 3716 break; 3721 3717 3722 3718 case 144: 3723 #line 137 6"compilers/imcc/imcc.y"3719 #line 1372 "compilers/imcc/imcc.y" 3724 3720 { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); } 3725 3721 break; 3726 3722 3727 3723 case 145: 3728 #line 13 81"compilers/imcc/imcc.y"3724 #line 1377 "compilers/imcc/imcc.y" 3729 3725 { 3730 3726 if (IMCC_INFO(interp)->asm_state == AsmDefault) 3731 3727 begin_return_or_yield(interp, (yyvsp[(1) - (2)].t)); … … 3733 3729 break; 3734 3730 3735 3731 case 146: 3736 #line 138 6"compilers/imcc/imcc.y"3732 #line 1382 "compilers/imcc/imcc.y" 3737 3733 { 3738 3734 IMCC_INFO(interp)->asm_state = AsmDefault; 3739 3735 (yyval.t) = 0; … … 3741 3737 break; 3742 3738 3743 3739 case 147: 3744 #line 13 93"compilers/imcc/imcc.y"3740 #line 1389 "compilers/imcc/imcc.y" 3745 3741 { (yyval.t) = 0; } 3746 3742 break; 3747 3743 3748 3744 case 148: 3749 #line 139 4"compilers/imcc/imcc.y"3745 #line 1390 "compilers/imcc/imcc.y" 3750 3746 { (yyval.t) = 1; } 3751 3747 break; 3752 3748 3753 3749 case 149: 3754 #line 139 8"compilers/imcc/imcc.y"3750 #line 1394 "compilers/imcc/imcc.y" 3755 3751 { (yyval.i) = 0; } 3756 3752 break; 3757 3753 3758 3754 case 150: 3759 #line 1 400"compilers/imcc/imcc.y"3755 #line 1396 "compilers/imcc/imcc.y" 3760 3756 { 3761 3757 if (IMCC_INFO(interp)->adv_named_id) { 3762 3758 add_pcc_named_return(interp, IMCC_INFO(interp)->sr_return, … … 3769 3765 break; 3770 3766 3771 3767 case 151: 3772 #line 14 10"compilers/imcc/imcc.y"3768 #line 1406 "compilers/imcc/imcc.y" 3773 3769 { 3774 3770 add_pcc_named_return(interp, IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (3)].s), (yyvsp[(3) - (3)].sr)); 3775 3771 } 3776 3772 break; 3777 3773 3778 3774 case 152: 3779 #line 141 4"compilers/imcc/imcc.y"3775 #line 1410 "compilers/imcc/imcc.y" 3780 3776 { 3781 3777 if (IMCC_INFO(interp)->adv_named_id) { 3782 3778 add_pcc_named_return(interp, IMCC_INFO(interp)->sr_return, … … 3789 3785 break; 3790 3786 3791 3787 case 153: 3792 #line 142 4"compilers/imcc/imcc.y"3788 #line 1420 "compilers/imcc/imcc.y" 3793 3789 { 3794 3790 add_pcc_named_return(interp, IMCC_INFO(interp)->sr_return, (yyvsp[(3) - (5)].s), (yyvsp[(5) - (5)].sr)); 3795 3791 } 3796 3792 break; 3797 3793 3798 3794 case 156: 3799 #line 144 4"compilers/imcc/imcc.y"3795 #line 1440 "compilers/imcc/imcc.y" 3800 3796 { clear_state(interp); } 3801 3797 break; 3802 3798 3803 3799 case 157: 3804 #line 144 9"compilers/imcc/imcc.y"3800 #line 1445 "compilers/imcc/imcc.y" 3805 3801 { (yyval.i) = (yyvsp[(2) - (2)].i); } 3806 3802 break; 3807 3803 3808 3804 case 158: 3809 #line 14 50"compilers/imcc/imcc.y"3805 #line 1446 "compilers/imcc/imcc.y" 3810 3806 { (yyval.i) = 0; } 3811 3807 break; 3812 3808 3813 3809 case 159: 3814 #line 14 51"compilers/imcc/imcc.y"3810 #line 1447 "compilers/imcc/imcc.y" 3815 3811 { (yyval.i) = 0; } 3816 3812 break; 3817 3813 3818 3814 case 160: 3819 #line 14 52"compilers/imcc/imcc.y"3815 #line 1448 "compilers/imcc/imcc.y" 3820 3816 { (yyval.i) = 0; } 3821 3817 break; 3822 3818 3823 3819 case 161: 3824 #line 14 53"compilers/imcc/imcc.y"3820 #line 1449 "compilers/imcc/imcc.y" 3825 3821 { (yyval.i) = 0; } 3826 3822 break; 3827 3823 3828 3824 case 162: 3829 #line 145 7"compilers/imcc/imcc.y"3825 #line 1453 "compilers/imcc/imcc.y" 3830 3826 { (yyval.i) = NULL; } 3831 3827 break; 3832 3828 3833 3829 case 166: 3834 #line 146 8"compilers/imcc/imcc.y"3830 #line 1464 "compilers/imcc/imcc.y" 3835 3831 { 3836 3832 (yyval.i) = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, (yyvsp[(1) - (1)].s))); 3837 3833 } 3838 3834 break; 3839 3835 3840 3836 case 167: 3841 #line 147 6"compilers/imcc/imcc.y"3837 #line 1472 "compilers/imcc/imcc.y" 3842 3838 { (yyval.i) = (yyvsp[(2) - (3)].i); } 3843 3839 break; 3844 3840 3845 3841 case 168: 3846 #line 147 8"compilers/imcc/imcc.y"3842 #line 1474 "compilers/imcc/imcc.y" 3847 3843 { 3848 3844 if (yynerrs >= PARROT_MAX_RECOVER_ERRORS) { 3849 3845 IMCC_warning(interp, "Too many errors. Correct some first.\n"); … … 3854 3850 break; 3855 3851 3856 3852 case 169: 3857 #line 148 9"compilers/imcc/imcc.y"3853 #line 1485 "compilers/imcc/imcc.y" 3858 3854 { 3859 3855 IdList* l = (yyvsp[(1) - (1)].idlist); 3860 3856 l->next = NULL; … … 3863 3859 break; 3864 3860 3865 3861 case 170: 3866 #line 149 6"compilers/imcc/imcc.y"3862 #line 1492 "compilers/imcc/imcc.y" 3867 3863 { 3868 3864 IdList* l = (yyvsp[(3) - (3)].idlist); 3869 3865 l->next = (yyvsp[(1) - (3)].idlist); … … 3872 3868 break; 3873 3869 3874 3870 case 171: 3875 #line 150 5"compilers/imcc/imcc.y"3871 #line 1501 "compilers/imcc/imcc.y" 3876 3872 { 3877 3873 IdList* const l = mem_allocate_n_zeroed_typed(1, IdList); 3878 3874 l->id = (yyvsp[(1) - (2)].s); … … 3882 3878 break; 3883 3879 3884 3880 case 172: 3885 #line 151 4"compilers/imcc/imcc.y"3881 #line 1510 "compilers/imcc/imcc.y" 3886 3882 { (yyval.t) = 0; } 3887 3883 break; 3888 3884 3889 3885 case 173: 3890 #line 151 5"compilers/imcc/imcc.y"3886 #line 1511 "compilers/imcc/imcc.y" 3891 3887 { (yyval.t) = 1; } 3892 3888 break; 3893 3889 3894 3890 case 176: 3895 #line 15 22"compilers/imcc/imcc.y"3891 #line 1518 "compilers/imcc/imcc.y" 3896 3892 { is_def=1; } 3897 3893 break; 3898 3894 3899 3895 case 177: 3900 #line 15 23"compilers/imcc/imcc.y"3896 #line 1519 "compilers/imcc/imcc.y" 3901 3897 { 3902 3898 IdList *l = (yyvsp[(4) - (4)].idlist); 3903 3899 while (l) { … … 3916 3912 break; 3917 3913 3918 3914 case 178: 3919 #line 153 9"compilers/imcc/imcc.y"3915 #line 1535 "compilers/imcc/imcc.y" 3920 3916 { 3921 3917 set_lexical(interp, (yyvsp[(4) - (4)].sr), (yyvsp[(2) - (4)].s)); (yyval.i) = 0; 3922 3918 } 3923 3919 break; 3924 3920 3925 3921 case 179: 3926 #line 15 42"compilers/imcc/imcc.y"3922 #line 1538 "compilers/imcc/imcc.y" 3927 3923 { is_def=1; } 3928 3924 break; 3929 3925 3930 3926 case 180: 3931 #line 15 43"compilers/imcc/imcc.y"3927 #line 1539 "compilers/imcc/imcc.y" 3932 3928 { 3933 3929 mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 0); 3934 3930 is_def=0; … … 3937 3933 break; 3938 3934 3939 3935 case 182: 3940 #line 15 50"compilers/imcc/imcc.y"3936 #line 1546 "compilers/imcc/imcc.y" 3941 3937 { is_def=1; } 3942 3938 break; 3943 3939 3944 3940 case 183: 3945 #line 15 51"compilers/imcc/imcc.y"3941 #line 1547 "compilers/imcc/imcc.y" 3946 3942 { 3947 3943 mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1); 3948 3944 is_def=0; … … 3951 3947 break; 3952 3948 3953 3949 case 184: 3954 #line 155 7"compilers/imcc/imcc.y"3950 #line 1553 "compilers/imcc/imcc.y" 3955 3951 { 3956 3952 (yyval.i) = NULL; 3957 3953 IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isTAIL_CALL; … … 3960 3956 break; 3961 3957 3962 3958 case 185: 3963 #line 15 62"compilers/imcc/imcc.y"3959 #line 1558 "compilers/imcc/imcc.y" 3964 3960 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "branch", 1, (yyvsp[(2) - (2)].sr)); } 3965 3961 break; 3966 3962 3967 3963 case 186: 3968 #line 156 4"compilers/imcc/imcc.y"3964 #line 1560 "compilers/imcc/imcc.y" 3969 3965 { 3970 3966 (yyval.i) = INS(interp, 3971 3967 IMCC_INFO(interp)->cur_unit, … … 3980 3976 break; 3981 3977 3982 3978 case 187: 3983 #line 157 5"compilers/imcc/imcc.y"3979 #line 1571 "compilers/imcc/imcc.y" 3984 3980 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); } 3985 3981 break; 3986 3982 3987 3983 case 188: 3988 #line 157 6"compilers/imcc/imcc.y"3984 #line 1572 "compilers/imcc/imcc.y" 3989 3985 { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; } 3990 3986 break; 3991 3987 3992 3988 case 189: 3993 #line 157 7"compilers/imcc/imcc.y"3989 #line 1573 "compilers/imcc/imcc.y" 3994 3990 { (yyval.i) = 0; } 3995 3991 break; 3996 3992 3997 3993 case 192: 3998 #line 15 80"compilers/imcc/imcc.y"3994 #line 1576 "compilers/imcc/imcc.y" 3999 3995 { (yyval.i) = 0;} 4000 3996 break; 4001 3997 4002 3998 case 193: 4003 #line 158 4"compilers/imcc/imcc.y"3999 #line 1580 "compilers/imcc/imcc.y" 4004 4000 { (yyval.t) = 'I'; } 4005 4001 break; 4006 4002 4007 4003 case 194: 4008 #line 158 5"compilers/imcc/imcc.y"4004 #line 1581 "compilers/imcc/imcc.y" 4009 4005 { (yyval.t) = 'N'; } 4010 4006 break; 4011 4007 4012 4008 case 195: 4013 #line 158 6"compilers/imcc/imcc.y"4009 #line 1582 "compilers/imcc/imcc.y" 4014 4010 { (yyval.t) = 'S'; } 4015 4011 break; 4016 4012 4017 4013 case 196: 4018 #line 158 7"compilers/imcc/imcc.y"4014 #line 1583 "compilers/imcc/imcc.y" 4019 4015 { (yyval.t) = 'P'; } 4020 4016 break; 4021 4017 4022 4018 case 197: 4023 #line 15 92"compilers/imcc/imcc.y"4019 #line 1588 "compilers/imcc/imcc.y" 4024 4020 { 4025 4021 /* there'd normally be a str_dup() here, but the lexer already 4026 4022 * copied the string, so it's safe to use directly */ 4027 if ((IMCC_INFO(interp)->cur_pmc_type = pmc_type(interp,4023 if ((IMCC_INFO(interp)->cur_pmc_type = lookup_typeid_s(interp, 4028 4024 string_from_cstring(interp, (yyvsp[(1) - (1)].s), 0))) <= 0) { 4029 4025 IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, 4030 4026 "Unknown PMC type '%s'\n", (yyvsp[(1) - (1)].s)); … … 4033 4029 break; 4034 4030 4035 4031 case 198: 4036 #line 160 5"compilers/imcc/imcc.y"4032 #line 1601 "compilers/imcc/imcc.y" 4037 4033 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); } 4038 4034 break; 4039 4035 4040 4036 case 199: 4041 #line 160 7"compilers/imcc/imcc.y"4037 #line 1603 "compilers/imcc/imcc.y" 4042 4038 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); } 4043 4039 break; 4044 4040 4045 4041 case 200: 4046 #line 160 9"compilers/imcc/imcc.y"4042 #line 1605 "compilers/imcc/imcc.y" 4047 4043 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(4) - (5)].s), 3, (yyvsp[(1) - (5)].sr), (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); } 4048 4044 break; 4049 4045 4050 4046 case 201: 4051 #line 16 11"compilers/imcc/imcc.y"4047 #line 1607 "compilers/imcc/imcc.y" 4052 4048 { (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); } 4053 4049 break; 4054 4050 4055 4051 case 202: 4056 #line 16 13"compilers/imcc/imcc.y"4052 #line 1609 "compilers/imcc/imcc.y" 4057 4053 { (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); } 4058 4054 break; 4059 4055 4060 4056 case 203: 4061 #line 161 5"compilers/imcc/imcc.y"4057 #line 1611 "compilers/imcc/imcc.y" 4062 4058 { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(4) - (6)].s), (yyvsp[(6) - (6)].sr), 1); } 4063 4059 break; 4064 4060 4065 4061 case 204: 4066 #line 161 7"compilers/imcc/imcc.y"4062 #line 1613 "compilers/imcc/imcc.y" 4067 4063 { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); } 4068 4064 break; 4069 4065 4070 4066 case 205: 4071 #line 161 9"compilers/imcc/imcc.y"4067 #line 1615 "compilers/imcc/imcc.y" 4072 4068 { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].s), NULL, 1); } 4073 4069 break; 4074 4070 4075 4071 case 206: 4076 #line 16 21"compilers/imcc/imcc.y"4072 #line 1617 "compilers/imcc/imcc.y" 4077 4073 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); } 4078 4074 break; 4079 4075 4080 4076 case 207: 4081 #line 16 23"compilers/imcc/imcc.y"4077 #line 1619 "compilers/imcc/imcc.y" 4082 4078 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); } 4083 4079 break; 4084 4080 4085 4081 case 208: 4086 #line 162 5"compilers/imcc/imcc.y"4082 #line 1621 "compilers/imcc/imcc.y" 4087 4083 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 3, (yyvsp[(1) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); } 4088 4084 break; 4089 4085 4090 4086 case 209: 4091 #line 162 7"compilers/imcc/imcc.y"4087 #line 1623 "compilers/imcc/imcc.y" 4092 4088 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 3, (yyvsp[(1) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); } 4093 4089 break; 4094 4090 4095 4091 case 210: 4096 #line 162 9"compilers/imcc/imcc.y"4092 #line 1625 "compilers/imcc/imcc.y" 4097 4093 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 3, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].sr), (yyvsp[(6) - (7)].sr)); } 4098 4094 break; 4099 4095 4100 4096 case 211: 4101 #line 16 33"compilers/imcc/imcc.y"4097 #line 1629 "compilers/imcc/imcc.y" 4102 4098 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr)); } 4103 4099 break; 4104 4100 4105 4101 case 212: 4106 #line 163 5"compilers/imcc/imcc.y"4102 #line 1631 "compilers/imcc/imcc.y" 4107 4103 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); } 4108 4104 break; 4109 4105 4110 4106 case 213: 4111 #line 163 7"compilers/imcc/imcc.y"4107 #line 1633 "compilers/imcc/imcc.y" 4112 4108 { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "new", 3, (yyvsp[(2) - (7)].sr), (yyvsp[(4) - (7)].sr), (yyvsp[(6) - (7)].sr)); } 4113 4109 break; 4114 4110 4115 4111 case 214: 4116 #line 16 40"compilers/imcc/imcc.y"4112 #line 1636 "compilers/imcc/imcc.y" 4117 4113 { 4118 4114 add_pcc_result((yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr)); 4119 4115 IMCC_INFO(interp)->cur_call = NULL; … … 4122 4118 break; 4123 4119 4124 4120 case 215: 4125 #line 164 6"compilers/imcc/imcc.y"4121 #line 1642 "compilers/imcc/imcc.y" 4126 4122 { 4127 4123 (yyval.i) = IMCC_create_itcall_label(interp); 4128 4124 } 4129 4125 break; 4130 4126 4131 4127 case 216: 4132 #line 16 50"compilers/imcc/imcc.y"4128 #line 1646 "compilers/imcc/imcc.y" 4133 4129 { 4134 4130 IMCC_itcall_sub(interp, (yyvsp[(6) - (9)].sr)); 4135 4131 IMCC_INFO(interp)->cur_call = NULL; … … 4137 4133 break; 4138 4134 4139 4135 case 220: 4140 #line 165 8"compilers/imcc/imcc.y"4136 #line 1654 "compilers/imcc/imcc.y" 4141 4137 { 4142 4138 (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(1) - (3)].sr)); 4143 4139 } 4144 4140 break; 4145 4141 4146 4142 case 221: 4147 #line 166 5"compilers/imcc/imcc.y"4143 #line 1661 "compilers/imcc/imcc.y" 4148 4144 { (yyval.s) = (char *)"not"; } 4149 4145 break; 4150 4146 4151 4147 case 222: 4152 #line 166 6"compilers/imcc/imcc.y"4148 #line 1662 "compilers/imcc/imcc.y" 4153 4149 { (yyval.s) = (char *)"bnot"; } 4154 4150 break; 4155 4151 4156 4152 case 223: 4157 #line 166 7"compilers/imcc/imcc.y"4153 #line 1663 "compilers/imcc/imcc.y" 4158 4154 { (yyval.s) = (char *)"neg"; } 4159 4155 break; 4160 4156 4161 4157 case 224: 4162 #line 16 71"compilers/imcc/imcc.y"4158 #line 1667 "compilers/imcc/imcc.y" 4163 4159 { (yyval.s) = (char *)"sub"; } 4164 4160 break; 4165 4161 4166 4162 case 225: 4167 #line 16 72"compilers/imcc/imcc.y"4163 #line 1668 "compilers/imcc/imcc.y" 4168 4164 { (yyval.s) = (char *)"add"; } 4169 4165 break; 4170 4166 4171 4167 case 226: 4172 #line 16 73"compilers/imcc/imcc.y"4168 #line 1669 "compilers/imcc/imcc.y" 4173 4169 { (yyval.s) = (char *)"mul"; } 4174 4170 break; 4175 4171 4176 4172 case 227: 4177 #line 167 4"compilers/imcc/imcc.y"4173 #line 1670 "compilers/imcc/imcc.y" 4178 4174 { (yyval.s) = (char *)"div"; } 4179 4175 break; 4180 4176 4181 4177 case 228: 4182 #line 167 5"compilers/imcc/imcc.y"4178 #line 1671 "compilers/imcc/imcc.y" 4183 4179 { (yyval.s) = (char *)"mod"; } 4184 4180 break; 4185 4181 4186 4182 case 229: 4187 #line 167 6"compilers/imcc/imcc.y"4183 #line 1672 "compilers/imcc/imcc.y" 4188 4184 { (yyval.s) = (char *)"fdiv"; } 4189 4185 break; 4190 4186 4191 4187 case 230: 4192 #line 167 7"compilers/imcc/imcc.y"4188 #line 1673 "compilers/imcc/imcc.y" 4193 4189 { (yyval.s) = (char *)"pow"; } 4194 4190 break; 4195 4191 4196 4192 case 231: 4197 #line 167 8"compilers/imcc/imcc.y"4193 #line 1674 "compilers/imcc/imcc.y" 4198 4194 { (yyval.s) = (char *)"concat"; } 4199 4195 break; 4200 4196 4201 4197 case 232: 4202 #line 167 9"compilers/imcc/imcc.y"4198 #line 1675 "compilers/imcc/imcc.y" 4203 4199 { (yyval.s) = (char *)"iseq"; } 4204 4200 break; 4205 4201 4206 4202 case 233: 4207 #line 16 80"compilers/imcc/imcc.y"4203 #line 1676 "compilers/imcc/imcc.y" 4208 4204 { (yyval.s) = (char *)"isne"; } 4209 4205 break; 4210 4206 4211 4207 case 234: 4212 #line 16 81"compilers/imcc/imcc.y"4208 #line 1677 "compilers/imcc/imcc.y" 4213 4209 { (yyval.s) = (char *)"isgt"; } 4214 4210 break; 4215 4211 4216 4212 case 235: 4217 #line 16 82"compilers/imcc/imcc.y"4213 #line 1678 "compilers/imcc/imcc.y" 4218 4214 { (yyval.s) = (char *)"isge"; } 4219 4215 break; 4220 4216 4221 4217 case 236: 4222 #line 16 83"compilers/imcc/imcc.y"4218 #line 1679 "compilers/imcc/imcc.y" 4223 4219 { (yyval.s) = (char *)"islt"; } 4224 4220 break; 4225 4221 4226 4222 case 237: 4227 #line 168 4"compilers/imcc/imcc.y"4223 #line 1680 "compilers/imcc/imcc.y" 4228 4224 { (yyval.s) = (char *)"isle"; } 4229 4225 break; 4230 4226 4231 4227 case 238: 4232 #line 168 5"compilers/imcc/imcc.y"4228 #line 1681 "compilers/imcc/imcc.y" 4233 4229 { (yyval.s) = (char *)"shl"; } 4234 4230 break; 4235 4231 4236 4232 case 239: 4237 #line 168 6"compilers/imcc/imcc.y"4233 #line 1682 "compilers/imcc/imcc.y" 4238 4234 { (yyval.s) = (char *)"shr"; } 4239 4235 break; 4240 4236 4241 4237 case 240: 4242 #line 168 7"compilers/imcc/imcc.y"4238 #line 1683 "compilers/imcc/imcc.y" 4243 4239 { (yyval.s) = (char *)"lsr"; } 4244 4240 break; 4245 4241 4246 4242 case 241: 4247 #line 168 8"compilers/imcc/imcc.y"4243 #line 1684 "compilers/imcc/imcc.y" 4248 4244 { (yyval.s) = (char *)"and"; } 4249 4245 break; 4250 4246 4251 4247 case 242: 4252 #line 168 9"compilers/imcc/imcc.y"4248 #line 1685 "compilers/imcc/imcc.y" 4253 4249 { (yyval.s) = (char *)"or"; } 4254 4250 break; 4255 4251 4256 4252 case 243: 4257 #line 16 90"compilers/imcc/imcc.y"4253 #line 1686 "compilers/imcc/imcc.y" 4258 4254 { (yyval.s) = (char *)"xor"; } 4259 4255 break; 4260 4256 4261 4257 case 244: 4262 #line 16 91"compilers/imcc/imcc.y"4258 #line 1687 "compilers/imcc/imcc.y" 4263 4259 { (yyval.s) = (char *)"band"; } 4264 4260 break; 4265 4261 4266 4262 case 245: 4267 #line 16 92"compilers/imcc/imcc.y"4263 #line 1688 "compilers/imcc/imcc.y" 4268 4264 { (yyval.s) = (char *)"bor"; } 4269 4265 break; 4270 4266 4271 4267 case 246: 4272 #line 16 93"compilers/imcc/imcc.y"4268 #line 1689 "compilers/imcc/imcc.y" 4273 4269 { (yyval.s) = (char *)"bxor"; } 4274 4270 break; 4275 4271 4276 4272 case 247: 4277 #line 169 9"compilers/imcc/imcc.y"4273 #line 1695 "compilers/imcc/imcc.y" 4278 4274 { 4279 4275 (yyval.i) = IMCC_create_itcall_label(interp); 4280 4276 (yyval.i)->type &= ~ITCALL; … … 4283 4279 break; 4284 4280 4285 4281 case 248: 4286 #line 170 4"compilers/imcc/imcc.y"4282 #line 1700 "compilers/imcc/imcc.y" 4287 4283 { (yyval.i) = 0; } 4288 4284 break; 4289 4285 4290 4286 case 249: 4291 #line 17 11"compilers/imcc/imcc.y"4287 #line 1707 "compilers/imcc/imcc.y" 4292 4288 { 4293 4289 (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(2) - (3)].s), 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); 4294 4290 } 4295 4291 break; 4296 4292 4297 4293 case 250: 4298 #line 171 7"compilers/imcc/imcc.y"4294 #line 1713 "compilers/imcc/imcc.y" 4299 4295 { (yyval.s) = (char *)"add"; } 4300 4296 break; 4301 4297 4302 4298 case 251: 4303 #line 171 8"compilers/imcc/imcc.y"4299 #line 1714 "compilers/imcc/imcc.y" 4304 4300 { (yyval.s) = (char *)"sub"; } 4305 4301 break; 4306 4302 4307 4303 case 252: 4308 #line 171 9"compilers/imcc/imcc.y"4304 #line 1715 "compilers/imcc/imcc.y" 4309 4305 { (yyval.s) = (char *)"mul"; } 4310 4306 break; 4311 4307 4312 4308 case 253: 4313 #line 17 20"compilers/imcc/imcc.y"4309 #line 1716 "compilers/imcc/imcc.y" 4314 4310 { (yyval.s) = (char *)"div"; } 4315 4311 break; 4316 4312 4317 4313 case 254: 4318 #line 17 21"compilers/imcc/imcc.y"4314 #line 1717 "compilers/imcc/imcc.y" 4319 4315 { (yyval.s) = (char *)"mod"; } 4320 4316 break; 4321 4317 4322 4318 case 255: 4323 #line 17 22"compilers/imcc/imcc.y"4319 #line 1718 "compilers/imcc/imcc.y" 4324 4320 { (yyval.s) = (char *)"fdiv"; } 4325 4321 break; 4326 4322 4327 4323 case 256: 4328 #line 17 23"compilers/imcc/imcc.y"4324 #line 1719 "compilers/imcc/imcc.y" 4329 4325 { (yyval.s) = (char *)"concat"; } 4330 4326 break; 4331 4327 4332 4328 case 257: 4333 #line 172 4"compilers/imcc/imcc.y"4329 #line 1720 "compilers/imcc/imcc.y" 4334 4330 { (yyval.s) = (char *)"band"; } 4335 4331 break; 4336 4332 4337 4333 case 258: 4338 #line 172 5"compilers/imcc/imcc.y"4334 #line 1721 "compilers/imcc/imcc.y" 4339 4335 { (yyval.s) = (char *)"bor"; } 4340 4336 break; 4341 4337 4342 4338 case 259: 4343 #line 172 6"compilers/imcc/imcc.y"4339 #line 1722 "compilers/imcc/imcc.y" 4344 4340 { (yyval.s) = (char *)"bxor"; } 4345 4341 break; 4346 4342 4347 4343 case 260: 4348 #line 172 7"compilers/imcc/imcc.y"4344 #line 1723 "compilers/imcc/imcc.y" 4349 4345 { (yyval.s) = (char *)"shr"; } 4350 4346 break; 4351 4347 4352 4348 case 261: 4353 #line 172 8"compilers/imcc/imcc.y"4349 #line 1724 "compilers/imcc/imcc.y" 4354 4350 { (yyval.s) = (char *)"shl"; } 4355 4351 break; 4356 4352 4357 4353 case 262: 4358 #line 172 9"compilers/imcc/imcc.y"4354 #line 1725 "compilers/imcc/imcc.y" 4359 4355 { (yyval.s) = (char *)"lsr"; } 4360 4356 break; 4361 4357 4362 4358 case 263: 4363 #line 173 5"compilers/imcc/imcc.y"4359 #line 1731 "compilers/imcc/imcc.y" 4364 4360 { 4365 4361 (yyval.i) = func_ins(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (4)].sr), (yyvsp[(3) - (4)].s), 4366 4362 IMCC_INFO(interp) -> regs, … … 4371 4367 break; 4372 4368 4373 4369 case 264: 4374 #line 174 5"compilers/imcc/imcc.y"4370 #line 1741 "compilers/imcc/imcc.y" 4375 4371 { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4376 4372 break; 4377 4373 4378 4374 case 265: 4379 #line 174 6"compilers/imcc/imcc.y"4375 #line 1742 "compilers/imcc/imcc.y" 4380 4376 { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4381 4377 break; 4382 4378 4383 4379 case 266: 4384 #line 174 7"compilers/imcc/imcc.y"4380 #line 1743 "compilers/imcc/imcc.y" 4385 4381 { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4386 4382 break; 4387 4383 4388 4384 case 267: 4389 #line 174 9"compilers/imcc/imcc.y"4385 #line 1745 "compilers/imcc/imcc.y" 4390 4386 { 4391 4387 (yyval.sr) = (yyvsp[(1) - (1)].sr); 4392 4388 if ((yyvsp[(1) - (1)].sr)->set != 'P') … … 4395 4391 break; 4396 4392 4397 4393 case 268: 4398 #line 175 5"compilers/imcc/imcc.y"4394 #line 1751 "compilers/imcc/imcc.y" 4399 4395 { 4400 4396 /* disallow bareword method names; SREG name constants are fine */ 4401 4397 char *name = (yyvsp[(3) - (3)].sr)->name; … … 4412 4408 break; 4413 4409 4414 4410 case 269: 4415 #line 176 9"compilers/imcc/imcc.y"4411 #line 1765 "compilers/imcc/imcc.y" 4416 4412 { 4417 4413 IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); 4418 4414 (yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'S'); … … 4421 4417 break; 4422 4418 4423 4419 case 270: 4424 #line 177 4"compilers/imcc/imcc.y"4420 #line 1770 "compilers/imcc/imcc.y" 4425 4421 { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); } 4426 4422 break; 4427 4423 4428 4424 case 271: 4429 #line 17 80"compilers/imcc/imcc.y"4425 #line 1776 "compilers/imcc/imcc.y" 4430 4426 { 4431 4427 (yyval.i) = IMCC_create_itcall_label(interp); 4432 4428 IMCC_itcall_sub(interp, (yyvsp[(1) - (1)].sr)); … … 4434 4430 break; 4435 4431 4436 4432 case 272: 4437 #line 178 4"compilers/imcc/imcc.y"4433 #line 1780 "compilers/imcc/imcc.y" 4438 4434 { (yyval.i) = (yyvsp[(2) - (5)].i); } 4439 4435 break; 4440 4436 4441 4437 case 273: 4442 #line 178 8"compilers/imcc/imcc.y"4438 #line 1784 "compilers/imcc/imcc.y" 4443 4439 { (yyval.sr) = 0; } 4444 4440 break; 4445 4441 4446 4442 case 274: 4447 #line 17 90"compilers/imcc/imcc.y"4443 #line 1786 "compilers/imcc/imcc.y" 4448 4444 { 4449 4445 (yyval.sr) = 0; 4450 4446 if (IMCC_INFO(interp)->adv_named_id) { … … 4457 4453 break; 4458 4454 4459 4455 case 275: 4460 #line 1 800"compilers/imcc/imcc.y"4456 #line 1796 "compilers/imcc/imcc.y" 4461 4457 { 4462 4458 (yyval.sr) = 0; 4463 4459 if (IMCC_INFO(interp)->adv_named_id) { … … 4470 4466 break; 4471 4467 4472 4468 case 276: 4473 #line 18 10"compilers/imcc/imcc.y"4469 #line 1806 "compilers/imcc/imcc.y" 4474 4470 { 4475 4471 (yyval.sr) = 0; 4476 4472 add_pcc_named_arg(interp, IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (5)].s), (yyvsp[(5) - (5)].sr)); … … 4479 4475 break; 4480 4476 4481 4477 case 277: 4482 #line 181 6"compilers/imcc/imcc.y"4478 #line 1812 "compilers/imcc/imcc.y" 4483 4479 { 4484 4480 (yyval.sr) = 0; 4485 4481 add_pcc_named_arg(interp, IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (3)].s), (yyvsp[(3) - (3)].sr)); … … 4488 4484 break; 4489 4485 4490 4486 case 278: 4491 #line 182 4"compilers/imcc/imcc.y"4487 #line 1820 "compilers/imcc/imcc.y" 4492 4488 { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); } 4493 4489 break; 4494 4490 4495 4491 case 279: 4496 #line 182 8"compilers/imcc/imcc.y"4492 #line 1824 "compilers/imcc/imcc.y" 4497 4493 { (yyval.t) = 0; } 4498 4494 break; 4499 4495 4500 4496 case 280: 4501 #line 182 9"compilers/imcc/imcc.y"4497 #line 1825 "compilers/imcc/imcc.y" 4502 4498 { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); } 4503 4499 break; 4504 4500 4505 4501 case 281: 4506 #line 18 33"compilers/imcc/imcc.y"4502 #line 1829 "compilers/imcc/imcc.y" 4507 4503 { (yyval.t) = VT_FLAT; } 4508 4504 break; 4509 4505 4510 4506 case 282: 4511 #line 183 4"compilers/imcc/imcc.y"4507 #line 1830 "compilers/imcc/imcc.y" 4512 4508 { (yyval.t) = VT_NAMED; } 4513 4509 break; 4514 4510 4515 4511 case 283: 4516 #line 183 7"compilers/imcc/imcc.y"4512 #line 1833 "compilers/imcc/imcc.y" 4517 4513 { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; } 4518 4514 break; 4519 4515 4520 4516 case 284: 4521 #line 18 41"compilers/imcc/imcc.y"4517 #line 1837 "compilers/imcc/imcc.y" 4522 4518 { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); } 4523 4519 break; 4524 4520 4525 4521 case 285: 4526 #line 184 6"compilers/imcc/imcc.y"4522 #line 1842 "compilers/imcc/imcc.y" 4527 4523 { 4528 4524 (yyval.sr) = 0; 4529 4525 if (IMCC_INFO(interp)->adv_named_id) { … … 4536 4532 break; 4537 4533 4538 4534 case 286: 4539 #line 185 6"compilers/imcc/imcc.y"4535 #line 1852 "compilers/imcc/imcc.y" 4540 4536 { 4541 4537 add_pcc_named_result(interp, IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (5)].s), (yyvsp[(5) - (5)].sr)); 4542 4538 mem_sys_free((yyvsp[(3) - (5)].s)); … … 4544 4540 break; 4545 4541 4546 4542 case 287: 4547 #line 18 61"compilers/imcc/imcc.y"4543 #line 1857 "compilers/imcc/imcc.y" 4548 4544 { 4549 4545 (yyval.sr) = 0; 4550 4546 if (IMCC_INFO(interp)->adv_named_id) { … … 4557 4553 break; 4558 4554 4559 4555 case 288: 4560 #line 18 71"compilers/imcc/imcc.y"4556 #line 1867 "compilers/imcc/imcc.y" 4561 4557 { 4562 4558 add_pcc_named_result(interp, IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (3)].s), (yyvsp[(3) - (3)].sr)); 4563 4559 mem_sys_free((yyvsp[(1) - (3)].s)); … … 4565 4561 break; 4566 4562 4567 4563 case 289: 4568 #line 187 5"compilers/imcc/imcc.y"4564 #line 1871 "compilers/imcc/imcc.y" 4569 4565 { (yyval.sr) = 0; } 4570 4566 break; 4571 4567 4572 4568 case 290: 4573 #line 187 9"compilers/imcc/imcc.y"4569 #line 1875 "compilers/imcc/imcc.y" 4574 4570 { (yyval.i) = (yyvsp[(1) - (1)].i); } 4575 4571 break; 4576 4572 4577 4573 case 291: 4578 #line 18 80"compilers/imcc/imcc.y"4574 #line 1876 "compilers/imcc/imcc.y" 4579 4575 { (yyval.i) = (yyvsp[(1) - (1)].i); } 4580 4576 break; 4581 4577 4582 4578 case 292: 4583 #line 188 5"compilers/imcc/imcc.y"4579 #line 1881 "compilers/imcc/imcc.y" 4584 4580 { 4585 4581 (yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, inv_op((yyvsp[(3) - (6)].s)), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); 4586 4582 } 4587 4583 break; 4588 4584 4589 4585 case 293: 4590 #line 188 9"compilers/imcc/imcc.y"4586 #line 1885 "compilers/imcc/imcc.y" 4591 4587 { 4592 4588 (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); 4593 4589 } 4594 4590 break; 4595 4591 4596 4592 case 294: 4597 #line 18 93"compilers/imcc/imcc.y"4593 #line 1889 "compilers/imcc/imcc.y" 4598 4594 { 4599 4595 (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr)); 4600 4596 } 4601 4597 break; 4602 4598 4603 4599 case 295: 4604 #line 1 900"compilers/imcc/imcc.y"4600 #line 1896 "compilers/imcc/imcc.y" 4605 4601 { 4606 4602 (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr)); 4607 4603 } 4608 4604 break; 4609 4605 4610 4606 case 296: 4611 #line 190 4"compilers/imcc/imcc.y"4607 #line 1900 "compilers/imcc/imcc.y" 4612 4608 { 4613 4609 (yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr)); 4614 4610 } 4615 4611 break; 4616 4612 4617 4613 case 297: 4618 #line 190 8"compilers/imcc/imcc.y"4614 #line 1904 "compilers/imcc/imcc.y" 4619 4615 { 4620 4616 (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); 4621 4617 } 4622 4618 break; 4623 4619 4624 4620 case 298: 4625 #line 191 4"compilers/imcc/imcc.y"4621 #line 1910 "compilers/imcc/imcc.y" 4626 4622 { (yyval.t) = 0; } 4627 4623 break; 4628 4624 4629 4625 case 299: 4630 #line 191 5"compilers/imcc/imcc.y"4626 #line 1911 "compilers/imcc/imcc.y" 4631 4627 { (yyval.t) = 0; } 4632 4628 break; 4633 4629 4634 4630 case 300: 4635 #line 191 9"compilers/imcc/imcc.y"4631 #line 1915 "compilers/imcc/imcc.y" 4636 4632 { (yyval.s) = (char *)"eq"; } 4637 4633 break; 4638 4634 4639 4635 case 301: 4640 #line 19 20"compilers/imcc/imcc.y"4636 #line 1916 "compilers/imcc/imcc.y" 4641 4637 { (yyval.s) = (char *)"ne"; } 4642 4638 break; 4643 4639 4644 4640 case 302: 4645 #line 19 21"compilers/imcc/imcc.y"4641 #line 1917 "compilers/imcc/imcc.y" 4646 4642 { (yyval.s) = (char *)"gt"; } 4647 4643 break; 4648 4644 4649 4645 case 303: 4650 #line 19 22"compilers/imcc/imcc.y"4646 #line 1918 "compilers/imcc/imcc.y" 4651 4647 { (yyval.s) = (char *)"ge"; } 4652 4648 break; 4653 4649 4654 4650 case 304: 4655 #line 19 23"compilers/imcc/imcc.y"4651 #line 1919 "compilers/imcc/imcc.y" 4656 4652 { (yyval.s) = (char *)"lt"; } 4657 4653 break; 4658 4654 4659 4655 case 305: 4660 #line 192 4"compilers/imcc/imcc.y"4656 #line 1920 "compilers/imcc/imcc.y" 4661 4657 { (yyval.s) = (char *)"le"; } 4662 4658 break; 4663 4659 4664 4660 case 308: 4665 #line 19 33"compilers/imcc/imcc.y"4661 #line 1929 "compilers/imcc/imcc.y" 4666 4662 { (yyval.sr) = NULL; } 4667 4663 break; 4668 4664 4669 4665 case 309: 4670 #line 193 4"compilers/imcc/imcc.y"4666 #line 1930 "compilers/imcc/imcc.y" 4671 4667 { (yyval.sr) = (yyvsp[(1) - (1)].sr); } 4672 4668 break; 4673 4669 4674 4670 case 310: 4675 #line 193 8"compilers/imcc/imcc.y"4671 #line 1934 "compilers/imcc/imcc.y" 4676 4672 { (yyval.sr) = IMCC_INFO(interp)->regs[0]; } 4677 4673 break; 4678 4674 4679 4675 case 312: 4680 #line 19 43"compilers/imcc/imcc.y"4676 #line 1939 "compilers/imcc/imcc.y" 4681 4677 { IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); } 4682 4678 break; 4683 4679 4684 4680 case 313: 4685 #line 194 5"compilers/imcc/imcc.y"4681 #line 1941 "compilers/imcc/imcc.y" 4686 4682 { 4687 4683 IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (4)].sr); 4688 4684 IMCC_INFO(interp) -> keyvec |= KEY_BIT(IMCC_INFO(interp)->nargs); … … 4692 4688 break; 4693 4689 4694 4690 case 314: 4695 #line 19 52"compilers/imcc/imcc.y"4691 #line 1948 "compilers/imcc/imcc.y" 4696 4692 { 4697 4693 IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(2) - (3)].sr); 4698 4694 (yyval.sr) = (yyvsp[(2) - (3)].sr); … … 4700 4696 break; 4701 4697 4702 4698 case 316: 4703 #line 195 9"compilers/imcc/imcc.y"4699 #line 1955 "compilers/imcc/imcc.y" 4704 4700 { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4705 4701 break; 4706 4702 4707 4703 case 317: 4708 #line 19 60"compilers/imcc/imcc.y"4704 #line 1956 "compilers/imcc/imcc.y" 4709 4705 { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4710 4706 break; 4711 4707 4712 4708 case 318: 4713 #line 196 4"compilers/imcc/imcc.y"4709 #line 1960 "compilers/imcc/imcc.y" 4714 4710 { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4715 4711 break; 4716 4712 4717 4713 case 319: 4718 #line 196 5"compilers/imcc/imcc.y"4714 #line 1961 "compilers/imcc/imcc.y" 4719 4715 { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4720 4716 break; 4721 4717 4722 4718 case 320: 4723 #line 196 9"compilers/imcc/imcc.y"4719 #line 1965 "compilers/imcc/imcc.y" 4724 4720 { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4725 4721 break; 4726 4722 4727 4723 case 321: 4728 #line 19 70"compilers/imcc/imcc.y"4724 #line 1966 "compilers/imcc/imcc.y" 4729 4725 { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4730 4726 break; 4731 4727 4732 4728 case 326: 4733 #line 198 4"compilers/imcc/imcc.y"4729 #line 1980 "compilers/imcc/imcc.y" 4734 4730 { 4735 4731 IMCC_INFO(interp)->nkeys = 0; 4736 4732 IMCC_INFO(interp)->in_slice = 0; … … 4738 4734 break; 4739 4735 4740 4736 case 327: 4741 #line 198 9"compilers/imcc/imcc.y"4737 #line 1985 "compilers/imcc/imcc.y" 4742 4738 { 4743 4739 (yyval.sr) = link_keys(interp, 4744 4740 IMCC_INFO(interp)->nkeys, … … 4747 4743 break; 4748 4744 4749 4745 case 328: 4750 #line 199 7"compilers/imcc/imcc.y"4746 #line 1993 "compilers/imcc/imcc.y" 4751 4747 { 4752 4748 IMCC_INFO(interp)->nkeys = 0; 4753 4749 IMCC_INFO(interp)->in_slice = 0; … … 4755 4751 break; 4756 4752 4757 4753 case 329: 4758 #line 2002"compilers/imcc/imcc.y"4754 #line 1998 "compilers/imcc/imcc.y" 4759 4755 { 4760 4756 (yyval.sr) = link_keys(interp, 4761 4757 IMCC_INFO(interp)->nkeys, … … 4764 4760 break; 4765 4761 4766 4762 case 330: 4767 #line 20 10"compilers/imcc/imcc.y"4763 #line 2006 "compilers/imcc/imcc.y" 4768 4764 { IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); } 4769 4765 break; 4770 4766 4771 4767 case 331: 4772 #line 20 12"compilers/imcc/imcc.y"4768 #line 2008 "compilers/imcc/imcc.y" 4773 4769 { 4774 4770 IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr); 4775 4771 (yyval.sr) = IMCC_INFO(interp)->keys[0]; … … 4777 4773 break; 4778 4774 4779 4775 case 332: 4780 #line 20 20"compilers/imcc/imcc.y"4776 #line 2016 "compilers/imcc/imcc.y" 4781 4777 { 4782 4778 if (IMCC_INFO(interp)->in_slice) 4783 4779 (yyvsp[(1) - (1)].sr)->type |= VT_START_SLICE | VT_END_SLICE; … … 4786 4782 break; 4787 4783 4788 4784 case 333: 4789 #line 202 8"compilers/imcc/imcc.y"4785 #line 2024 "compilers/imcc/imcc.y" 4790 4786 { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); } 4791 4787 break; 4792 4788 4793 4789 case 334: 4794 #line 202 9"compilers/imcc/imcc.y"4790 #line 2025 "compilers/imcc/imcc.y" 4795 4791 { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); } 4796 4792 break; 4797 4793 4798 4794 case 335: 4799 #line 20 30"compilers/imcc/imcc.y"4795 #line 2026 "compilers/imcc/imcc.y" 4800 4796 { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); } 4801 4797 break; 4802 4798 4803 4799 case 336: 4804 #line 20 31"compilers/imcc/imcc.y"4800 #line 2027 "compilers/imcc/imcc.y" 4805 4801 { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); } 4806 4802 break; 4807 4803 4808 4804 case 337: 4809 #line 20 32"compilers/imcc/imcc.y"4805 #line 2028 "compilers/imcc/imcc.y" 4810 4806 { (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); } 4811 4807 break; 4812 4808 4813 4809 case 338: 4814 #line 203 6"compilers/imcc/imcc.y"4810 #line 2032 "compilers/imcc/imcc.y" 4815 4811 { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); } 4816 4812 break; 4817 4813 4818 4814 case 339: 4819 #line 203 7"compilers/imcc/imcc.y"4815 #line 2033 "compilers/imcc/imcc.y" 4820 4816 { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); } 4821 4817 break; 4822 4818 4823 4819 case 340: 4824 #line 203 8"compilers/imcc/imcc.y"4820 #line 2034 "compilers/imcc/imcc.y" 4825 4821 { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); } 4826 4822 break; 4827 4823 4828 4824 case 341: 4829 #line 203 9"compilers/imcc/imcc.y"4825 #line 2035 "compilers/imcc/imcc.y" 4830 4826 { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); } 4831 4827 break; 4832 4828 4833 4829 4834 4830 /* Line 1267 of yacc.c. */ 4835 #line 482 5"compilers/imcc/imcparser.c"4831 #line 4821 "compilers/imcc/imcparser.c" 4836 4832 default: break; 4837 4833 } 4838 4834 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); … … 5046 5042 } 5047 5043 5048 5044 5049 #line 204 5"compilers/imcc/imcc.y"5045 #line 2041 "compilers/imcc/imcc.y" 5050 5046 5051 5047 5052 5048 /* I need this prototype somewhere... */ -
compilers/imcc/parser_util.c
132 132 SymReg *regs[3]; 133 133 SymReg *pmc; 134 134 int nargs; 135 const int pmc_num = pmc_type(interp,135 const int pmc_num = lookup_typeid_s(interp, 136 136 string_from_cstring(interp, *type == '.' ? type + 1 : type, 0)); 137 137 138 138 snprintf(fmt, sizeof (fmt), "%d", pmc_num); -
compilers/imcc/imcparser.h
303 303 SymReg * sr; 304 304 Instruction *i; 305 305 } 306 /* Line 1 529 of yacc.c. */306 /* Line 1489 of yacc.c. */ 307 307 #line 297 "compilers/imcc/imcparser.h" 308 308 YYSTYPE; 309 309 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ -
compilers/pirc/new/pircompunit.c
1749 1749 Parrot_Context *ctx = CONTEXT(lexer->interp); 1750 1750 STRING * const built_in_name = string_from_cstring(lexer->interp, stdtype, strlen(stdtype)); 1751 1751 STRING * const language_name = string_from_cstring(lexer->interp, maptype, strlen(maptype)); 1752 int built_in_type = pmc_type(lexer->interp, built_in_name);1753 int language_type = pmc_type(lexer->interp, language_name);1752 int built_in_type = lookup_typeid_s(lexer->interp, built_in_name); 1753 int language_type = lookup_typeid_s(lexer->interp, language_name); 1754 1754 1755 1755 /* check if both the built-in and language types exist. */ 1756 1756 -
t/pmc/key.t
142 142 pir_compiler = compreg 'PIR' 143 143 $P0 = pir_compiler($S0) 144 144 $P0 = $P0[0] 145 $P1 = new 'TclProc' 145 $P2 = get_root_global ['_tcl'], 'TclProc' 146 $P1 = new $P2 146 147 assign $P1, $P0 147 148 .local pmc ns_target 148 149 ns_target = get_hll_namespace -
t/pmc/objects.t
21 21 .include "iglobals.pasm" 22 22 .include "interpinfo.pasm" 23 23 24 plan(19 4)24 plan(191) 25 25 26 26 get_classname_from_class() 27 27 test_get_class() … … 68 68 short_name_attributes() 69 69 init_with_and_without_arg() 70 70 newclass_bracket_parsing() 71 verify_namespace_types()72 verify_data_type()73 71 new_keyed() 74 72 new_keyed_2() 75 73 new_keyed_3() … … 1166 1164 ok( 1, 'newclass created with brackets' ) 1167 1165 .end 1168 1166 1169 .sub verify_namespace_types1170 newclass $P0, ['Foo24';'Bar24']1171 getinterp $P01172 set $P1, $P0[.IGLOBALS_CLASSNAME_HASH]1173 typeof $S0, $P11174 is( $S0, 'NameSpace', 'namespace verified' )1175 1176 set $P2, $P1['Foo24']1177 typeof $S0, $P21178 is( $S0, 'NameSpace', 'namespace verified' )1179 .end1180 1181 .sub verify_data_type1182 newclass $P0, ['Foo25';'Bar25']1183 getinterp $P01184 set $P1, $P0[.IGLOBALS_CLASSNAME_HASH]1185 set $P2, $P1['Foo25']1186 set $P3, $P2['Bar25']1187 1188 set $I0, $P31189 isgt $I0, $I0, 01190 ok( $I0, 'verified datatype > 0' )1191 .end1192 1193 1167 # Puts init in a namespace 1194 1168 .sub new_keyed 1195 1169 .local pmc cl, o, p -
t/compilers/imcc/syn/hll.t
38 38 : (); 39 39 pir_output_is( <<'CODE', <<'OUT', ".param :slurpy (using object)", @todo ); 40 40 41 .HLL 'misc' 41 42 .sub setup :anon :immediate 42 43 $P0 = subclass 'ResizablePMCArray', 'Stack' 43 44 .end 44 45 45 .HLL 'misc'46 46 .HLL_map 'ResizablePMCArray' = 'Stack' 47 47 48 48 .sub main :main -
t/oo/names.t
44 44 $P0.'name'('Object') 45 45 pop_eh 46 46 $S0 = $P0 47 ok ( 0, 'HLL obj created w/ same name as parrot obj')47 ok (1, 'HLL obj created w/ same name as parrot obj') 48 48 .return() 49 49 OK_1: 50 ok ( 1, 'HLL obj w/ same name as parrot obj not created')50 ok (0, 'HLL obj w/ same name as parrot obj not created') 51 51 .end 52 52 53 53 # Local Variables: -
t/oo/isa.t
27 27 subclass_isa_by_string_name() 28 28 subclass_isa_by_class_object() 29 29 string_isa_and_pmc_isa_have_same_result() 30 string_register_and_string_pmc_isa_have_same_result() 30 $P0 = get_root_global ['foo'; 'XYZ'], 'string_register_and_string_pmc_isa_have_same_result' 31 $P0() 31 32 .end 32 33 33 34 … … 151 152 ok ($I1, 'isa String instance an Object') 152 153 .end 153 154 155 .HLL 'foo' 156 .namespace ['XYZ'] 157 158 .sub 'abc' :method 159 .return( 'XYZ::abc' ) 160 .end 161 154 162 .sub string_register_and_string_pmc_isa_have_same_result 163 .include 'include/test_more.pir' 155 164 .local pmc xyzns, xyzclass, xyzobj 156 165 157 166 xyzns = get_root_namespace ['foo';'XYZ'] … … 181 190 ok( $I0, '... and false when it is not' ) 182 191 .end 183 192 184 .HLL 'foo'185 .namespace ['XYZ']186 187 .sub 'abc' :method188 .return( 'XYZ::abc' )189 .end190 191 193 # Local Variables: 192 194 # mode: pir 193 195 # fill-column: 100 -
t/op/box.t
19 19 .const int TESTS = 24 20 20 21 21 # must set these up before the .HLL_map statements later 22 .sub '__setup' :immediate23 $P0 = subclass 'Integer', 'MyInt'24 $P0 = subclass 'String', 'MyString'25 $P0 = subclass 'Float', 'MyFloat'26 .end27 22 28 23 .sub 'main' :main 29 24 .include 'include/test_more.pir' … … 94 89 95 90 .HLL 'for_test' 96 91 92 .sub '__setup' :immediate 93 $P0 = subclass 'Integer', 'MyInt' 94 $P0 = subclass 'String', 'MyString' 95 $P0 = subclass 'Float', 'MyFloat' 96 .end 97 97 98 .HLL_map 'Integer' = 'MyInt' 98 99 .HLL_map 'String' = 'MyString' 99 100 .HLL_map 'Float' = 'MyFloat' 100 101 101 102 .sub 'box_int' 103 $P1 = get_hll_global 'MyInt' 102 104 .include 'include/test_more.pir' 103 105 $P0 = box -100 104 106 $I0 = $P0 105 107 is( $I0, -100, 'value preserved when boxing int in HLL' ) 106 108 107 isa_ok( $P0, 'MyInt', 'int boxed to appropriate base type for HLL' )109 isa_ok( $P0, $P1, 'int boxed to appropriate base type for HLL' ) 108 110 109 111 $I0 = -999 110 112 $P0 = box $I0 111 113 $I0 = $P0 112 114 is( $I0, -999, 'value preserved when boxing int in HLL from reg' ) 113 115 114 isa_ok( $P0, 'MyInt', 'int boxed to appropriate type for HLL from reg')116 isa_ok( $P0, $P1, 'int boxed to appropriate type for HLL from reg') 115 117 .end 116 118 117 119 .sub 'box_num' 120 $P1 = get_hll_global 'MyFloat' 118 121 $P0 = box -77.7 119 122 $N0 = $P0 120 123 is( $N0, -77.7, 'value preserved when boxing num in HLL' ) 121 124 122 isa_ok( $P0, 'MyFloat', 'num boxed to appropriate base type for HLL' )125 isa_ok( $P0, $P1, 'num boxed to appropriate base type for HLL' ) 123 126 124 127 $N0 = -222222.222222 125 128 $P0 = box $N0 126 129 $N0 = $P0 127 130 is( $N0, -222222.222222, 'value preserved when boxing num in HLL from reg' ) 128 131 129 isa_ok( $P0, 'MyFloat', 'num boxed to appropriate type for HLL from reg' )132 isa_ok( $P0, $P1, 'num boxed to appropriate type for HLL from reg' ) 130 133 .end 131 134 132 135 .sub 'box_string' 136 $P1 = get_hll_global 'MyString' 133 137 $P0 = box 'Bye, bye!' 134 138 $S0 = $P0 135 139 is( $S0, 'Bye, bye!', 'value preserved when boxing string in HLL' ) 136 140 137 isa_ok( $P0, 'MyString', 'string boxed to appropriate base type for HLL' )141 isa_ok( $P0, $P1, 'string boxed to appropriate base type for HLL' ) 138 142 139 143 $S0 = 'Hello, goodbye!' 140 144 $P0 = box $S0 141 145 $S0 = $P0 142 146 is( $S0, 'Hello, goodbye!', 'value preserved when boxing string in HLL from reg' ) 143 147 144 isa_ok($P0, 'MyString', 'string boxed to appropriate type for HLL from reg')148 isa_ok($P0, $P1, 'string boxed to appropriate type for HLL from reg') 145 149 .end 146 150 147 151 # Local Variables: