[svn:parrot] r39482 - in branches/pmc_i_ops: . compilers/imcc docs docs/book docs/pdds include/parrot lib/Parrot runtime/parrot/languages/parrot src src/gc src/io src/ops src/pmc src/runcore src/string t/compilers/imcc/syn t/library t/native_pbc t/op t/pmc t/steps t/tools/install t/tools/ops2pm tools/dev tools/install
bacek at svn.parrot.org
bacek at svn.parrot.org
Tue Jun 9 22:26:34 UTC 2009
Author: bacek
Date: Tue Jun 9 22:26:30 2009
New Revision: 39482
URL: https://trac.parrot.org/parrot/changeset/39482
Log:
Sync branch with trunk.
Added:
branches/pmc_i_ops/src/pmc/handle.pmc
Modified:
branches/pmc_i_ops/DEPRECATED.pod
branches/pmc_i_ops/MANIFEST
branches/pmc_i_ops/NEWS
branches/pmc_i_ops/PBC_COMPAT
branches/pmc_i_ops/PLATFORMS
branches/pmc_i_ops/README
branches/pmc_i_ops/README_win32.pod
branches/pmc_i_ops/compilers/imcc/imcc.l
branches/pmc_i_ops/compilers/imcc/imcc.y
branches/pmc_i_ops/compilers/imcc/imclexer.c
branches/pmc_i_ops/compilers/imcc/imcparser.c
branches/pmc_i_ops/compilers/imcc/imcparser.h
branches/pmc_i_ops/compilers/imcc/main.c
branches/pmc_i_ops/compilers/imcc/parser_util.c
branches/pmc_i_ops/compilers/imcc/pcc.c
branches/pmc_i_ops/compilers/imcc/reg_alloc.c
branches/pmc_i_ops/compilers/imcc/symreg.c
branches/pmc_i_ops/docs/book/appc_command_line_options.pod
branches/pmc_i_ops/docs/pdds/pdd28_strings.pod
branches/pmc_i_ops/docs/running.pod
branches/pmc_i_ops/include/parrot/embed.h
branches/pmc_i_ops/include/parrot/io.h
branches/pmc_i_ops/include/parrot/io_portable.h
branches/pmc_i_ops/include/parrot/io_unix.h
branches/pmc_i_ops/include/parrot/io_win32.h
branches/pmc_i_ops/include/parrot/library.h
branches/pmc_i_ops/include/parrot/runcore_api.h
branches/pmc_i_ops/lib/Parrot/Install.pm
branches/pmc_i_ops/lib/Parrot/Ops2pm.pm
branches/pmc_i_ops/runtime/parrot/languages/parrot/parrot.pir
branches/pmc_i_ops/src/embed.c
branches/pmc_i_ops/src/gc/alloc_register.c
branches/pmc_i_ops/src/hash.c
branches/pmc_i_ops/src/io/api.c
branches/pmc_i_ops/src/io/buffer.c
branches/pmc_i_ops/src/io/unix.c
branches/pmc_i_ops/src/io/win32.c
branches/pmc_i_ops/src/library.c
branches/pmc_i_ops/src/oo.c
branches/pmc_i_ops/src/ops/io.ops
branches/pmc_i_ops/src/packfile.c
branches/pmc_i_ops/src/pmc.c
branches/pmc_i_ops/src/pmc/codestring.pmc
branches/pmc_i_ops/src/pmc/coroutine.pmc
branches/pmc_i_ops/src/pmc/eventhandler.pmc
branches/pmc_i_ops/src/pmc/filehandle.pmc
branches/pmc_i_ops/src/pmc/resizablestringarray.pmc
branches/pmc_i_ops/src/pmc/socket.pmc
branches/pmc_i_ops/src/pmc/stringhandle.pmc
branches/pmc_i_ops/src/pmc/undef.pmc
branches/pmc_i_ops/src/pmc_freeze.c
branches/pmc_i_ops/src/runcore/main.c
branches/pmc_i_ops/src/string/api.c
branches/pmc_i_ops/t/compilers/imcc/syn/file.t
branches/pmc_i_ops/t/compilers/imcc/syn/pcc.t
branches/pmc_i_ops/t/library/pcre.t
branches/pmc_i_ops/t/native_pbc/annotations.pbc
branches/pmc_i_ops/t/native_pbc/integer_1.pbc
branches/pmc_i_ops/t/native_pbc/integer_4.pbc
branches/pmc_i_ops/t/native_pbc/number_1.pbc
branches/pmc_i_ops/t/native_pbc/number_2.pbc
branches/pmc_i_ops/t/native_pbc/number_4.pbc
branches/pmc_i_ops/t/native_pbc/number_5.pbc
branches/pmc_i_ops/t/native_pbc/string_1.pbc
branches/pmc_i_ops/t/native_pbc/string_4.pbc
branches/pmc_i_ops/t/op/arithmetics_pmc.t
branches/pmc_i_ops/t/op/interp.t
branches/pmc_i_ops/t/pmc/array.t
branches/pmc_i_ops/t/pmc/io.t
branches/pmc_i_ops/t/pmc/pmc.t
branches/pmc_i_ops/t/steps/auto_icu-01.t
branches/pmc_i_ops/t/steps/auto_jit-01.t
branches/pmc_i_ops/t/steps/auto_pmc-01.t
branches/pmc_i_ops/t/steps/gen_platform-01.t
branches/pmc_i_ops/t/tools/install/02-install_files.t
branches/pmc_i_ops/t/tools/install/03-lines_to_files.t
branches/pmc_i_ops/t/tools/install/dev_overall.t
branches/pmc_i_ops/t/tools/install/overall.t
branches/pmc_i_ops/t/tools/ops2pm/05-renum_op_map_file.t
branches/pmc_i_ops/t/tools/ops2pm/10-print_module.t
branches/pmc_i_ops/t/tools/ops2pm/11-print_h.t
branches/pmc_i_ops/tools/dev/create_language.pl
branches/pmc_i_ops/tools/dev/fetch_languages.pl
branches/pmc_i_ops/tools/dev/mk_native_pbc
branches/pmc_i_ops/tools/dev/parrot-fuzzer
branches/pmc_i_ops/tools/install/smoke_languages.pl
Modified: branches/pmc_i_ops/DEPRECATED.pod
==============================================================================
--- branches/pmc_i_ops/DEPRECATED.pod Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/DEPRECATED.pod Tue Jun 9 22:26:30 2009 (r39482)
@@ -196,13 +196,6 @@
L<http://rt.perl.org/rt3/Ticket/Display.html?id=53302>
-=item Parrot_readbc, Parrot_loadbc. [eligible in 1.1]
-
-They have been renamed to C<Parrot_pbc_read>, C<Parrot_pbc_load>.
-C<Parrot_pbc_read> has one third int argument.
-
-L<https://trac.parrot.org/parrot/ticket/266>
-
=item C API coding standards cleanup [eligible in 1.1]
All C API functions that aren't currently named according to the
@@ -212,12 +205,6 @@
L<https://trac.parrot.org/parrot/ticket/443>
-=item Parrot_add_library_path [eligible in 1.1]
-
-Will be renamed to C<Parrot_lib_add_path_from_cstring>.
-
-L<https://trac.parrot.org/parrot/ticket/455>
-
=item parrot_new_pmc_hash [eligible in 1.5]
This function will be removed. parrot_new_hash should be used in its place.
Modified: branches/pmc_i_ops/MANIFEST
==============================================================================
--- branches/pmc_i_ops/MANIFEST Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/MANIFEST Tue Jun 9 22:26:30 2009 (r39482)
@@ -1,10 +1,10 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Sun May 24 16:30:09 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Jun 4 22:51:55 2009 UT
+#
+# See below for documentation on the format of this file.
#
-# See tools/dev/install_files.pl for documentation on the
-# format of this file.
# See docs/submissions.pod on how to recreate this file after SVN
# has been told about new or deleted files.
CREDITS []
@@ -114,6 +114,7 @@
compilers/nqp/t/26-method_ops.t [test]
compilers/nqp/t/27-ternary.t [test]
compilers/nqp/t/28-return.t [test]
+compilers/nqp/t/29-self.t [test]
compilers/nqp/t/harness [test]
compilers/pct/PCT.pir [pct]
compilers/pct/README.pod []doc
@@ -1760,6 +1761,7 @@
t/op/64bit.t [test]
t/op/annotate.t [test]
t/op/arithmetics.t [test]
+t/op/arithmetics_pmc.t [test]
t/op/basic.t [test]
t/op/bitwise.t [test]
t/op/box.t [test]
@@ -2027,6 +2029,7 @@
t/tools/install/testlib/parrot.pc [test]
t/tools/install/testlib/phony [test]
t/tools/install/testlib/phony.exe [test]
+t/tools/install/testlib/runtime/parrot/include/sockets.pasm [test]
t/tools/install/testlib/runtime/parrot/library/TGE.pbc [test]
t/tools/install/testlib/src/ops/ops.num [test]
t/tools/install/testlib/src/pmc/pmc_object.h [test]
Modified: branches/pmc_i_ops/NEWS
==============================================================================
--- branches/pmc_i_ops/NEWS Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/NEWS Tue Jun 9 22:26:30 2009 (r39482)
@@ -1,5 +1,10 @@
# $Id$
+New in 1.3.0
+- Core
+ + Optimization for parts of the IO system
+ + Fix inheritance heirarchy of FileHandle and Socket PMC types
+
New in 1.2.0
- Core
+ Fixes for pir classes inheriting from core pmcs.
Modified: branches/pmc_i_ops/PBC_COMPAT
==============================================================================
--- branches/pmc_i_ops/PBC_COMPAT Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/PBC_COMPAT Tue Jun 9 22:26:30 2009 (r39482)
@@ -27,6 +27,7 @@
# please insert tab separated entries at the top of the list
+4.8 2009.05.30 Infinoid Added Handle PMC
4.7 2009.05.29 cotto add cmp_pmc opcode (also, addition of setstdin and root_new in previous commits)
4.6 2009.05.18 bacek removed PackfileAnnotationKeys PMC
4.5 2009.04.10 cotto removed Ref and SharedRef PMCs
Modified: branches/pmc_i_ops/PLATFORMS
==============================================================================
--- branches/pmc_i_ops/PLATFORMS Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/PLATFORMS Tue Jun 9 22:26:30 2009 (r39482)
@@ -58,7 +58,6 @@
netbsd5.0-sparc64-gcc-4.1.3 B8 Y - - Y Y Y Y/1 ? 20090519
netbsd5.0-x86_64-gcc-4.1.3 8 Y - - Y Y Y Y ? 20090419
opensolaris-x86-gcc_4.0.3 4 Y Y ? ? ? Y Y/2 ? 20080325
-sol8-sparc-gcc_4.1.0 B - - - - - - Y/42 ? 20090317
win32-x86-mingw_gcc4.3.0 Y Y - - - Y Y/88 ? 20081203
win32-x86-msvc_6.0 4 - Y - - - Y Y/8 ? 20090315
win32-x64-msvc_9.0 8 - - - - - Y Y/51 ? 20081203
Modified: branches/pmc_i_ops/README
==============================================================================
--- branches/pmc_i_ops/README Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/README Tue Jun 9 22:26:30 2009 (r39482)
@@ -18,7 +18,7 @@
linking with the ICU library you have to download and install it before
configuring Parrot.
-Get it from http://www-306.ibm.com/software/globalization/icu/downloads.jsp
+Get it from http://site.icu-project.org/download
You also need Perl 5.8.4 or newer, Storable 2.12 or newer, and Bundle::Parrot
to run various configure and build scripts.
Modified: branches/pmc_i_ops/README_win32.pod
==============================================================================
--- branches/pmc_i_ops/README_win32.pod Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/README_win32.pod Tue Jun 9 22:26:30 2009 (r39482)
@@ -60,7 +60,7 @@
ignore it (C<--without-icu>).
If you want to use ICU, download it from
-L<http://www.icu-project.org/download/>.
+L<http://site.icu-project.org/download>.
If you want to use precompiled binaries, do the following.
Download the package matching your compiler, unpack it (say, into
Modified: branches/pmc_i_ops/compilers/imcc/imcc.l
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/imcc.l Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/imcc.l Tue Jun 9 22:26:30 2009 (r39482)
@@ -505,7 +505,7 @@
YYCHOP();
if (valp)
- valp->s = yytext;
+ valp->s = str_dup(yytext);
return LABEL;
}
Modified: branches/pmc_i_ops/compilers/imcc/imcc.y
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/imcc.y Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/imcc.y Tue Jun 9 22:26:30 2009 (r39482)
@@ -800,14 +800,19 @@
{
ASSERT_ARGS(IMCC_itcall_sub)
IMCC_INFO(interp)->cur_call->pcc_sub->sub = sub;
+
if (IMCC_INFO(interp)->cur_obj) {
if (IMCC_INFO(interp)->cur_obj->set != 'P')
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "object isn't a PMC");
- IMCC_INFO(interp)->cur_call->pcc_sub->object = IMCC_INFO(interp)->cur_obj;
+
+ IMCC_INFO(interp)->cur_call->pcc_sub->object =
+ IMCC_INFO(interp)->cur_obj;
IMCC_INFO(interp)->cur_obj = NULL;
}
+
if (IMCC_INFO(interp)->cur_call->pcc_sub->sub->pmc_type == enum_class_NCI)
IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isNCI;
+
if (IMCC_INFO(interp)->cur_unit->type == IMC_PCCSUB)
IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->pcc_sub->calls_a_sub |= 1;
}
@@ -1407,13 +1412,13 @@
VTABLE_METHOD
{
$$ = P_VTABLE;
- IMCC_INFO(interp)->cur_unit->vtable_name = NULL;
+ IMCC_INFO(interp)->cur_unit->vtable_name = NULL;
IMCC_INFO(interp)->cur_unit->is_vtable_method = 1;
}
| VTABLE_METHOD '(' STRINGC ')'
{
$$ = P_VTABLE;
- IMCC_INFO(interp)->cur_unit->vtable_name = $3;
+ IMCC_INFO(interp)->cur_unit->vtable_name = $3;
IMCC_INFO(interp)->cur_unit->is_vtable_method = 1;
}
;
@@ -1423,13 +1428,13 @@
{
$$ = P_METHOD;
IMCC_INFO(interp)->cur_unit->method_name = NULL;
- IMCC_INFO(interp)->cur_unit->is_method = 1;
+ IMCC_INFO(interp)->cur_unit->is_method = 1;
}
| METHOD '(' any_string ')'
{
$$ = P_METHOD;
IMCC_INFO(interp)->cur_unit->method_name = $3;
- IMCC_INFO(interp)->cur_unit->is_method = 1;
+ IMCC_INFO(interp)->cur_unit->is_method = 1;
}
;
@@ -1437,7 +1442,7 @@
NS_ENTRY
{
$$ = 0;
- IMCC_INFO(interp)->cur_unit->ns_entry_name = NULL;
+ IMCC_INFO(interp)->cur_unit->ns_entry_name = NULL;
IMCC_INFO(interp)->cur_unit->has_ns_entry_name = 1;
}
| NS_ENTRY '(' any_string ')'
@@ -1674,8 +1679,8 @@
| ADV_OPTIONAL { $$ = VT_OPTIONAL; }
| ADV_OPT_FLAG { $$ = VT_OPT_FLAG; }
| ADV_NAMED { $$ = VT_NAMED; }
- | ADV_NAMED '(' STRINGC ')' { adv_named_set(interp, $3); $$ = 0; }
- | ADV_NAMED '(' USTRINGC ')' { adv_named_set_u(interp, $3); $$ = 0; }
+ | ADV_NAMED '(' STRINGC ')' { adv_named_set(interp, $3); $$ = 0; mem_sys_free($3); }
+ | ADV_NAMED '(' USTRINGC ')' { adv_named_set_u(interp, $3); $$ = 0; mem_sys_free($3); }
| UNIQUE_REG { $$ = VT_UNIQUE_REG; }
;
@@ -1826,7 +1831,9 @@
label:
LABEL
{
- $$ = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, $1));
+ Instruction *i = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, $1));
+ mem_sys_free($1);
+ $$ = i;
}
;
@@ -1899,11 +1906,13 @@
{
SymReg *n = mk_const(interp, $2, 'S');
set_lexical(interp, $4, n); $$ = 0;
+ mem_sys_free($2);
}
| LEXICAL USTRINGC COMMA target
{
SymReg *n = mk_const(interp, $2, 'U');
set_lexical(interp, $4, n); $$ = 0;
+ mem_sys_free($2);
}
| CONST { pesky_global__is_def=1; } type IDENTIFIER '=' const
{
@@ -2092,9 +2101,9 @@
;
the_sub:
- IDENTIFIER { $$ = mk_sub_address(interp, $1); mem_sys_free($1); }
- | STRINGC { $$ = mk_sub_address_fromc(interp, $1); mem_sys_free($1); }
- | USTRINGC { $$ = mk_sub_address_u(interp, $1); mem_sys_free($1); }
+ IDENTIFIER { $$ = mk_sub_address(interp, $1); mem_sys_free($1); }
+ | STRINGC { $$ = mk_sub_address_fromc(interp, $1); mem_sys_free($1); }
+ | USTRINGC { $$ = mk_sub_address_u(interp, $1); mem_sys_free($1); }
| target
{
$$ = $1;
@@ -2115,6 +2124,12 @@
IMCC_INFO(interp)->cur_obj = $1;
$$ = $3;
}
+ | target DOT USTRINGC
+ {
+ IMCC_INFO(interp)->cur_obj = $1;
+ $$ = mk_const(interp, $3, 'U');
+ mem_sys_free($3);
+ }
| target DOT STRINGC
{
IMCC_INFO(interp)->cur_obj = $1;
Modified: branches/pmc_i_ops/compilers/imcc/imclexer.c
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/imclexer.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/imclexer.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -3601,7 +3601,7 @@
YYCHOP();
if (valp)
- valp->s = yytext;
+ valp->s = str_dup(yytext);
return LABEL;
}
Modified: branches/pmc_i_ops/compilers/imcc/imcparser.c
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/imcparser.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/imcparser.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -1124,14 +1124,19 @@
{
ASSERT_ARGS(IMCC_itcall_sub)
IMCC_INFO(interp)->cur_call->pcc_sub->sub = sub;
+
if (IMCC_INFO(interp)->cur_obj) {
if (IMCC_INFO(interp)->cur_obj->set != 'P')
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "object isn't a PMC");
- IMCC_INFO(interp)->cur_call->pcc_sub->object = IMCC_INFO(interp)->cur_obj;
+
+ IMCC_INFO(interp)->cur_call->pcc_sub->object =
+ IMCC_INFO(interp)->cur_obj;
IMCC_INFO(interp)->cur_obj = NULL;
}
+
if (IMCC_INFO(interp)->cur_call->pcc_sub->sub->pmc_type == enum_class_NCI)
IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isNCI;
+
if (IMCC_INFO(interp)->cur_unit->type == IMC_PCCSUB)
IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->pcc_sub->calls_a_sub |= 1;
}
@@ -1371,7 +1376,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 1030 "compilers/imcc/imcc.y"
+#line 1035 "compilers/imcc/imcc.y"
{
IdList * idlist;
int t;
@@ -1380,7 +1385,7 @@
Instruction *i;
}
/* Line 187 of yacc.c. */
-#line 1373 "compilers/imcc/imcparser.c"
+#line 1378 "compilers/imcc/imcparser.c"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
@@ -1393,7 +1398,7 @@
/* Line 216 of yacc.c. */
-#line 1386 "compilers/imcc/imcparser.c"
+#line 1391 "compilers/imcc/imcparser.c"
#ifdef short
# undef short
@@ -1608,16 +1613,16 @@
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 31
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 676
+#define YYLAST 680
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 138
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 126
/* YYNRULES -- Number of rules. */
-#define YYNRULES 336
+#define YYNRULES 337
/* YYNRULES -- Number of states. */
-#define YYNSTATES 542
+#define YYNSTATES 543
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
@@ -1700,14 +1705,14 @@
665, 667, 669, 671, 673, 675, 677, 679, 681, 683,
685, 686, 692, 696, 698, 700, 702, 704, 706, 708,
710, 712, 714, 716, 718, 720, 722, 727, 729, 731,
- 733, 735, 739, 743, 747, 748, 754, 755, 759, 761,
- 767, 771, 775, 778, 779, 782, 784, 786, 791, 796,
- 799, 803, 809, 811, 815, 816, 818, 820, 827, 833,
- 838, 843, 850, 856, 858, 860, 862, 864, 866, 868,
- 870, 872, 874, 876, 877, 879, 883, 885, 887, 892,
- 896, 898, 900, 902, 904, 906, 908, 910, 912, 914,
- 916, 918, 919, 922, 923, 926, 928, 932, 934, 936,
- 938, 940, 942, 944, 946, 948, 950
+ 733, 735, 739, 743, 747, 751, 752, 758, 759, 763,
+ 765, 771, 775, 779, 782, 783, 786, 788, 790, 795,
+ 800, 803, 807, 813, 815, 819, 820, 822, 824, 831,
+ 837, 842, 847, 854, 860, 862, 864, 866, 868, 870,
+ 872, 874, 876, 878, 880, 881, 883, 887, 889, 891,
+ 896, 900, 902, 904, 906, 908, 910, 912, 914, 916,
+ 918, 920, 922, 923, 926, 927, 930, 932, 936, 938,
+ 940, 942, 944, 946, 948, 950, 952, 954
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
@@ -1787,67 +1792,67 @@
40, -1, 41, -1, 42, -1, 46, -1, 47, -1,
48, -1, 247, 122, 116, 157, -1, 108, -1, 112,
-1, 115, -1, 247, -1, 247, 120, 252, -1, 247,
- 120, 112, -1, 247, 120, 247, -1, -1, 233, 235,
- 125, 236, 126, -1, -1, 236, 71, 237, -1, 237,
- -1, 236, 71, 112, 21, 255, -1, 255, 21, 255,
- -1, 112, 21, 255, -1, 255, 238, -1, -1, 238,
- 239, -1, 16, -1, 20, -1, 20, 125, 115, 126,
- -1, 20, 125, 112, 126, -1, 247, 194, -1, 241,
- 71, 240, -1, 241, 71, 112, 21, 247, -1, 240,
- -1, 112, 21, 247, -1, -1, 244, -1, 243, -1,
- 12, 255, 246, 255, 9, 253, -1, 12, 13, 255,
- 9, 253, -1, 12, 255, 245, 253, -1, 11, 255,
- 245, 253, -1, 11, 255, 246, 255, 9, 253, -1,
- 11, 13, 255, 9, 253, -1, 71, -1, 9, -1,
- 56, -1, 57, -1, 58, -1, 59, -1, 60, -1,
- 61, -1, 117, -1, 262, -1, -1, 249, -1, 249,
- 71, 250, -1, 250, -1, 254, -1, 247, 123, 256,
- 124, -1, 123, 258, 124, -1, 252, -1, 112, -1,
- 115, -1, 108, -1, 116, -1, 108, -1, 116, -1,
- 253, -1, 255, -1, 247, -1, 263, -1, -1, 257,
- 260, -1, -1, 259, 260, -1, 261, -1, 260, 137,
- 261, -1, 255, -1, 104, -1, 105, -1, 106, -1,
- 107, -1, 109, -1, 113, -1, 114, -1, 112, -1,
- 115, -1
+ 120, 115, -1, 247, 120, 112, -1, 247, 120, 247,
+ -1, -1, 233, 235, 125, 236, 126, -1, -1, 236,
+ 71, 237, -1, 237, -1, 236, 71, 112, 21, 255,
+ -1, 255, 21, 255, -1, 112, 21, 255, -1, 255,
+ 238, -1, -1, 238, 239, -1, 16, -1, 20, -1,
+ 20, 125, 115, 126, -1, 20, 125, 112, 126, -1,
+ 247, 194, -1, 241, 71, 240, -1, 241, 71, 112,
+ 21, 247, -1, 240, -1, 112, 21, 247, -1, -1,
+ 244, -1, 243, -1, 12, 255, 246, 255, 9, 253,
+ -1, 12, 13, 255, 9, 253, -1, 12, 255, 245,
+ 253, -1, 11, 255, 245, 253, -1, 11, 255, 246,
+ 255, 9, 253, -1, 11, 13, 255, 9, 253, -1,
+ 71, -1, 9, -1, 56, -1, 57, -1, 58, -1,
+ 59, -1, 60, -1, 61, -1, 117, -1, 262, -1,
+ -1, 249, -1, 249, 71, 250, -1, 250, -1, 254,
+ -1, 247, 123, 256, 124, -1, 123, 258, 124, -1,
+ 252, -1, 112, -1, 115, -1, 108, -1, 116, -1,
+ 108, -1, 116, -1, 253, -1, 255, -1, 247, -1,
+ 263, -1, -1, 257, 260, -1, -1, 259, 260, -1,
+ 261, -1, 260, 137, 261, -1, 255, -1, 104, -1,
+ 105, -1, 106, -1, 107, -1, 109, -1, 113, -1,
+ 114, -1, 112, -1, 115, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 1125, 1125, 1129, 1130, 1134, 1135, 1136, 1142, 1148,
- 1149, 1150, 1151, 1155, 1156, 1165, 1171, 1179, 1191, 1204,
- 1204, 1213, 1213, 1220, 1220, 1229, 1230, 1234, 1235, 1239,
- 1240, 1241, 1242, 1243, 1244, 1245, 1248, 1248, 1257, 1256,
- 1268, 1272, 1281, 1285, 1289, 1289, 1301, 1303, 1307, 1322,
- 1330, 1335, 1339, 1343, 1334, 1355, 1356, 1357, 1370, 1370,
- 1374, 1388, 1392, 1398, 1407, 1413, 1422, 1428, 1437, 1443,
- 1452, 1460, 1465, 1476, 1479, 1484, 1492, 1493, 1494, 1495,
- 1496, 1507, 1518, 1521, 1523, 1528, 1527, 1560, 1561, 1565,
- 1566, 1570, 1571, 1575, 1576, 1580, 1581, 1582, 1583, 1584,
- 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1597,
- 1602, 1606, 1611, 1615, 1619, 1624, 1633, 1634, 1638, 1643,
- 1644, 1652, 1653, 1653, 1668, 1669, 1673, 1674, 1675, 1676,
- 1677, 1678, 1679, 1684, 1684, 1687, 1695, 1695, 1701, 1702,
- 1707, 1715, 1716, 1721, 1729, 1733, 1738, 1737, 1750, 1751,
- 1755, 1756, 1766, 1771, 1781, 1790, 1791, 1803, 1807, 1809,
- 1810, 1811, 1812, 1813, 1817, 1818, 1822, 1823, 1827, 1836,
- 1837, 1848, 1855, 1864, 1874, 1875, 1880, 1881, 1882, 1882,
- 1898, 1903, 1908, 1908, 1915, 1916, 1916, 1922, 1928, 1932,
- 1944, 1945, 1946, 1947, 1948, 1949, 1953, 1954, 1955, 1956,
- 1960, 1973, 1975, 1977, 1979, 1981, 1986, 1989, 1996, 1995,
- 2004, 2005, 2006, 2007, 2015, 2016, 2017, 2021, 2022, 2023,
- 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033,
- 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043,
- 2049, 2048, 2060, 2067, 2068, 2069, 2070, 2071, 2072, 2073,
- 2074, 2075, 2076, 2077, 2078, 2079, 2084, 2095, 2096, 2097,
- 2098, 2104, 2118, 2124, 2130, 2129, 2138, 2139, 2149, 2159,
- 2166, 2171, 2181, 2185, 2186, 2190, 2191, 2194, 2195, 2199,
- 2203, 2213, 2219, 2229, 2234, 2238, 2239, 2243, 2247, 2251,
- 2258, 2262, 2266, 2273, 2274, 2278, 2279, 2280, 2281, 2282,
- 2283, 2287, 2288, 2292, 2293, 2297, 2298, 2302, 2303, 2310,
- 2317, 2318, 2319, 2323, 2324, 2328, 2329, 2333, 2334, 2338,
- 2339, 2343, 2343, 2356, 2356, 2369, 2370, 2378, 2387, 2388,
- 2389, 2390, 2391, 2395, 2396, 2397, 2398
+ 0, 1130, 1130, 1134, 1135, 1139, 1140, 1141, 1147, 1153,
+ 1154, 1155, 1156, 1160, 1161, 1170, 1176, 1184, 1196, 1209,
+ 1209, 1218, 1218, 1225, 1225, 1234, 1235, 1239, 1240, 1244,
+ 1245, 1246, 1247, 1248, 1249, 1250, 1253, 1253, 1262, 1261,
+ 1273, 1277, 1286, 1290, 1294, 1294, 1306, 1308, 1312, 1327,
+ 1335, 1340, 1344, 1348, 1339, 1360, 1361, 1362, 1375, 1375,
+ 1379, 1393, 1397, 1403, 1412, 1418, 1427, 1433, 1442, 1448,
+ 1457, 1465, 1470, 1481, 1484, 1489, 1497, 1498, 1499, 1500,
+ 1501, 1512, 1523, 1526, 1528, 1533, 1532, 1565, 1566, 1570,
+ 1571, 1575, 1576, 1580, 1581, 1585, 1586, 1587, 1588, 1589,
+ 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1602,
+ 1607, 1611, 1616, 1620, 1624, 1629, 1638, 1639, 1643, 1648,
+ 1649, 1657, 1658, 1658, 1673, 1674, 1678, 1679, 1680, 1681,
+ 1682, 1683, 1684, 1689, 1689, 1692, 1700, 1700, 1706, 1707,
+ 1712, 1720, 1721, 1726, 1734, 1738, 1743, 1742, 1755, 1756,
+ 1760, 1761, 1771, 1776, 1786, 1795, 1796, 1808, 1812, 1814,
+ 1815, 1816, 1817, 1818, 1822, 1823, 1827, 1828, 1832, 1843,
+ 1844, 1855, 1862, 1871, 1881, 1882, 1887, 1888, 1889, 1889,
+ 1905, 1911, 1917, 1917, 1924, 1925, 1925, 1931, 1937, 1941,
+ 1953, 1954, 1955, 1956, 1957, 1958, 1962, 1963, 1964, 1965,
+ 1969, 1982, 1984, 1986, 1988, 1990, 1995, 1998, 2005, 2004,
+ 2013, 2014, 2015, 2016, 2024, 2025, 2026, 2030, 2031, 2032,
+ 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042,
+ 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052,
+ 2058, 2057, 2069, 2076, 2077, 2078, 2079, 2080, 2081, 2082,
+ 2083, 2084, 2085, 2086, 2087, 2088, 2093, 2104, 2105, 2106,
+ 2107, 2113, 2127, 2133, 2139, 2145, 2144, 2153, 2154, 2164,
+ 2174, 2181, 2186, 2196, 2200, 2201, 2205, 2206, 2209, 2210,
+ 2214, 2218, 2228, 2234, 2244, 2249, 2253, 2254, 2258, 2262,
+ 2266, 2273, 2277, 2281, 2288, 2289, 2293, 2294, 2295, 2296,
+ 2297, 2298, 2302, 2303, 2307, 2308, 2312, 2313, 2317, 2318,
+ 2325, 2332, 2333, 2334, 2338, 2339, 2343, 2344, 2348, 2349,
+ 2353, 2354, 2358, 2358, 2371, 2371, 2384, 2385, 2393, 2402,
+ 2403, 2404, 2405, 2406, 2410, 2411, 2412, 2413
};
#endif
@@ -1955,14 +1960,14 @@
227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
229, 228, 230, 231, 231, 231, 231, 231, 231, 231,
231, 231, 231, 231, 231, 231, 232, 233, 233, 233,
- 233, 233, 233, 233, 235, 234, 236, 236, 236, 236,
- 236, 236, 237, 238, 238, 239, 239, 239, 239, 240,
- 241, 241, 241, 241, 241, 242, 242, 243, 243, 243,
- 244, 244, 244, 245, 245, 246, 246, 246, 246, 246,
- 246, 247, 247, 248, 248, 249, 249, 250, 250, 250,
- 251, 251, 251, 252, 252, 253, 253, 254, 254, 255,
- 255, 257, 256, 259, 258, 260, 260, 261, 262, 262,
- 262, 262, 262, 263, 263, 263, 263
+ 233, 233, 233, 233, 233, 235, 234, 236, 236, 236,
+ 236, 236, 236, 237, 238, 238, 239, 239, 239, 239,
+ 240, 241, 241, 241, 241, 241, 242, 242, 243, 243,
+ 243, 244, 244, 244, 245, 245, 246, 246, 246, 246,
+ 246, 246, 247, 247, 248, 248, 249, 249, 250, 250,
+ 250, 251, 251, 251, 252, 252, 253, 253, 254, 254,
+ 255, 255, 257, 256, 259, 258, 260, 260, 261, 262,
+ 262, 262, 262, 262, 263, 263, 263, 263
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@@ -1994,14 +1999,14 @@
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 5, 3, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 4, 1, 1, 1,
- 1, 3, 3, 3, 0, 5, 0, 3, 1, 5,
- 3, 3, 2, 0, 2, 1, 1, 4, 4, 2,
- 3, 5, 1, 3, 0, 1, 1, 6, 5, 4,
- 4, 6, 5, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 1, 3, 1, 1, 4, 3,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 2, 0, 2, 1, 3, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1
+ 1, 3, 3, 3, 3, 0, 5, 0, 3, 1,
+ 5, 3, 3, 2, 0, 2, 1, 1, 4, 4,
+ 2, 3, 5, 1, 3, 0, 1, 1, 6, 5,
+ 4, 4, 6, 5, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 1, 3, 1, 1, 4,
+ 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 2, 0, 2, 1, 3, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -2011,59 +2016,59 @@
{
0, 12, 0, 0, 0, 0, 51, 19, 0, 44,
0, 0, 2, 3, 10, 11, 0, 6, 8, 5,
- 7, 18, 0, 0, 321, 0, 0, 0, 0, 164,
+ 7, 18, 0, 0, 322, 0, 0, 0, 0, 164,
9, 1, 4, 13, 0, 16, 50, 0, 0, 48,
- 313, 311, 312, 314, 52, 310, 196, 197, 198, 199,
+ 314, 312, 313, 315, 52, 311, 196, 197, 198, 199,
0, 14, 21, 168, 0, 32, 31, 35, 34, 164,
- 27, 0, 33, 36, 165, 167, 0, 49, 328, 329,
- 330, 331, 332, 335, 333, 334, 336, 301, 319, 327,
- 322, 325, 302, 320, 91, 0, 0, 0, 30, 28,
+ 27, 0, 33, 36, 165, 167, 0, 49, 329, 330,
+ 331, 332, 333, 336, 334, 335, 337, 302, 320, 328,
+ 323, 326, 303, 321, 91, 0, 0, 0, 30, 28,
45, 0, 0, 38, 0, 0, 166, 15, 0, 97,
95, 96, 98, 99, 66, 100, 0, 101, 0, 64,
0, 71, 68, 102, 103, 104, 105, 106, 107, 108,
0, 92, 93, 0, 0, 0, 40, 0, 91, 29,
- 303, 326, 0, 0, 73, 0, 0, 0, 0, 53,
- 94, 20, 315, 316, 317, 0, 318, 0, 0, 0,
- 323, 37, 319, 43, 304, 306, 307, 25, 26, 0,
- 0, 0, 76, 77, 79, 78, 80, 81, 321, 0,
+ 304, 327, 0, 0, 73, 0, 0, 0, 0, 53,
+ 94, 20, 316, 317, 318, 0, 319, 0, 0, 0,
+ 324, 37, 320, 43, 305, 307, 308, 25, 26, 0,
+ 0, 0, 76, 77, 79, 78, 80, 81, 322, 0,
75, 0, 0, 0, 0, 55, 0, 0, 41, 39,
- 0, 0, 321, 0, 67, 63, 62, 0, 0, 61,
- 65, 70, 72, 69, 56, 157, 22, 24, 309, 324,
- 0, 305, 82, 74, 58, 0, 0, 161, 160, 162,
- 163, 0, 0, 157, 0, 155, 308, 0, 0, 159,
+ 0, 0, 322, 0, 67, 63, 62, 0, 0, 61,
+ 65, 70, 72, 69, 56, 157, 22, 24, 310, 325,
+ 0, 306, 82, 74, 58, 0, 0, 161, 160, 162,
+ 163, 0, 0, 157, 0, 155, 309, 0, 0, 159,
57, 54, 156, 0, 195, 158, 59, 0, 0, 170,
0, 0, 0, 0, 178, 0, 182, 185, 148, 0,
- 149, 240, 0, 0, 0, 257, 258, 259, 303, 208,
+ 149, 240, 0, 0, 0, 257, 258, 259, 304, 208,
184, 192, 193, 194, 135, 0, 0, 176, 210, 211,
- 212, 264, 191, 177, 286, 285, 260, 124, 17, 188,
+ 212, 265, 191, 177, 287, 286, 260, 124, 17, 188,
0, 0, 0, 0, 190, 0, 0, 0, 0, 0,
- 187, 260, 0, 85, 133, 136, 189, 284, 146, 169,
+ 187, 260, 0, 85, 133, 136, 189, 285, 146, 169,
0, 243, 244, 245, 246, 249, 250, 251, 252, 248,
- 247, 253, 254, 255, 0, 0, 321, 0, 60, 0,
- 294, 295, 296, 297, 298, 299, 300, 293, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 284, 116,
- 138, 141, 0, 282, 0, 124, 150, 266, 262, 263,
- 261, 213, 335, 336, 303, 0, 214, 215, 216, 0,
- 207, 319, 201, 0, 242, 126, 127, 128, 129, 132,
- 125, 0, 290, 0, 0, 289, 0, 174, 179, 171,
- 180, 181, 0, 0, 0, 89, 0, 0, 0, 0,
- 0, 279, 335, 0, 151, 273, 335, 0, 268, 273,
- 256, 200, 0, 202, 222, 231, 232, 236, 225, 226,
- 227, 228, 229, 230, 223, 233, 234, 235, 224, 321,
- 239, 217, 218, 219, 220, 221, 237, 238, 0, 0,
- 0, 292, 0, 288, 0, 175, 173, 0, 0, 0,
- 241, 0, 0, 0, 0, 139, 0, 134, 0, 142,
- 0, 137, 0, 283, 0, 280, 0, 0, 0, 147,
- 272, 0, 0, 265, 0, 321, 0, 203, 0, 0,
- 0, 291, 287, 172, 183, 186, 118, 0, 0, 0,
- 0, 87, 117, 273, 140, 273, 143, 0, 0, 152,
- 335, 153, 275, 276, 274, 271, 335, 267, 270, 0,
- 204, 205, 130, 131, 90, 0, 0, 0, 0, 119,
- 0, 144, 145, 281, 266, 0, 0, 0, 206, 110,
- 0, 111, 113, 0, 112, 0, 0, 88, 0, 154,
- 0, 0, 269, 0, 0, 0, 122, 0, 86, 0,
- 209, 278, 277, 109, 115, 114, 0, 124, 120, 0,
- 121, 123
+ 247, 253, 254, 255, 0, 0, 322, 0, 60, 0,
+ 295, 296, 297, 298, 299, 300, 301, 294, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 285, 116,
+ 138, 141, 0, 283, 0, 124, 150, 267, 263, 262,
+ 264, 261, 213, 336, 337, 304, 0, 214, 215, 216,
+ 0, 207, 320, 201, 0, 242, 126, 127, 128, 129,
+ 132, 125, 0, 291, 0, 0, 290, 0, 174, 179,
+ 171, 180, 181, 0, 0, 0, 89, 0, 0, 0,
+ 0, 0, 280, 336, 0, 151, 274, 336, 0, 269,
+ 274, 256, 200, 0, 202, 222, 231, 232, 236, 225,
+ 226, 227, 228, 229, 230, 223, 233, 234, 235, 224,
+ 322, 239, 217, 218, 219, 220, 221, 237, 238, 0,
+ 0, 0, 293, 0, 289, 0, 175, 173, 0, 0,
+ 0, 241, 0, 0, 0, 0, 139, 0, 134, 0,
+ 142, 0, 137, 0, 284, 0, 281, 0, 0, 0,
+ 147, 273, 0, 0, 266, 0, 322, 0, 203, 0,
+ 0, 0, 292, 288, 172, 183, 186, 118, 0, 0,
+ 0, 0, 87, 117, 274, 140, 274, 143, 0, 0,
+ 152, 336, 153, 276, 277, 275, 272, 336, 268, 271,
+ 0, 204, 205, 130, 131, 90, 0, 0, 0, 0,
+ 119, 0, 144, 145, 282, 267, 0, 0, 0, 206,
+ 110, 0, 111, 113, 0, 112, 0, 0, 88, 0,
+ 154, 0, 0, 270, 0, 0, 0, 122, 0, 86,
+ 0, 209, 279, 278, 109, 115, 114, 0, 124, 120,
+ 0, 121, 123
};
/* YYDEFGOTO[NTERM-NUM]. */
@@ -2073,95 +2078,95 @@
58, 86, 87, 159, 59, 60, 94, 95, 128, 151,
18, 29, 61, 19, 25, 20, 26, 84, 175, 195,
211, 217, 226, 113, 114, 115, 116, 117, 118, 119,
- 169, 170, 212, 251, 329, 499, 433, 120, 121, 122,
- 471, 375, 434, 516, 529, 536, 308, 360, 252, 330,
- 253, 331, 376, 377, 438, 442, 254, 336, 255, 383,
- 213, 214, 215, 63, 64, 65, 225, 368, 369, 426,
- 256, 275, 278, 279, 50, 392, 257, 287, 349, 418,
- 258, 282, 259, 307, 260, 261, 262, 290, 387, 388,
- 450, 484, 333, 334, 263, 264, 265, 318, 319, 78,
+ 169, 170, 212, 251, 329, 500, 434, 120, 121, 122,
+ 472, 376, 435, 517, 530, 537, 308, 361, 252, 330,
+ 253, 331, 377, 378, 439, 443, 254, 336, 255, 384,
+ 213, 214, 215, 63, 64, 65, 225, 369, 370, 427,
+ 256, 275, 278, 279, 50, 393, 257, 287, 350, 419,
+ 258, 282, 259, 307, 260, 261, 262, 290, 388, 389,
+ 451, 485, 333, 334, 263, 264, 265, 318, 319, 78,
153, 154, 155, 44, 45, 144, 156, 146, 37, 38,
180, 181, 80, 81, 82, 83
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -422
+#define YYPACT_NINF -418
static const yytype_int16 yypact[] =
{
- 4, -422, -77, -34, -46, -31, -422, -422, -4, -422,
- 106, 139, 4, -422, -422, -422, 186, -422, -422, -422,
- -422, -422, 104, 187, 68, 194, 221, 127, 199, 53,
- -422, -422, -422, -422, 92, -422, -422, 84, 489, -422,
- -422, -422, -422, -422, -422, -422, -422, -422, -422, -422,
- 107, -422, 101, -422, 217, -422, -422, -422, -422, 64,
- -422, 122, -422, 14, 125, -422, 223, -422, -422, -422,
- -422, -422, -422, -422, -422, -422, -422, -422, -422, -422,
- 98, -422, -422, -422, 493, 118, 129, 131, -422, -422,
- -422, 489, 132, -422, 241, 130, -422, -422, 489, -422,
- -422, -422, -422, -422, 123, -422, 134, -422, 135, 136,
- 138, 141, 146, -422, -422, -422, -422, -422, -422, -422,
- 245, 493, -422, 74, 239, 239, -422, 181, 493, -422,
- 437, -422, 40, 56, -7, 152, 170, 40, 40, -422,
- -422, -422, -422, -422, -422, 163, -422, 165, 183, 193,
- -422, -422, 173, -422, 226, -422, -422, -422, -422, 180,
- 188, 189, -422, -422, -422, -422, -422, -422, -422, -50,
- -422, 190, 191, 195, 202, 303, 40, 40, -422, -422,
- 206, 489, -422, 437, -422, -422, -422, 207, -7, -422,
- -422, -422, -422, -422, -422, 32, -422, -422, -422, 98,
- 208, -422, -422, -422, -422, 211, 315, -422, -422, -422,
- -422, 316, 262, 43, 261, -422, -422, 127, 267, -422,
- -422, -422, -422, 336, 415, -422, -422, 242, 74, -422,
- -36, 105, 124, 489, -422, 54, 16, -422, -422, 171,
- -422, -422, 353, 360, 368, -422, -422, -422, 437, -422,
- -422, -422, -422, -422, -422, 249, 371, -422, -422, -422,
- -422, -422, -422, -422, -422, -422, 416, -422, -422, -422,
- 489, 197, 489, 197, -422, 127, 308, 310, 127, 127,
- -422, 268, 264, -422, -422, -422, -422, 278, -422, -422,
- 266, -422, -422, -422, -422, -422, -422, -422, -422, -422,
- -422, -422, -422, -422, 196, 18, -422, 489, -3, 383,
- -422, -422, -422, -422, -422, -422, -422, -422, -36, 489,
- 387, -36, 489, 289, 254, 254, 292, 293, 278, -422,
- -422, -422, 382, -422, -42, -422, 503, 517, -422, -422,
- -422, -422, 279, 280, 437, 298, -422, -422, -422, 489,
- -422, -47, 441, 283, -422, -422, -422, -422, 286, -422,
- -422, -36, -422, 403, -36, -422, 406, 317, 347, -422,
- -422, -422, 297, 299, -23, 3, 28, 21, 254, 329,
- 300, -3, 402, -14, -422, -422, 404, -13, -422, 408,
- -422, -422, 309, -422, -422, -422, -422, -422, -422, -422,
- -422, -422, -422, -422, -422, -422, -422, -422, -422, -422,
- -422, -422, -422, -422, -422, -422, -422, -422, 489, 318,
- 58, -422, -36, -422, -36, -422, -422, 289, 74, 74,
- -422, 489, 489, -1, 433, -422, 489, -422, 435, -422,
- 489, -422, 438, -422, 426, -422, 171, 489, 531, -422,
- 69, 489, 545, -422, 489, -422, 324, -422, 489, 333,
- 339, -422, -422, -422, -422, -422, -422, 446, 489, 489,
- 559, 125, -422, -422, -422, -422, -422, 254, 343, -422,
- 449, -422, -422, 346, -422, -422, 452, -422, -422, 350,
- -422, -422, -422, -422, -422, 15, 472, 19, 22, -422,
- 478, 69, 69, -422, 517, 489, 90, 489, -422, -422,
- 489, -422, -422, 489, -422, 489, -6, -422, -9, -422,
- 357, 359, -422, 482, 483, 484, -422, 254, -422, 488,
- -422, -422, -422, -422, -422, -422, 127, -422, -422, 289,
- -3, -422
+ 252, -418, -82, -71, -58, -55, -418, -418, -6, -418,
+ 112, 141, 252, -418, -418, -418, 145, -418, -418, -418,
+ -418, -418, 87, 169, 68, 194, 48, 184, 200, 11,
+ -418, -418, -418, -418, 94, -418, -418, 83, 479, -418,
+ -418, -418, -418, -418, -418, -418, -418, -418, -418, -418,
+ 101, -418, 98, -418, 211, -418, -418, -418, -418, 144,
+ -418, 122, -418, 20, 132, -418, 235, -418, -418, -418,
+ -418, -418, -418, -418, -418, -418, -418, -418, -418, -418,
+ 109, -418, -418, -418, 451, 127, 137, 143, -418, -418,
+ -418, 479, 149, -418, 249, 148, -418, -418, 479, -418,
+ -418, -418, -418, -418, 140, -418, 146, -418, 150, 152,
+ 154, 155, 158, -418, -418, -418, -418, -418, -418, -418,
+ 253, 451, -418, 173, 464, 464, -418, 195, 451, -418,
+ 412, -418, 54, -41, 5, 156, 180, 54, 54, -418,
+ -418, -418, -418, -418, -418, 171, -418, 174, 188, 203,
+ -418, -418, 183, -418, 236, -418, -418, -418, -418, 189,
+ 190, 191, -418, -418, -418, -418, -418, -418, -418, -46,
+ -418, 192, 202, 204, 205, 305, 54, 54, -418, -418,
+ 197, 479, -418, 412, -418, -418, -418, 198, 5, -418,
+ -418, -418, -418, -418, -418, 43, -418, -418, -418, 109,
+ 208, -418, -418, -418, -418, 217, 310, -418, -418, -418,
+ -418, 316, 264, 0, 74, -418, -418, 184, 262, -418,
+ -418, -418, -418, 333, 261, -418, -418, 230, 173, -418,
+ -69, 321, 336, 479, -418, 55, -50, -418, -418, 354,
+ -418, -418, 338, 340, 341, -418, -418, -418, 412, -418,
+ -418, -418, -418, -418, -418, 215, 342, -418, -418, -418,
+ -418, -418, -418, -418, -418, -418, 467, -418, -418, -418,
+ 479, 75, 479, 75, -418, 184, 276, 280, 184, 184,
+ -418, 232, 228, -418, -418, -418, -418, 196, -418, -418,
+ 231, -418, -418, -418, -418, -418, -418, -418, -418, -418,
+ -418, -418, -418, -418, 493, 114, -418, 479, -5, 346,
+ -418, -418, -418, -418, -418, -418, -418, -418, -69, 479,
+ 348, -69, 479, 250, 107, 107, 251, 255, 196, -418,
+ -418, -418, 339, -418, -45, -418, 507, 521, -418, -418,
+ -418, -418, -418, 239, 246, 412, 266, -418, -418, -418,
+ 479, -418, -80, 431, 237, -418, -418, -418, -418, 247,
+ -418, -418, -69, -418, 366, -69, -418, 370, 282, 309,
+ -418, -418, -418, 263, 265, -35, 8, 15, 12, 107,
+ 284, 270, -5, 362, -27, -418, -418, 363, -2, -418,
+ 376, -418, -418, 275, -418, -418, -418, -418, -418, -418,
+ -418, -418, -418, -418, -418, -418, -418, -418, -418, -418,
+ -418, -418, -418, -418, -418, -418, -418, -418, -418, 479,
+ 283, 72, -418, -69, -418, -69, -418, -418, 250, 173,
+ 173, -418, 479, 479, 89, 398, -418, 479, -418, 400,
+ -418, 479, -418, 402, -418, 386, -418, 354, 479, 535,
+ -418, 131, 479, 549, -418, 479, -418, 288, -418, 479,
+ 287, 290, -418, -418, -418, -418, -418, -418, 404, 479,
+ 479, 563, 132, -418, -418, -418, -418, -418, 107, 293,
+ -418, 399, -418, -418, 294, -418, -418, 401, -418, -418,
+ 299, -418, -418, -418, -418, -418, 17, 420, 18, 19,
+ -418, 425, 131, 131, -418, 521, 479, 73, 479, -418,
+ -418, 479, -418, -418, 479, -418, 479, 4, -418, -1,
+ -418, 311, 313, -418, 440, 442, 443, -418, 107, -418,
+ 448, -418, -418, -418, -418, -418, -418, 184, -418, -418,
+ 250, -5, -418
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -422, -422, -422, 491, 9, -146, -422, -422, -422, -422,
- 270, -422, -422, 47, -422, 445, -422, -422, -422, 161,
- -422, -422, -422, 12, -422, -422, -422, -422, -422, -422,
- -422, -422, -422, -422, -422, -422, -422, -422, -422, -422,
- -422, 319, -422, -422, -422, -422, -422, 378, -422, 391,
- -422, -422, -422, -422, -422, -422, -330, -422, -422, -422,
- -422, -422, -422, -422, -422, -422, -422, -422, -422, -422,
- -422, -422, 301, 302, -422, -63, -422, -422, -418, -422,
- -422, -422, -422, -422, -214, -422, -422, -422, -422, -422,
- -422, -422, -422, -422, -422, 67, -206, -422, 11, -312,
- -421, -422, 147, 200, -422, -422, -422, 244, 252, -128,
- 281, -422, 335, -422, 229, -223, 33, -38, -162, -422,
- -422, -422, 354, 436, -422, -119
+ -418, -418, -418, 444, 14, -167, -418, -418, -418, -418,
+ 233, -418, -418, -100, -418, 395, -418, -418, -418, 110,
+ -418, -418, -418, 23, -418, -418, -418, -418, -418, -418,
+ -418, -418, -418, -418, -418, -418, -418, -418, -418, -418,
+ -418, 277, -418, -418, -418, -418, -418, 344, -418, 343,
+ -418, -418, -418, -418, -418, -418, -330, -418, -418, -418,
+ -418, -418, -418, -418, -418, -418, -418, -418, -418, -418,
+ -418, -418, 269, 271, -418, -63, -418, -418, -417, -418,
+ -418, -418, -418, -418, -214, -418, -418, -418, -418, -418,
+ -418, -418, -418, -418, -418, 28, -205, -418, -28, -327,
+ -319, -418, 99, 165, -418, -418, -418, 210, 221, -128,
+ 248, -418, 301, -418, 193, -220, 77, -38, -162, -418,
+ -418, -418, 314, 424, -418, -119
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -2171,146 +2176,148 @@
#define YYTABLE_NINF -261
static const yytype_int16 yytable[] =
{
- 79, 96, 152, 227, 141, 381, 187, 269, 1, 463,
- 2, 3, 4, 431, 355, 356, 357, 358, -42, 509,
- 200, 188, 526, 512, 384, 439, 514, 91, 5, 379,
- 6, 341, 435, 280, 7, 21, 440, 204, 57, 3,
- 4, 62, 436, 92, 162, 163, 164, 165, 379, 209,
- 3, 4, 501, 126, 502, 152, 527, 448, 452, 2,
- 79, 323, 452, 205, 326, 327, 23, 209, 57, 528,
- 2, 62, 142, 304, 205, 468, 189, 5, -260, 22,
- 143, 469, 470, 52, 380, 482, 510, 432, 5, 483,
- 513, 93, 24, 515, 52, 362, 266, 359, 365, 350,
- 8, 166, 441, 430, -83, 167, 9, 437, 28, 268,
- 30, 281, 449, 453, 10, -84, 168, 530, 270, 466,
- 152, 541, 68, 69, 70, 71, 245, 72, -23, -21,
- 342, 74, 75, 343, 344, 77, 481, 272, 421, 31,
- 487, 423, 206, 79, 353, 345, 346, 347, 348, 8,
- 207, 208, 157, 206, 53, 158, -46, 145, 147, 335,
- 8, 207, 208, 54, 160, 53, 276, -47, 161, 277,
- 459, 55, 56, 460, 54, 34, 339, 351, 46, 47,
- 48, 49, 55, 56, 173, 174, 73, 74, 75, 76,
- 33, 35, 36, 271, 273, 274, 370, 371, 39, 461,
- 335, 462, 520, 51, 66, 521, 310, 540, 67, 68,
- 69, 70, 71, -23, 72, 85, 152, 73, 74, 75,
- 76, 88, 77, 196, 197, 90, 53, 97, 68, 69,
- 70, 71, 309, 72, 320, 98, 73, 74, 75, 76,
- 123, 77, 124, 125, 127, 129, 130, 456, 132, 139,
- 443, 335, 148, 311, 312, 313, 314, 315, 316, 133,
- 134, 135, 223, 136, 171, -164, 137, 352, 317, 354,
- -164, 138, -164, -164, -164, 68, 69, 70, 71, 245,
- 72, 363, 172, 246, 366, 176, 247, 177, 77, -164,
- -164, -164, 178, 489, 179, -164, 182, 183, 385, 389,
- 68, 69, 70, 71, 40, 72, 184, 194, 338, 464,
- 465, 393, 43, 77, 185, 186, 190, 191, 281, 219,
- 220, 192, 539, 218, -164, -164, -164, -164, 193, 40,
- 198, 202, 216, 41, 221, -164, 42, 43, 228, -164,
- 229, -164, 498, 68, 69, 70, 71, 142, 72, 503,
- 267, 73, 74, 75, 76, 143, 77, 283, 68, 69,
- 70, 71, 53, 72, 284, -164, -164, -164, -164, -164,
- -164, 77, 285, -164, 288, 289, -164, -164, -164, 324,
- 457, 325, 68, 69, 70, 71, -164, 72, 304, 328,
- 332, 337, 361, 385, 467, 77, 364, 367, 473, 537,
- 372, 373, 475, 378, -258, -259, 391, 419, 500, 479,
- 385, 420, 422, 485, 385, 424, 488, 425, 427, 428,
- 491, 429, 446, 447, 230, 451, 231, 232, 233, 454,
- 495, 496, 455, 68, 69, 70, 71, 472, 72, 474,
- 458, 444, 476, 234, 235, 236, 77, 477, 490, 237,
- 494, 291, 292, 293, 294, 295, 296, 297, 298, 492,
- 299, 300, 301, 302, 303, 493, 389, 519, 504, 522,
- 505, 506, 523, 507, 508, 524, 511, 525, 238, 239,
- 240, 241, 517, 531, 394, 532, 533, 534, 535, 242,
- 395, 396, 538, 243, 250, 244, 397, 398, 399, 400,
- 401, 402, 403, 32, 89, 390, 149, 203, 404, 405,
- 406, 407, 140, 478, 222, 518, 224, 321, 201, 68,
- 69, 70, 71, 245, 72, 322, 445, 246, 374, 286,
- 247, 248, 77, 340, 131, 199, 304, 0, 305, 306,
- 249, 68, 69, 70, 71, 142, 72, 0, 0, 73,
- 74, 75, 76, 143, 77, 0, 0, 0, 0, 0,
- 150, 0, 408, 0, 409, 0, 0, 0, 0, 0,
- 410, 411, 412, 413, 414, 415, 416, 417, 99, 100,
- 101, 102, 103, 104, 105, 106, 107, 108, 109, 0,
- 110, 111, 112, 68, 69, 70, 71, 0, 72, 0,
- 0, 73, 74, 75, 76, 0, 77, 68, 69, 70,
- 71, 0, 72, 0, 0, 382, 74, 75, 76, 0,
- 77, 68, 69, 70, 71, 0, 72, 0, 0, 386,
+ 79, 96, 152, 227, 141, 382, 187, 3, 4, 385,
+ 269, 464, 356, 357, 358, 359, 440, 2, 432, 436,
+ 200, 510, 513, 515, -42, 188, 380, 441, 209, 437,
+ 21, 205, 527, 91, 280, 5, 380, 173, 174, 142,
+ 304, 52, 22, 57, 449, -260, 209, 143, 204, 92,
+ 3, 4, 62, 126, 23, 152, 162, 163, 164, 165,
+ 79, 323, -23, -21, 326, 327, 528, 160, 24, 453,
+ 453, 161, -84, 57, 205, 223, 196, 197, -164, 529,
+ 189, 381, 62, -164, 310, -164, -164, -164, 511, 514,
+ 516, 431, 433, 442, 438, 360, 266, 93, 363, 450,
+ 351, 366, -164, -164, -164, 467, 28, 8, -164, 268,
+ 206, 281, 53, 166, -46, -83, 30, 167, 207, 208,
+ 152, 54, 482, 542, 454, 531, 488, 342, 168, 55,
+ 56, 311, 312, 313, 314, 315, 316, -164, -164, -164,
+ -164, 31, 422, 79, 354, 424, 317, 483, -164, 33,
+ 2, 484, -164, 206, -164, 502, 40, 503, 34, 335,
+ 41, 207, 208, 42, 43, 469, 157, 276, 5, 158,
+ 277, 470, 471, 35, 52, 53, 340, 352, -164, -164,
+ -164, -164, -164, -164, 460, 521, -164, 461, 522, -164,
+ -164, -164, 36, 271, 273, 274, 371, 372, 39, -164,
+ 335, 145, 147, 462, 51, 463, 66, 67, 541, 85,
+ -23, 68, 69, 70, 71, 88, 72, 152, 68, 69,
+ 70, 71, 245, 72, 77, 90, 343, 74, 75, 344,
+ 345, 77, 309, 53, 320, 46, 47, 48, 49, 97,
+ 8, 346, 347, 348, 349, 53, 98, -47, 457, 123,
+ 124, 444, 335, 129, 54, 125, 1, 139, 2, 3,
+ 4, 127, 55, 56, 130, 132, 148, 353, 171, 355,
+ 230, 133, 231, 232, 233, 134, 5, 135, 6, 136,
+ 137, 364, 7, 138, 367, 73, 74, 75, 76, 234,
+ 235, 236, 172, 176, 490, 237, 177, 178, 386, 390,
+ 68, 69, 70, 71, 179, 72, 182, 183, 332, 194,
+ 465, 466, 394, 77, 219, 184, 185, 186, 190, 281,
+ 220, 198, 202, 540, 238, 239, 240, 241, 191, 218,
+ 192, 193, 216, 228, 270, 242, 221, 229, 267, 243,
+ 288, 244, 283, 499, 284, 285, 289, 324, 8, 272,
+ 504, 325, 304, 328, 9, 362, 337, 365, 368, 373,
+ 379, 420, 10, 374, -258, 68, 69, 70, 71, 245,
+ 72, -259, 421, 246, 392, 423, 247, 248, 77, 425,
+ 428, 458, 426, 448, 452, 429, 249, 430, 68, 69,
+ 70, 71, 447, 72, 386, 468, 445, 455, 456, 474,
+ 538, 77, 473, 476, 475, 459, 477, 478, 495, 501,
+ 480, 386, 491, 493, 486, 386, 494, 489, 505, 507,
+ 506, 492, 508, 509, 512, 68, 69, 70, 71, 518,
+ 72, 496, 497, 73, 74, 75, 76, 532, 77, 533,
+ 68, 69, 70, 71, 534, 72, 535, 536, 73, 74,
+ 75, 76, 539, 77, 89, 391, 32, 250, 68, 69,
+ 70, 71, 245, 72, 140, 203, 246, 390, 520, 247,
+ 523, 77, 149, 524, 395, 479, 525, 519, 526, 446,
+ 396, 397, 222, 321, 201, 224, 398, 399, 400, 401,
+ 402, 403, 404, 375, 322, 199, 286, 341, 405, 406,
+ 407, 408, 291, 292, 293, 294, 295, 296, 297, 298,
+ 0, 299, 300, 301, 302, 303, 68, 69, 70, 71,
+ 142, 72, 131, 0, 73, 74, 75, 76, 143, 77,
+ 0, 0, 0, 0, 0, 150, 99, 100, 101, 102,
+ 103, 104, 105, 106, 107, 108, 109, 0, 110, 111,
+ 112, 0, 409, 0, 410, 0, 0, 0, 0, 0,
+ 411, 412, 413, 414, 415, 416, 417, 418, 68, 69,
+ 70, 71, 142, 72, 0, 0, 73, 74, 75, 76,
+ 143, 77, 0, 68, 69, 70, 71, 304, 72, 305,
+ 306, 73, 74, 75, 76, 0, 77, 68, 69, 70,
+ 71, 40, 72, 0, 0, 338, 0, 0, 339, 43,
+ 77, 68, 69, 70, 71, 0, 72, 0, 0, 383,
74, 75, 76, 0, 77, 68, 69, 70, 71, 0,
- 72, 0, 0, 480, 74, 75, 76, 0, 77, 68,
- 69, 70, 71, 0, 72, 0, 0, 486, 74, 75,
+ 72, 0, 0, 387, 74, 75, 76, 0, 77, 68,
+ 69, 70, 71, 0, 72, 0, 0, 481, 74, 75,
76, 0, 77, 68, 69, 70, 71, 0, 72, 0,
- 0, 497, 0, 0, 0, 0, 77
+ 0, 487, 74, 75, 76, 0, 77, 68, 69, 70,
+ 71, 0, 72, 0, 0, 498, 0, 0, 0, 0,
+ 77
};
static const yytype_int16 yycheck[] =
{
- 38, 64, 130, 217, 123, 335, 168, 230, 4, 427,
- 6, 7, 8, 10, 17, 18, 19, 20, 4, 4,
- 182, 71, 28, 4, 336, 4, 4, 13, 24, 71,
- 26, 13, 4, 239, 30, 112, 15, 5, 29, 7,
- 8, 29, 14, 29, 51, 52, 53, 54, 71, 195,
- 7, 8, 473, 91, 475, 183, 62, 71, 71, 6,
- 98, 275, 71, 31, 278, 279, 112, 213, 59, 75,
- 6, 59, 108, 120, 31, 76, 126, 24, 125, 113,
- 116, 82, 83, 30, 126, 16, 71, 84, 24, 20,
- 71, 77, 123, 71, 30, 318, 224, 100, 321, 305,
- 96, 108, 81, 126, 72, 112, 102, 79, 112, 228,
- 4, 239, 126, 126, 110, 72, 123, 126, 13, 431,
- 248, 539, 104, 105, 106, 107, 108, 109, 112, 113,
- 112, 113, 114, 115, 116, 117, 448, 13, 361, 0,
- 452, 364, 110, 181, 306, 127, 128, 129, 130, 96,
- 118, 119, 112, 110, 101, 115, 103, 124, 125, 287,
- 96, 118, 119, 110, 108, 101, 112, 103, 112, 115,
- 112, 118, 119, 115, 110, 71, 304, 305, 51, 52,
- 53, 54, 118, 119, 137, 138, 112, 113, 114, 115,
- 4, 4, 124, 231, 232, 233, 324, 325, 4, 422,
- 328, 424, 112, 4, 112, 115, 9, 537, 124, 104,
- 105, 106, 107, 112, 109, 108, 344, 112, 113, 114,
- 115, 4, 117, 176, 177, 103, 101, 4, 104, 105,
- 106, 107, 270, 109, 272, 137, 112, 113, 114, 115,
- 122, 117, 113, 112, 112, 4, 116, 409, 125, 4,
- 378, 379, 71, 56, 57, 58, 59, 60, 61, 125,
- 125, 125, 1, 125, 112, 4, 125, 305, 71, 307,
- 9, 125, 11, 12, 13, 104, 105, 106, 107, 108,
- 109, 319, 112, 112, 322, 122, 115, 122, 117, 28,
- 29, 30, 109, 455, 101, 34, 123, 71, 336, 337,
- 104, 105, 106, 107, 108, 109, 126, 4, 112, 428,
- 429, 349, 116, 117, 126, 126, 126, 126, 446, 4,
- 4, 126, 536, 112, 63, 64, 65, 66, 126, 108,
- 124, 124, 124, 112, 72, 74, 115, 116, 71, 78,
- 4, 80, 470, 104, 105, 106, 107, 108, 109, 477,
- 108, 112, 113, 114, 115, 116, 117, 4, 104, 105,
- 106, 107, 101, 109, 4, 104, 105, 106, 107, 108,
- 109, 117, 4, 112, 125, 4, 115, 116, 117, 71,
- 418, 71, 104, 105, 106, 107, 125, 109, 120, 125,
- 112, 125, 9, 431, 432, 117, 9, 108, 436, 527,
- 108, 108, 440, 21, 125, 125, 108, 124, 471, 447,
- 448, 125, 9, 451, 452, 9, 454, 100, 71, 122,
- 458, 122, 122, 21, 9, 21, 11, 12, 13, 21,
- 468, 469, 123, 104, 105, 106, 107, 4, 109, 4,
- 122, 112, 4, 28, 29, 30, 117, 21, 124, 34,
- 4, 35, 36, 37, 38, 39, 40, 41, 42, 126,
- 44, 45, 46, 47, 48, 126, 504, 505, 125, 507,
- 21, 125, 510, 21, 124, 513, 4, 515, 63, 64,
- 65, 66, 4, 126, 43, 126, 4, 4, 4, 74,
- 49, 50, 4, 78, 224, 80, 55, 56, 57, 58,
- 59, 60, 61, 12, 59, 344, 128, 188, 67, 68,
- 69, 70, 121, 446, 213, 504, 214, 273, 183, 104,
- 105, 106, 107, 108, 109, 273, 379, 112, 328, 248,
- 115, 116, 117, 304, 98, 181, 120, -1, 122, 123,
- 125, 104, 105, 106, 107, 108, 109, -1, -1, 112,
- 113, 114, 115, 116, 117, -1, -1, -1, -1, -1,
- 123, -1, 121, -1, 123, -1, -1, -1, -1, -1,
- 129, 130, 131, 132, 133, 134, 135, 136, 85, 86,
- 87, 88, 89, 90, 91, 92, 93, 94, 95, -1,
- 97, 98, 99, 104, 105, 106, 107, -1, 109, -1,
- -1, 112, 113, 114, 115, -1, 117, 104, 105, 106,
- 107, -1, 109, -1, -1, 112, 113, 114, 115, -1,
+ 38, 64, 130, 217, 123, 335, 168, 7, 8, 336,
+ 230, 428, 17, 18, 19, 20, 4, 6, 10, 4,
+ 182, 4, 4, 4, 4, 71, 71, 15, 195, 14,
+ 112, 31, 28, 13, 239, 24, 71, 137, 138, 108,
+ 120, 30, 113, 29, 71, 125, 213, 116, 5, 29,
+ 7, 8, 29, 91, 112, 183, 51, 52, 53, 54,
+ 98, 275, 112, 113, 278, 279, 62, 108, 123, 71,
+ 71, 112, 72, 59, 31, 1, 176, 177, 4, 75,
+ 126, 126, 59, 9, 9, 11, 12, 13, 71, 71,
+ 71, 126, 84, 81, 79, 100, 224, 77, 318, 126,
+ 305, 321, 28, 29, 30, 432, 112, 96, 34, 228,
+ 110, 239, 101, 108, 103, 72, 4, 112, 118, 119,
+ 248, 110, 449, 540, 126, 126, 453, 13, 123, 118,
+ 119, 56, 57, 58, 59, 60, 61, 63, 64, 65,
+ 66, 0, 362, 181, 306, 365, 71, 16, 74, 4,
+ 6, 20, 78, 110, 80, 474, 108, 476, 71, 287,
+ 112, 118, 119, 115, 116, 76, 112, 112, 24, 115,
+ 115, 82, 83, 4, 30, 101, 304, 305, 104, 105,
+ 106, 107, 108, 109, 112, 112, 112, 115, 115, 115,
+ 116, 117, 124, 231, 232, 233, 324, 325, 4, 125,
+ 328, 124, 125, 423, 4, 425, 112, 124, 538, 108,
+ 112, 104, 105, 106, 107, 4, 109, 345, 104, 105,
+ 106, 107, 108, 109, 117, 103, 112, 113, 114, 115,
+ 116, 117, 270, 101, 272, 51, 52, 53, 54, 4,
+ 96, 127, 128, 129, 130, 101, 137, 103, 410, 122,
+ 113, 379, 380, 4, 110, 112, 4, 4, 6, 7,
+ 8, 112, 118, 119, 116, 125, 71, 305, 112, 307,
+ 9, 125, 11, 12, 13, 125, 24, 125, 26, 125,
+ 125, 319, 30, 125, 322, 112, 113, 114, 115, 28,
+ 29, 30, 112, 122, 456, 34, 122, 109, 336, 337,
+ 104, 105, 106, 107, 101, 109, 123, 71, 112, 4,
+ 429, 430, 350, 117, 4, 126, 126, 126, 126, 447,
+ 4, 124, 124, 537, 63, 64, 65, 66, 126, 112,
+ 126, 126, 124, 71, 13, 74, 72, 4, 108, 78,
+ 125, 80, 4, 471, 4, 4, 4, 71, 96, 13,
+ 478, 71, 120, 125, 102, 9, 125, 9, 108, 108,
+ 21, 124, 110, 108, 125, 104, 105, 106, 107, 108,
+ 109, 125, 125, 112, 108, 9, 115, 116, 117, 9,
+ 71, 419, 100, 21, 21, 122, 125, 122, 104, 105,
+ 106, 107, 122, 109, 432, 433, 112, 21, 123, 437,
+ 528, 117, 4, 441, 4, 122, 4, 21, 4, 472,
+ 448, 449, 124, 126, 452, 453, 126, 455, 125, 125,
+ 21, 459, 21, 124, 4, 104, 105, 106, 107, 4,
+ 109, 469, 470, 112, 113, 114, 115, 126, 117, 126,
+ 104, 105, 106, 107, 4, 109, 4, 4, 112, 113,
+ 114, 115, 4, 117, 59, 345, 12, 224, 104, 105,
+ 106, 107, 108, 109, 121, 188, 112, 505, 506, 115,
+ 508, 117, 128, 511, 43, 447, 514, 505, 516, 380,
+ 49, 50, 213, 273, 183, 214, 55, 56, 57, 58,
+ 59, 60, 61, 328, 273, 181, 248, 304, 67, 68,
+ 69, 70, 35, 36, 37, 38, 39, 40, 41, 42,
+ -1, 44, 45, 46, 47, 48, 104, 105, 106, 107,
+ 108, 109, 98, -1, 112, 113, 114, 115, 116, 117,
+ -1, -1, -1, -1, -1, 123, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, -1, 97, 98,
+ 99, -1, 121, -1, 123, -1, -1, -1, -1, -1,
+ 129, 130, 131, 132, 133, 134, 135, 136, 104, 105,
+ 106, 107, 108, 109, -1, -1, 112, 113, 114, 115,
+ 116, 117, -1, 104, 105, 106, 107, 120, 109, 122,
+ 123, 112, 113, 114, 115, -1, 117, 104, 105, 106,
+ 107, 108, 109, -1, -1, 112, -1, -1, 115, 116,
117, 104, 105, 106, 107, -1, 109, -1, -1, 112,
113, 114, 115, -1, 117, 104, 105, 106, 107, -1,
109, -1, -1, 112, 113, 114, 115, -1, 117, 104,
105, 106, 107, -1, 109, -1, -1, 112, 113, 114,
115, -1, 117, 104, 105, 106, 107, -1, 109, -1,
- -1, 112, -1, -1, -1, -1, 117
+ -1, 112, 113, 114, 115, -1, 117, 104, 105, 106,
+ 107, -1, 109, -1, -1, 112, -1, -1, -1, -1,
+ 117
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -2350,28 +2357,28 @@
45, 46, 47, 48, 120, 122, 123, 231, 194, 255,
9, 56, 57, 58, 59, 60, 61, 71, 245, 246,
255, 245, 246, 222, 71, 71, 222, 222, 125, 182,
- 197, 199, 112, 240, 241, 247, 205, 125, 112, 247,
- 252, 13, 112, 115, 116, 127, 128, 129, 130, 226,
- 234, 247, 255, 256, 255, 17, 18, 19, 20, 100,
- 195, 9, 253, 255, 9, 253, 255, 108, 215, 216,
- 247, 247, 108, 108, 241, 189, 200, 201, 21, 71,
- 126, 194, 112, 207, 237, 255, 112, 236, 237, 255,
- 157, 108, 223, 255, 43, 49, 50, 55, 56, 57,
- 58, 59, 60, 61, 67, 68, 69, 70, 121, 123,
- 129, 130, 131, 132, 133, 134, 135, 136, 227, 124,
- 125, 253, 9, 253, 9, 100, 217, 71, 122, 122,
- 126, 10, 84, 184, 190, 4, 14, 79, 202, 4,
- 15, 81, 203, 247, 112, 240, 122, 21, 71, 126,
- 238, 21, 71, 126, 21, 123, 256, 255, 122, 112,
- 115, 253, 253, 216, 263, 263, 237, 255, 76, 82,
- 83, 188, 4, 255, 4, 255, 4, 21, 233, 255,
- 112, 237, 16, 20, 239, 255, 112, 237, 255, 256,
- 124, 255, 126, 126, 4, 255, 255, 112, 247, 183,
- 213, 238, 238, 247, 125, 21, 125, 21, 124, 4,
- 71, 4, 4, 71, 4, 71, 191, 4, 236, 255,
- 112, 115, 255, 255, 255, 255, 28, 62, 75, 192,
- 126, 126, 126, 4, 4, 4, 193, 247, 4, 222,
- 194, 216
+ 197, 199, 112, 240, 241, 247, 205, 125, 112, 115,
+ 247, 252, 13, 112, 115, 116, 127, 128, 129, 130,
+ 226, 234, 247, 255, 256, 255, 17, 18, 19, 20,
+ 100, 195, 9, 253, 255, 9, 253, 255, 108, 215,
+ 216, 247, 247, 108, 108, 241, 189, 200, 201, 21,
+ 71, 126, 194, 112, 207, 237, 255, 112, 236, 237,
+ 255, 157, 108, 223, 255, 43, 49, 50, 55, 56,
+ 57, 58, 59, 60, 61, 67, 68, 69, 70, 121,
+ 123, 129, 130, 131, 132, 133, 134, 135, 136, 227,
+ 124, 125, 253, 9, 253, 9, 100, 217, 71, 122,
+ 122, 126, 10, 84, 184, 190, 4, 14, 79, 202,
+ 4, 15, 81, 203, 247, 112, 240, 122, 21, 71,
+ 126, 238, 21, 71, 126, 21, 123, 256, 255, 122,
+ 112, 115, 253, 253, 216, 263, 263, 237, 255, 76,
+ 82, 83, 188, 4, 255, 4, 255, 4, 21, 233,
+ 255, 112, 237, 16, 20, 239, 255, 112, 237, 255,
+ 256, 124, 255, 126, 126, 4, 255, 255, 112, 247,
+ 183, 213, 238, 238, 247, 125, 21, 125, 21, 124,
+ 4, 71, 4, 4, 71, 4, 71, 191, 4, 236,
+ 255, 112, 115, 255, 255, 255, 255, 28, 62, 75,
+ 192, 126, 126, 126, 4, 4, 4, 193, 247, 4,
+ 222, 194, 216
};
#define yyerrok (yyerrstatus = 0)
@@ -3199,22 +3206,22 @@
switch (yyn)
{
case 2:
-#line 1125 "compilers/imcc/imcc.y"
+#line 1130 "compilers/imcc/imcc.y"
{ if (yynerrs) YYABORT; (yyval.i) = 0; }
break;
case 5:
-#line 1134 "compilers/imcc/imcc.y"
+#line 1139 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 6:
-#line 1135 "compilers/imcc/imcc.y"
+#line 1140 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 7:
-#line 1137 "compilers/imcc/imcc.y"
+#line 1142 "compilers/imcc/imcc.y"
{
(yyval.i) = (yyvsp[(1) - (1)].i);
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
@@ -3223,7 +3230,7 @@
break;
case 8:
-#line 1143 "compilers/imcc/imcc.y"
+#line 1148 "compilers/imcc/imcc.y"
{
(yyval.i) = (yyvsp[(1) - (1)].i);
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
@@ -3232,32 +3239,32 @@
break;
case 9:
-#line 1148 "compilers/imcc/imcc.y"
+#line 1153 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 10:
-#line 1149 "compilers/imcc/imcc.y"
+#line 1154 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 11:
-#line 1150 "compilers/imcc/imcc.y"
+#line 1155 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 12:
-#line 1151 "compilers/imcc/imcc.y"
+#line 1156 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 13:
-#line 1155 "compilers/imcc/imcc.y"
+#line 1160 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 14:
-#line 1157 "compilers/imcc/imcc.y"
+#line 1162 "compilers/imcc/imcc.y"
{
(yyval.i) = 0;
do_loadlib(interp, (yyvsp[(2) - (3)].s));
@@ -3266,7 +3273,7 @@
break;
case 15:
-#line 1166 "compilers/imcc/imcc.y"
+#line 1171 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->line = atoi((yyvsp[(2) - (5)].s));
/* set_filename() frees the STRINGC */
@@ -3275,7 +3282,7 @@
break;
case 16:
-#line 1172 "compilers/imcc/imcc.y"
+#line 1177 "compilers/imcc/imcc.y"
{
/* set_filename() frees the STRINGC */
set_filename(interp, (yyvsp[(2) - (3)].s));
@@ -3283,7 +3290,7 @@
break;
case 17:
-#line 1180 "compilers/imcc/imcc.y"
+#line 1185 "compilers/imcc/imcc.y"
{
/* We'll want to store an entry while emitting instructions, so just
* store annotation like it's an instruction. */
@@ -3294,7 +3301,7 @@
break;
case 18:
-#line 1192 "compilers/imcc/imcc.y"
+#line 1197 "compilers/imcc/imcc.y"
{
STRING * const hll_name = Parrot_str_unescape(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
CONTEXT(interp)->current_HLL =
@@ -3307,12 +3314,12 @@
break;
case 19:
-#line 1204 "compilers/imcc/imcc.y"
+#line 1209 "compilers/imcc/imcc.y"
{ pesky_global__is_def = 1; }
break;
case 20:
-#line 1205 "compilers/imcc/imcc.y"
+#line 1210 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
mem_sys_free((yyvsp[(4) - (6)].s));
@@ -3321,12 +3328,12 @@
break;
case 21:
-#line 1213 "compilers/imcc/imcc.y"
+#line 1218 "compilers/imcc/imcc.y"
{ pesky_global__is_def=1; }
break;
case 22:
-#line 1214 "compilers/imcc/imcc.y"
+#line 1219 "compilers/imcc/imcc.y"
{
(yyval.i) = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
mem_sys_free((yyvsp[(6) - (6)].s));
@@ -3335,12 +3342,12 @@
break;
case 23:
-#line 1220 "compilers/imcc/imcc.y"
+#line 1225 "compilers/imcc/imcc.y"
{ pesky_global__is_def=1; }
break;
case 24:
-#line 1221 "compilers/imcc/imcc.y"
+#line 1226 "compilers/imcc/imcc.y"
{
(yyval.i) = mk_pmc_const_named(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
mem_sys_free((yyvsp[(3) - (6)].s));
@@ -3350,37 +3357,37 @@
break;
case 29:
-#line 1239 "compilers/imcc/imcc.y"
+#line 1244 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 30:
-#line 1240 "compilers/imcc/imcc.y"
+#line 1245 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 31:
-#line 1241 "compilers/imcc/imcc.y"
+#line 1246 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 32:
-#line 1242 "compilers/imcc/imcc.y"
+#line 1247 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 33:
-#line 1243 "compilers/imcc/imcc.y"
+#line 1248 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 36:
-#line 1248 "compilers/imcc/imcc.y"
+#line 1253 "compilers/imcc/imcc.y"
{ clear_state(interp); }
break;
case 37:
-#line 1250 "compilers/imcc/imcc.y"
+#line 1255 "compilers/imcc/imcc.y"
{
(yyval.i) = INS(interp, IMCC_INFO(interp)->cur_unit,
(yyvsp[(2) - (3)].s), 0, IMCC_INFO(interp)->regs,
@@ -3390,7 +3397,7 @@
break;
case 38:
-#line 1257 "compilers/imcc/imcc.y"
+#line 1262 "compilers/imcc/imcc.y"
{
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM);
@@ -3398,7 +3405,7 @@
break;
case 39:
-#line 1262 "compilers/imcc/imcc.y"
+#line 1267 "compilers/imcc/imcc.y"
{
(yyval.i) = iSUBROUTINE(interp,
IMCC_INFO(interp)->cur_unit,
@@ -3408,14 +3415,14 @@
break;
case 40:
-#line 1269 "compilers/imcc/imcc.y"
+#line 1274 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr));
}
break;
case 41:
-#line 1273 "compilers/imcc/imcc.y"
+#line 1278 "compilers/imcc/imcc.y"
{
SymReg *r = mk_pasm_reg(interp, (yyvsp[(4) - (4)].s));
SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'S');
@@ -3427,17 +3434,17 @@
break;
case 42:
-#line 1281 "compilers/imcc/imcc.y"
+#line 1286 "compilers/imcc/imcc.y"
{ (yyval.i) = 0;}
break;
case 44:
-#line 1289 "compilers/imcc/imcc.y"
+#line 1294 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); }
break;
case 45:
-#line 1292 "compilers/imcc/imcc.y"
+#line 1297 "compilers/imcc/imcc.y"
{
/* if (optimizer_level & OPT_PASM)
imc_compile_unit(interp, IMCC_INFO(interp)->cur_unit);
@@ -3448,7 +3455,7 @@
break;
case 48:
-#line 1308 "compilers/imcc/imcc.y"
+#line 1313 "compilers/imcc/imcc.y"
{
int re_open = 0;
(yyval.i) = 0;
@@ -3463,7 +3470,7 @@
break;
case 49:
-#line 1323 "compilers/imcc/imcc.y"
+#line 1328 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->in_slice)
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
@@ -3474,26 +3481,26 @@
break;
case 50:
-#line 1330 "compilers/imcc/imcc.y"
+#line 1335 "compilers/imcc/imcc.y"
{ (yyval.sr) = NULL; }
break;
case 51:
-#line 1335 "compilers/imcc/imcc.y"
+#line 1340 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PCCSUB);
}
break;
case 52:
-#line 1339 "compilers/imcc/imcc.y"
+#line 1344 "compilers/imcc/imcc.y"
{
iSUBROUTINE(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (3)].sr));
}
break;
case 53:
-#line 1343 "compilers/imcc/imcc.y"
+#line 1348 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(5) - (6)].t);
if (!IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid) {
@@ -3504,22 +3511,22 @@
break;
case 54:
-#line 1351 "compilers/imcc/imcc.y"
+#line 1356 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 55:
-#line 1355 "compilers/imcc/imcc.y"
+#line 1360 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 56:
-#line 1356 "compilers/imcc/imcc.y"
+#line 1361 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 57:
-#line 1358 "compilers/imcc/imcc.y"
+#line 1363 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
add_pcc_named_param(interp, IMCC_INFO(interp)->cur_call,
@@ -3532,17 +3539,17 @@
break;
case 58:
-#line 1370 "compilers/imcc/imcc.y"
+#line 1375 "compilers/imcc/imcc.y"
{ pesky_global__is_def=1; }
break;
case 59:
-#line 1370 "compilers/imcc/imcc.y"
+#line 1375 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(3) - (3)].sr); pesky_global__is_def=0; }
break;
case 60:
-#line 1375 "compilers/imcc/imcc.y"
+#line 1380 "compilers/imcc/imcc.y"
{
if ((yyvsp[(3) - (3)].t) & VT_UNIQUE_REG)
(yyval.sr) = mk_ident_ur(interp, (yyvsp[(2) - (3)].s), (yyvsp[(1) - (3)].t));
@@ -3554,12 +3561,12 @@
break;
case 61:
-#line 1388 "compilers/imcc/imcc.y"
+#line 1393 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 62:
-#line 1393 "compilers/imcc/imcc.y"
+#line 1398 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->outer = mk_sub_address_fromc(interp, (yyvsp[(3) - (4)].s));
@@ -3568,7 +3575,7 @@
break;
case 63:
-#line 1399 "compilers/imcc/imcc.y"
+#line 1404 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->outer = mk_const(interp, (yyvsp[(3) - (4)].s), 'S');
@@ -3577,52 +3584,52 @@
break;
case 64:
-#line 1408 "compilers/imcc/imcc.y"
+#line 1413 "compilers/imcc/imcc.y"
{
(yyval.t) = P_VTABLE;
- IMCC_INFO(interp)->cur_unit->vtable_name = NULL;
+ IMCC_INFO(interp)->cur_unit->vtable_name = NULL;
IMCC_INFO(interp)->cur_unit->is_vtable_method = 1;
}
break;
case 65:
-#line 1414 "compilers/imcc/imcc.y"
+#line 1419 "compilers/imcc/imcc.y"
{
(yyval.t) = P_VTABLE;
- IMCC_INFO(interp)->cur_unit->vtable_name = (yyvsp[(3) - (4)].s);
+ IMCC_INFO(interp)->cur_unit->vtable_name = (yyvsp[(3) - (4)].s);
IMCC_INFO(interp)->cur_unit->is_vtable_method = 1;
}
break;
case 66:
-#line 1423 "compilers/imcc/imcc.y"
+#line 1428 "compilers/imcc/imcc.y"
{
(yyval.t) = P_METHOD;
IMCC_INFO(interp)->cur_unit->method_name = NULL;
- IMCC_INFO(interp)->cur_unit->is_method = 1;
+ IMCC_INFO(interp)->cur_unit->is_method = 1;
}
break;
case 67:
-#line 1429 "compilers/imcc/imcc.y"
+#line 1434 "compilers/imcc/imcc.y"
{
(yyval.t) = P_METHOD;
IMCC_INFO(interp)->cur_unit->method_name = (yyvsp[(3) - (4)].s);
- IMCC_INFO(interp)->cur_unit->is_method = 1;
+ IMCC_INFO(interp)->cur_unit->is_method = 1;
}
break;
case 68:
-#line 1438 "compilers/imcc/imcc.y"
+#line 1443 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
- IMCC_INFO(interp)->cur_unit->ns_entry_name = NULL;
+ IMCC_INFO(interp)->cur_unit->ns_entry_name = NULL;
IMCC_INFO(interp)->cur_unit->has_ns_entry_name = 1;
}
break;
case 69:
-#line 1444 "compilers/imcc/imcc.y"
+#line 1449 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->ns_entry_name = (yyvsp[(3) - (4)].s);
@@ -3631,7 +3638,7 @@
break;
case 70:
-#line 1453 "compilers/imcc/imcc.y"
+#line 1458 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->instance_of = (yyvsp[(3) - (4)].s);
@@ -3639,7 +3646,7 @@
break;
case 71:
-#line 1461 "compilers/imcc/imcc.y"
+#line 1466 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->subid = NULL;
@@ -3647,7 +3654,7 @@
break;
case 72:
-#line 1466 "compilers/imcc/imcc.y"
+#line 1471 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->subid = mk_const(interp, (yyvsp[(3) - (4)].s), 'S');
@@ -3657,14 +3664,14 @@
break;
case 73:
-#line 1476 "compilers/imcc/imcc.y"
+#line 1481 "compilers/imcc/imcc.y"
{
add_pcc_multi(IMCC_INFO(interp)->cur_call, NULL);
}
break;
case 74:
-#line 1480 "compilers/imcc/imcc.y"
+#line 1485 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr));
@@ -3672,7 +3679,7 @@
break;
case 75:
-#line 1485 "compilers/imcc/imcc.y"
+#line 1490 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr));
@@ -3680,27 +3687,27 @@
break;
case 76:
-#line 1492 "compilers/imcc/imcc.y"
+#line 1497 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "INTVAL", 'S'); }
break;
case 77:
-#line 1493 "compilers/imcc/imcc.y"
+#line 1498 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); }
break;
case 78:
-#line 1494 "compilers/imcc/imcc.y"
+#line 1499 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "PMC", 'S'); }
break;
case 79:
-#line 1495 "compilers/imcc/imcc.y"
+#line 1500 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "STRING", 'S'); }
break;
case 80:
-#line 1497 "compilers/imcc/imcc.y"
+#line 1502 "compilers/imcc/imcc.y"
{
SymReg *r;
if (strcmp((yyvsp[(1) - (1)].s), "_") != 0)
@@ -3714,7 +3721,7 @@
break;
case 81:
-#line 1508 "compilers/imcc/imcc.y"
+#line 1513 "compilers/imcc/imcc.y"
{
SymReg *r;
if (strcmp((yyvsp[(1) - (1)].s), "_") != 0)
@@ -3728,12 +3735,12 @@
break;
case 82:
-#line 1518 "compilers/imcc/imcc.y"
+#line 1523 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); }
break;
case 85:
-#line 1528 "compilers/imcc/imcc.y"
+#line 1533 "compilers/imcc/imcc.y"
{
char name[128];
SymReg *r, *r1;
@@ -3760,82 +3767,82 @@
break;
case 86:
-#line 1556 "compilers/imcc/imcc.y"
+#line 1561 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 87:
-#line 1560 "compilers/imcc/imcc.y"
+#line 1565 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; }
break;
case 88:
-#line 1561 "compilers/imcc/imcc.y"
+#line 1566 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; }
break;
case 89:
-#line 1565 "compilers/imcc/imcc.y"
+#line 1570 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; }
break;
case 90:
-#line 1566 "compilers/imcc/imcc.y"
+#line 1571 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); }
break;
case 91:
-#line 1570 "compilers/imcc/imcc.y"
+#line 1575 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 93:
-#line 1575 "compilers/imcc/imcc.y"
+#line 1580 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (1)].t); }
break;
case 94:
-#line 1576 "compilers/imcc/imcc.y"
+#line 1581 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 95:
-#line 1580 "compilers/imcc/imcc.y"
+#line 1585 "compilers/imcc/imcc.y"
{ (yyval.t) = P_LOAD; }
break;
case 96:
-#line 1581 "compilers/imcc/imcc.y"
+#line 1586 "compilers/imcc/imcc.y"
{ (yyval.t) = P_INIT; }
break;
case 97:
-#line 1582 "compilers/imcc/imcc.y"
+#line 1587 "compilers/imcc/imcc.y"
{ (yyval.t) = P_MAIN; }
break;
case 98:
-#line 1583 "compilers/imcc/imcc.y"
+#line 1588 "compilers/imcc/imcc.y"
{ (yyval.t) = P_IMMEDIATE; }
break;
case 99:
-#line 1584 "compilers/imcc/imcc.y"
+#line 1589 "compilers/imcc/imcc.y"
{ (yyval.t) = P_POSTCOMP; }
break;
case 100:
-#line 1585 "compilers/imcc/imcc.y"
+#line 1590 "compilers/imcc/imcc.y"
{ (yyval.t) = P_ANON; }
break;
case 101:
-#line 1586 "compilers/imcc/imcc.y"
+#line 1591 "compilers/imcc/imcc.y"
{ (yyval.t) = P_NEED_LEX; }
break;
case 109:
-#line 1598 "compilers/imcc/imcc.y"
+#line 1603 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
@@ -3843,14 +3850,14 @@
break;
case 110:
-#line 1603 "compilers/imcc/imcc.y"
+#line 1608 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
}
break;
case 111:
-#line 1607 "compilers/imcc/imcc.y"
+#line 1612 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isNCI;
@@ -3858,21 +3865,21 @@
break;
case 112:
-#line 1612 "compilers/imcc/imcc.y"
+#line 1617 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
}
break;
case 113:
-#line 1616 "compilers/imcc/imcc.y"
+#line 1621 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (3)].s), 'S'));
}
break;
case 114:
-#line 1620 "compilers/imcc/imcc.y"
+#line 1625 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
@@ -3880,7 +3887,7 @@
break;
case 115:
-#line 1625 "compilers/imcc/imcc.y"
+#line 1630 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (5)].s), 'S'));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
@@ -3888,27 +3895,27 @@
break;
case 116:
-#line 1633 "compilers/imcc/imcc.y"
+#line 1638 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 117:
-#line 1634 "compilers/imcc/imcc.y"
+#line 1639 "compilers/imcc/imcc.y"
{ add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); }
break;
case 118:
-#line 1638 "compilers/imcc/imcc.y"
+#line 1643 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (2)].sr); }
break;
case 119:
-#line 1643 "compilers/imcc/imcc.y"
+#line 1648 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 120:
-#line 1645 "compilers/imcc/imcc.y"
+#line 1650 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
@@ -3916,17 +3923,17 @@
break;
case 121:
-#line 1652 "compilers/imcc/imcc.y"
+#line 1657 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 122:
-#line 1653 "compilers/imcc/imcc.y"
+#line 1658 "compilers/imcc/imcc.y"
{ pesky_global__is_def=1; }
break;
case 123:
-#line 1654 "compilers/imcc/imcc.y"
+#line 1659 "compilers/imcc/imcc.y"
{
IdList *l = (yyvsp[(4) - (4)].idlist);
SymReg *ignored;
@@ -3941,62 +3948,62 @@
break;
case 124:
-#line 1668 "compilers/imcc/imcc.y"
+#line 1673 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 125:
-#line 1669 "compilers/imcc/imcc.y"
+#line 1674 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 126:
-#line 1673 "compilers/imcc/imcc.y"
+#line 1678 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_FLAT; }
break;
case 127:
-#line 1674 "compilers/imcc/imcc.y"
+#line 1679 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_OPTIONAL; }
break;
case 128:
-#line 1675 "compilers/imcc/imcc.y"
+#line 1680 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_OPT_FLAG; }
break;
case 129:
-#line 1676 "compilers/imcc/imcc.y"
+#line 1681 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_NAMED; }
break;
case 130:
-#line 1677 "compilers/imcc/imcc.y"
- { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
+#line 1682 "compilers/imcc/imcc.y"
+ { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); }
break;
case 131:
-#line 1678 "compilers/imcc/imcc.y"
- { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
+#line 1683 "compilers/imcc/imcc.y"
+ { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); }
break;
case 132:
-#line 1679 "compilers/imcc/imcc.y"
+#line 1684 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_UNIQUE_REG; }
break;
case 133:
-#line 1684 "compilers/imcc/imcc.y"
+#line 1689 "compilers/imcc/imcc.y"
{ begin_return_or_yield(interp, 0); }
break;
case 134:
-#line 1686 "compilers/imcc/imcc.y"
+#line 1691 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
break;
case 135:
-#line 1688 "compilers/imcc/imcc.y"
+#line 1693 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->asm_state = AsmDefault;
(yyval.i) = 0;
@@ -4004,22 +4011,22 @@
break;
case 136:
-#line 1695 "compilers/imcc/imcc.y"
+#line 1700 "compilers/imcc/imcc.y"
{ begin_return_or_yield(interp, 1); }
break;
case 137:
-#line 1697 "compilers/imcc/imcc.y"
+#line 1702 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
break;
case 138:
-#line 1701 "compilers/imcc/imcc.y"
+#line 1706 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 139:
-#line 1703 "compilers/imcc/imcc.y"
+#line 1708 "compilers/imcc/imcc.y"
{
if ((yyvsp[(1) - (2)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr));
@@ -4027,7 +4034,7 @@
break;
case 140:
-#line 1708 "compilers/imcc/imcc.y"
+#line 1713 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr));
@@ -4035,12 +4042,12 @@
break;
case 141:
-#line 1715 "compilers/imcc/imcc.y"
+#line 1720 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 142:
-#line 1717 "compilers/imcc/imcc.y"
+#line 1722 "compilers/imcc/imcc.y"
{
if ((yyvsp[(1) - (2)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr));
@@ -4048,7 +4055,7 @@
break;
case 143:
-#line 1722 "compilers/imcc/imcc.y"
+#line 1727 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr));
@@ -4056,17 +4063,17 @@
break;
case 144:
-#line 1729 "compilers/imcc/imcc.y"
+#line 1734 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 145:
-#line 1733 "compilers/imcc/imcc.y"
+#line 1738 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 146:
-#line 1738 "compilers/imcc/imcc.y"
+#line 1743 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->asm_state == AsmDefault)
begin_return_or_yield(interp, (yyvsp[(1) - (2)].t));
@@ -4074,7 +4081,7 @@
break;
case 147:
-#line 1743 "compilers/imcc/imcc.y"
+#line 1748 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->asm_state = AsmDefault;
(yyval.t) = 0;
@@ -4082,22 +4089,22 @@
break;
case 148:
-#line 1750 "compilers/imcc/imcc.y"
+#line 1755 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 149:
-#line 1751 "compilers/imcc/imcc.y"
+#line 1756 "compilers/imcc/imcc.y"
{ (yyval.t) = 1; }
break;
case 150:
-#line 1755 "compilers/imcc/imcc.y"
+#line 1760 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 151:
-#line 1757 "compilers/imcc/imcc.y"
+#line 1762 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
add_pcc_named_return(interp, IMCC_INFO(interp)->sr_return,
@@ -4110,7 +4117,7 @@
break;
case 152:
-#line 1767 "compilers/imcc/imcc.y"
+#line 1772 "compilers/imcc/imcc.y"
{
SymReg *name = mk_const(interp, (yyvsp[(1) - (3)].s), 'S');
add_pcc_named_return(interp, IMCC_INFO(interp)->sr_return, name, (yyvsp[(3) - (3)].sr));
@@ -4118,7 +4125,7 @@
break;
case 153:
-#line 1772 "compilers/imcc/imcc.y"
+#line 1777 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
add_pcc_named_return(interp, IMCC_INFO(interp)->sr_return,
@@ -4131,7 +4138,7 @@
break;
case 154:
-#line 1782 "compilers/imcc/imcc.y"
+#line 1787 "compilers/imcc/imcc.y"
{
SymReg *name = mk_const(interp, (yyvsp[(3) - (5)].s), 'S');
add_pcc_named_return(interp, IMCC_INFO(interp)->sr_return, name, (yyvsp[(5) - (5)].sr));
@@ -4139,59 +4146,61 @@
break;
case 157:
-#line 1803 "compilers/imcc/imcc.y"
+#line 1808 "compilers/imcc/imcc.y"
{ clear_state(interp); }
break;
case 158:
-#line 1808 "compilers/imcc/imcc.y"
+#line 1813 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (2)].i); }
break;
case 159:
-#line 1809 "compilers/imcc/imcc.y"
+#line 1814 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 160:
-#line 1810 "compilers/imcc/imcc.y"
+#line 1815 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 161:
-#line 1811 "compilers/imcc/imcc.y"
+#line 1816 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 162:
-#line 1812 "compilers/imcc/imcc.y"
+#line 1817 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 163:
-#line 1813 "compilers/imcc/imcc.y"
+#line 1818 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 164:
-#line 1817 "compilers/imcc/imcc.y"
+#line 1822 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; }
break;
case 168:
-#line 1828 "compilers/imcc/imcc.y"
+#line 1833 "compilers/imcc/imcc.y"
{
- (yyval.i) = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, (yyvsp[(1) - (1)].s)));
+ Instruction *i = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, (yyvsp[(1) - (1)].s)));
+ mem_sys_free((yyvsp[(1) - (1)].s));
+ (yyval.i) = i;
}
break;
case 169:
-#line 1836 "compilers/imcc/imcc.y"
+#line 1843 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (3)].i); }
break;
case 170:
-#line 1838 "compilers/imcc/imcc.y"
+#line 1845 "compilers/imcc/imcc.y"
{
if (yynerrs >= PARROT_MAX_RECOVER_ERRORS) {
IMCC_warning(interp, "Too many errors. Correct some first.\n");
@@ -4202,7 +4211,7 @@
break;
case 171:
-#line 1849 "compilers/imcc/imcc.y"
+#line 1856 "compilers/imcc/imcc.y"
{
IdList* l = (yyvsp[(1) - (1)].idlist);
l->next = NULL;
@@ -4211,7 +4220,7 @@
break;
case 172:
-#line 1856 "compilers/imcc/imcc.y"
+#line 1863 "compilers/imcc/imcc.y"
{
IdList* l = (yyvsp[(3) - (3)].idlist);
l->next = (yyvsp[(1) - (3)].idlist);
@@ -4220,7 +4229,7 @@
break;
case 173:
-#line 1865 "compilers/imcc/imcc.y"
+#line 1872 "compilers/imcc/imcc.y"
{
IdList* const l = mem_allocate_n_zeroed_typed(1, IdList);
l->id = (yyvsp[(1) - (2)].s);
@@ -4230,22 +4239,22 @@
break;
case 174:
-#line 1874 "compilers/imcc/imcc.y"
+#line 1881 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 175:
-#line 1875 "compilers/imcc/imcc.y"
+#line 1882 "compilers/imcc/imcc.y"
{ (yyval.t) = 1; }
break;
case 178:
-#line 1882 "compilers/imcc/imcc.y"
+#line 1889 "compilers/imcc/imcc.y"
{ pesky_global__is_def=1; }
break;
case 179:
-#line 1883 "compilers/imcc/imcc.y"
+#line 1890 "compilers/imcc/imcc.y"
{
IdList *l = (yyvsp[(4) - (4)].idlist);
while (l) {
@@ -4264,28 +4273,30 @@
break;
case 180:
-#line 1899 "compilers/imcc/imcc.y"
+#line 1906 "compilers/imcc/imcc.y"
{
SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'S');
set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
+ mem_sys_free((yyvsp[(2) - (4)].s));
}
break;
case 181:
-#line 1904 "compilers/imcc/imcc.y"
+#line 1912 "compilers/imcc/imcc.y"
{
SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'U');
set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
+ mem_sys_free((yyvsp[(2) - (4)].s));
}
break;
case 182:
-#line 1908 "compilers/imcc/imcc.y"
+#line 1917 "compilers/imcc/imcc.y"
{ pesky_global__is_def=1; }
break;
case 183:
-#line 1909 "compilers/imcc/imcc.y"
+#line 1918 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 0);
pesky_global__is_def=0;
@@ -4294,12 +4305,12 @@
break;
case 185:
-#line 1916 "compilers/imcc/imcc.y"
+#line 1925 "compilers/imcc/imcc.y"
{ pesky_global__is_def=1; }
break;
case 186:
-#line 1917 "compilers/imcc/imcc.y"
+#line 1926 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
pesky_global__is_def=0;
@@ -4308,7 +4319,7 @@
break;
case 187:
-#line 1923 "compilers/imcc/imcc.y"
+#line 1932 "compilers/imcc/imcc.y"
{
(yyval.i) = NULL;
IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isTAIL_CALL;
@@ -4317,14 +4328,14 @@
break;
case 188:
-#line 1929 "compilers/imcc/imcc.y"
+#line 1938 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "branch", 1, (yyvsp[(2) - (2)].sr));
}
break;
case 189:
-#line 1933 "compilers/imcc/imcc.y"
+#line 1942 "compilers/imcc/imcc.y"
{
(yyval.i) = INS(interp,
IMCC_INFO(interp)->cur_unit,
@@ -4339,47 +4350,47 @@
break;
case 190:
-#line 1944 "compilers/imcc/imcc.y"
+#line 1953 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); }
break;
case 191:
-#line 1945 "compilers/imcc/imcc.y"
+#line 1954 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 192:
-#line 1946 "compilers/imcc/imcc.y"
+#line 1955 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 195:
-#line 1949 "compilers/imcc/imcc.y"
+#line 1958 "compilers/imcc/imcc.y"
{ (yyval.i) = 0;}
break;
case 196:
-#line 1953 "compilers/imcc/imcc.y"
+#line 1962 "compilers/imcc/imcc.y"
{ (yyval.t) = 'I'; }
break;
case 197:
-#line 1954 "compilers/imcc/imcc.y"
+#line 1963 "compilers/imcc/imcc.y"
{ (yyval.t) = 'N'; }
break;
case 198:
-#line 1955 "compilers/imcc/imcc.y"
+#line 1964 "compilers/imcc/imcc.y"
{ (yyval.t) = 'S'; }
break;
case 199:
-#line 1956 "compilers/imcc/imcc.y"
+#line 1965 "compilers/imcc/imcc.y"
{ (yyval.t) = 'P'; }
break;
case 200:
-#line 1961 "compilers/imcc/imcc.y"
+#line 1970 "compilers/imcc/imcc.y"
{
/* there'd normally be a str_dup() here, but the lexer already
* copied the string, so it's safe to use directly */
@@ -4392,37 +4403,37 @@
break;
case 201:
-#line 1974 "compilers/imcc/imcc.y"
+#line 1983 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); }
break;
case 202:
-#line 1976 "compilers/imcc/imcc.y"
+#line 1985 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); }
break;
case 203:
-#line 1978 "compilers/imcc/imcc.y"
+#line 1987 "compilers/imcc/imcc.y"
{ (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)); }
break;
case 204:
-#line 1980 "compilers/imcc/imcc.y"
+#line 1989 "compilers/imcc/imcc.y"
{ (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); }
break;
case 205:
-#line 1982 "compilers/imcc/imcc.y"
+#line 1991 "compilers/imcc/imcc.y"
{ (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); }
break;
case 206:
-#line 1987 "compilers/imcc/imcc.y"
+#line 1996 "compilers/imcc/imcc.y"
{ (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); }
break;
case 207:
-#line 1990 "compilers/imcc/imcc.y"
+#line 1999 "compilers/imcc/imcc.y"
{
add_pcc_result((yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr));
IMCC_INFO(interp)->cur_call = NULL;
@@ -4431,14 +4442,14 @@
break;
case 208:
-#line 1996 "compilers/imcc/imcc.y"
+#line 2005 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
}
break;
case 209:
-#line 2000 "compilers/imcc/imcc.y"
+#line 2009 "compilers/imcc/imcc.y"
{
IMCC_itcall_sub(interp, (yyvsp[(6) - (9)].sr));
IMCC_INFO(interp)->cur_call = NULL;
@@ -4446,144 +4457,144 @@
break;
case 213:
-#line 2008 "compilers/imcc/imcc.y"
+#line 2017 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(1) - (3)].sr));
}
break;
case 214:
-#line 2015 "compilers/imcc/imcc.y"
+#line 2024 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"not"; }
break;
case 215:
-#line 2016 "compilers/imcc/imcc.y"
+#line 2025 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bnot"; }
break;
case 216:
-#line 2017 "compilers/imcc/imcc.y"
+#line 2026 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"neg"; }
break;
case 217:
-#line 2021 "compilers/imcc/imcc.y"
+#line 2030 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"sub"; }
break;
case 218:
-#line 2022 "compilers/imcc/imcc.y"
+#line 2031 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"add"; }
break;
case 219:
-#line 2023 "compilers/imcc/imcc.y"
+#line 2032 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mul"; }
break;
case 220:
-#line 2024 "compilers/imcc/imcc.y"
+#line 2033 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"div"; }
break;
case 221:
-#line 2025 "compilers/imcc/imcc.y"
+#line 2034 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mod"; }
break;
case 222:
-#line 2026 "compilers/imcc/imcc.y"
+#line 2035 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"fdiv"; }
break;
case 223:
-#line 2027 "compilers/imcc/imcc.y"
+#line 2036 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"pow"; }
break;
case 224:
-#line 2028 "compilers/imcc/imcc.y"
+#line 2037 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"concat"; }
break;
case 225:
-#line 2029 "compilers/imcc/imcc.y"
+#line 2038 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"iseq"; }
break;
case 226:
-#line 2030 "compilers/imcc/imcc.y"
+#line 2039 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isne"; }
break;
case 227:
-#line 2031 "compilers/imcc/imcc.y"
+#line 2040 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isgt"; }
break;
case 228:
-#line 2032 "compilers/imcc/imcc.y"
+#line 2041 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isge"; }
break;
case 229:
-#line 2033 "compilers/imcc/imcc.y"
+#line 2042 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"islt"; }
break;
case 230:
-#line 2034 "compilers/imcc/imcc.y"
+#line 2043 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isle"; }
break;
case 231:
-#line 2035 "compilers/imcc/imcc.y"
+#line 2044 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shl"; }
break;
case 232:
-#line 2036 "compilers/imcc/imcc.y"
+#line 2045 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shr"; }
break;
case 233:
-#line 2037 "compilers/imcc/imcc.y"
+#line 2046 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lsr"; }
break;
case 234:
-#line 2038 "compilers/imcc/imcc.y"
+#line 2047 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"and"; }
break;
case 235:
-#line 2039 "compilers/imcc/imcc.y"
+#line 2048 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"or"; }
break;
case 236:
-#line 2040 "compilers/imcc/imcc.y"
+#line 2049 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"xor"; }
break;
case 237:
-#line 2041 "compilers/imcc/imcc.y"
+#line 2050 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"band"; }
break;
case 238:
-#line 2042 "compilers/imcc/imcc.y"
+#line 2051 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bor"; }
break;
case 239:
-#line 2043 "compilers/imcc/imcc.y"
+#line 2052 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bxor"; }
break;
case 240:
-#line 2049 "compilers/imcc/imcc.y"
+#line 2058 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
(yyval.i)->type &= ~ITCALL;
@@ -4592,84 +4603,84 @@
break;
case 241:
-#line 2054 "compilers/imcc/imcc.y"
+#line 2063 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 242:
-#line 2061 "compilers/imcc/imcc.y"
+#line 2070 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(2) - (3)].s), 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));
}
break;
case 243:
-#line 2067 "compilers/imcc/imcc.y"
+#line 2076 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"add"; }
break;
case 244:
-#line 2068 "compilers/imcc/imcc.y"
+#line 2077 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"sub"; }
break;
case 245:
-#line 2069 "compilers/imcc/imcc.y"
+#line 2078 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mul"; }
break;
case 246:
-#line 2070 "compilers/imcc/imcc.y"
+#line 2079 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"div"; }
break;
case 247:
-#line 2071 "compilers/imcc/imcc.y"
+#line 2080 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mod"; }
break;
case 248:
-#line 2072 "compilers/imcc/imcc.y"
+#line 2081 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"fdiv"; }
break;
case 249:
-#line 2073 "compilers/imcc/imcc.y"
+#line 2082 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"concat"; }
break;
case 250:
-#line 2074 "compilers/imcc/imcc.y"
+#line 2083 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"band"; }
break;
case 251:
-#line 2075 "compilers/imcc/imcc.y"
+#line 2084 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bor"; }
break;
case 252:
-#line 2076 "compilers/imcc/imcc.y"
+#line 2085 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bxor"; }
break;
case 253:
-#line 2077 "compilers/imcc/imcc.y"
+#line 2086 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shr"; }
break;
case 254:
-#line 2078 "compilers/imcc/imcc.y"
+#line 2087 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shl"; }
break;
case 255:
-#line 2079 "compilers/imcc/imcc.y"
+#line 2088 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lsr"; }
break;
case 256:
-#line 2085 "compilers/imcc/imcc.y"
+#line 2094 "compilers/imcc/imcc.y"
{
(yyval.i) = func_ins(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (4)].sr), (yyvsp[(3) - (4)].s),
IMCC_INFO(interp) -> regs,
@@ -4680,22 +4691,22 @@
break;
case 257:
-#line 2095 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
+#line 2104 "compilers/imcc/imcc.y"
+ { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 258:
-#line 2096 "compilers/imcc/imcc.y"
+#line 2105 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 259:
-#line 2097 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
+#line 2106 "compilers/imcc/imcc.y"
+ { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 260:
-#line 2099 "compilers/imcc/imcc.y"
+#line 2108 "compilers/imcc/imcc.y"
{
(yyval.sr) = (yyvsp[(1) - (1)].sr);
if ((yyvsp[(1) - (1)].sr)->set != 'P')
@@ -4704,7 +4715,7 @@
break;
case 261:
-#line 2105 "compilers/imcc/imcc.y"
+#line 2114 "compilers/imcc/imcc.y"
{
/* disallow bareword method names; SREG name constants are fine */
char *name = (yyvsp[(3) - (3)].sr)->name;
@@ -4721,39 +4732,48 @@
break;
case 262:
-#line 2119 "compilers/imcc/imcc.y"
+#line 2128 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
- (yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'S');
+ (yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'U');
mem_sys_free((yyvsp[(3) - (3)].s));
}
break;
case 263:
-#line 2124 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); }
+#line 2134 "compilers/imcc/imcc.y"
+ {
+ IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
+ (yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'S');
+ mem_sys_free((yyvsp[(3) - (3)].s));
+ }
break;
case 264:
-#line 2130 "compilers/imcc/imcc.y"
+#line 2139 "compilers/imcc/imcc.y"
+ { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); }
+ break;
+
+ case 265:
+#line 2145 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
IMCC_itcall_sub(interp, (yyvsp[(1) - (1)].sr));
}
break;
- case 265:
-#line 2134 "compilers/imcc/imcc.y"
+ case 266:
+#line 2149 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (5)].i); }
break;
- case 266:
-#line 2138 "compilers/imcc/imcc.y"
+ case 267:
+#line 2153 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
- case 267:
-#line 2140 "compilers/imcc/imcc.y"
+ case 268:
+#line 2155 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4765,8 +4785,8 @@
}
break;
- case 268:
-#line 2150 "compilers/imcc/imcc.y"
+ case 269:
+#line 2165 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4778,8 +4798,8 @@
}
break;
- case 269:
-#line 2160 "compilers/imcc/imcc.y"
+ case 270:
+#line 2175 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
add_pcc_named_arg(interp, IMCC_INFO(interp)->cur_call,
@@ -4788,16 +4808,16 @@
}
break;
- case 270:
-#line 2167 "compilers/imcc/imcc.y"
+ case 271:
+#line 2182 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
add_pcc_named_arg_var(interp, IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));
}
break;
- case 271:
-#line 2172 "compilers/imcc/imcc.y"
+ case 272:
+#line 2187 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
add_pcc_named_arg(interp, IMCC_INFO(interp)->cur_call,
@@ -4806,48 +4826,48 @@
}
break;
- case 272:
-#line 2181 "compilers/imcc/imcc.y"
+ case 273:
+#line 2196 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
break;
- case 273:
-#line 2185 "compilers/imcc/imcc.y"
+ case 274:
+#line 2200 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
- case 274:
-#line 2186 "compilers/imcc/imcc.y"
+ case 275:
+#line 2201 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
- case 275:
-#line 2190 "compilers/imcc/imcc.y"
+ case 276:
+#line 2205 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_FLAT; }
break;
- case 276:
-#line 2191 "compilers/imcc/imcc.y"
+ case 277:
+#line 2206 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_NAMED; }
break;
- case 277:
-#line 2194 "compilers/imcc/imcc.y"
+ case 278:
+#line 2209 "compilers/imcc/imcc.y"
{ adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
break;
- case 278:
-#line 2195 "compilers/imcc/imcc.y"
+ case 279:
+#line 2210 "compilers/imcc/imcc.y"
{ adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
break;
- case 279:
-#line 2199 "compilers/imcc/imcc.y"
+ case 280:
+#line 2214 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
break;
- case 280:
-#line 2204 "compilers/imcc/imcc.y"
+ case 281:
+#line 2219 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4859,8 +4879,8 @@
}
break;
- case 281:
-#line 2214 "compilers/imcc/imcc.y"
+ case 282:
+#line 2229 "compilers/imcc/imcc.y"
{
add_pcc_named_result(interp, IMCC_INFO(interp)->cur_call,
mk_const(interp, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr));
@@ -4868,8 +4888,8 @@
}
break;
- case 282:
-#line 2220 "compilers/imcc/imcc.y"
+ case 283:
+#line 2235 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4881,133 +4901,133 @@
}
break;
- case 283:
-#line 2230 "compilers/imcc/imcc.y"
+ case 284:
+#line 2245 "compilers/imcc/imcc.y"
{
add_pcc_named_result(interp, IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr));
mem_sys_free((yyvsp[(1) - (3)].s));
}
break;
- case 284:
-#line 2234 "compilers/imcc/imcc.y"
+ case 285:
+#line 2249 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
- case 285:
-#line 2238 "compilers/imcc/imcc.y"
+ case 286:
+#line 2253 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
- case 286:
-#line 2239 "compilers/imcc/imcc.y"
+ case 287:
+#line 2254 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
- case 287:
-#line 2244 "compilers/imcc/imcc.y"
+ case 288:
+#line 2259 "compilers/imcc/imcc.y"
{
(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));
}
break;
- case 288:
-#line 2248 "compilers/imcc/imcc.y"
+ case 289:
+#line 2263 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
}
break;
- case 289:
-#line 2252 "compilers/imcc/imcc.y"
+ case 290:
+#line 2267 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
}
break;
- case 290:
-#line 2259 "compilers/imcc/imcc.y"
+ case 291:
+#line 2274 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
}
break;
- case 291:
-#line 2263 "compilers/imcc/imcc.y"
+ case 292:
+#line 2278 "compilers/imcc/imcc.y"
{
(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));
}
break;
- case 292:
-#line 2267 "compilers/imcc/imcc.y"
+ case 293:
+#line 2282 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
}
break;
- case 293:
-#line 2273 "compilers/imcc/imcc.y"
+ case 294:
+#line 2288 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
- case 294:
-#line 2274 "compilers/imcc/imcc.y"
+ case 295:
+#line 2289 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
- case 295:
-#line 2278 "compilers/imcc/imcc.y"
+ case 296:
+#line 2293 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"eq"; }
break;
- case 296:
-#line 2279 "compilers/imcc/imcc.y"
+ case 297:
+#line 2294 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"ne"; }
break;
- case 297:
-#line 2280 "compilers/imcc/imcc.y"
+ case 298:
+#line 2295 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"gt"; }
break;
- case 298:
-#line 2281 "compilers/imcc/imcc.y"
+ case 299:
+#line 2296 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"ge"; }
break;
- case 299:
-#line 2282 "compilers/imcc/imcc.y"
+ case 300:
+#line 2297 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lt"; }
break;
- case 300:
-#line 2283 "compilers/imcc/imcc.y"
+ case 301:
+#line 2298 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"le"; }
break;
- case 303:
-#line 2292 "compilers/imcc/imcc.y"
+ case 304:
+#line 2307 "compilers/imcc/imcc.y"
{ (yyval.sr) = NULL; }
break;
- case 304:
-#line 2293 "compilers/imcc/imcc.y"
+ case 305:
+#line 2308 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (1)].sr); }
break;
- case 305:
-#line 2297 "compilers/imcc/imcc.y"
+ case 306:
+#line 2312 "compilers/imcc/imcc.y"
{ (yyval.sr) = IMCC_INFO(interp)->regs[0]; }
break;
- case 307:
-#line 2302 "compilers/imcc/imcc.y"
+ case 308:
+#line 2317 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); }
break;
- case 308:
-#line 2304 "compilers/imcc/imcc.y"
+ case 309:
+#line 2319 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (4)].sr);
IMCC_INFO(interp) -> keyvec |= KEY_BIT(IMCC_INFO(interp)->nargs);
@@ -5016,54 +5036,54 @@
}
break;
- case 309:
-#line 2311 "compilers/imcc/imcc.y"
+ case 310:
+#line 2326 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(2) - (3)].sr);
(yyval.sr) = (yyvsp[(2) - (3)].sr);
}
break;
- case 311:
-#line 2318 "compilers/imcc/imcc.y"
+ case 312:
+#line 2333 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 312:
-#line 2319 "compilers/imcc/imcc.y"
+ case 313:
+#line 2334 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 313:
-#line 2323 "compilers/imcc/imcc.y"
+ case 314:
+#line 2338 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 314:
-#line 2324 "compilers/imcc/imcc.y"
+ case 315:
+#line 2339 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 315:
-#line 2328 "compilers/imcc/imcc.y"
+ case 316:
+#line 2343 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 316:
-#line 2329 "compilers/imcc/imcc.y"
+ case 317:
+#line 2344 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 321:
-#line 2343 "compilers/imcc/imcc.y"
+ case 322:
+#line 2358 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
IMCC_INFO(interp)->in_slice = 0;
}
break;
- case 322:
-#line 2348 "compilers/imcc/imcc.y"
+ case 323:
+#line 2363 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
IMCC_INFO(interp)->nkeys,
@@ -5071,16 +5091,16 @@
}
break;
- case 323:
-#line 2356 "compilers/imcc/imcc.y"
+ case 324:
+#line 2371 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
IMCC_INFO(interp)->in_slice = 0;
}
break;
- case 324:
-#line 2361 "compilers/imcc/imcc.y"
+ case 325:
+#line 2376 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
IMCC_INFO(interp)->nkeys,
@@ -5088,21 +5108,21 @@
}
break;
- case 325:
-#line 2369 "compilers/imcc/imcc.y"
+ case 326:
+#line 2384 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); }
break;
- case 326:
-#line 2371 "compilers/imcc/imcc.y"
+ case 327:
+#line 2386 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr);
(yyval.sr) = IMCC_INFO(interp)->keys[0];
}
break;
- case 327:
-#line 2379 "compilers/imcc/imcc.y"
+ case 328:
+#line 2394 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->in_slice)
(yyvsp[(1) - (1)].sr)->type |= VT_START_SLICE | VT_END_SLICE;
@@ -5110,54 +5130,54 @@
}
break;
- case 328:
-#line 2387 "compilers/imcc/imcc.y"
+ case 329:
+#line 2402 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); }
break;
- case 329:
-#line 2388 "compilers/imcc/imcc.y"
+ case 330:
+#line 2403 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); }
break;
- case 330:
-#line 2389 "compilers/imcc/imcc.y"
+ case 331:
+#line 2404 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); }
break;
- case 331:
-#line 2390 "compilers/imcc/imcc.y"
+ case 332:
+#line 2405 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); }
break;
- case 332:
-#line 2391 "compilers/imcc/imcc.y"
+ case 333:
+#line 2406 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 333:
-#line 2395 "compilers/imcc/imcc.y"
+ case 334:
+#line 2410 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 334:
-#line 2396 "compilers/imcc/imcc.y"
+ case 335:
+#line 2411 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 335:
-#line 2397 "compilers/imcc/imcc.y"
+ case 336:
+#line 2412 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
- case 336:
-#line 2398 "compilers/imcc/imcc.y"
+ case 337:
+#line 2413 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
/* Line 1267 of yacc.c. */
-#line 5150 "compilers/imcc/imcparser.c"
+#line 5170 "compilers/imcc/imcparser.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -5371,7 +5391,7 @@
}
-#line 2404 "compilers/imcc/imcc.y"
+#line 2419 "compilers/imcc/imcc.y"
/* I need this prototype somewhere... */
Modified: branches/pmc_i_ops/compilers/imcc/imcparser.h
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/imcparser.h Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/imcparser.h Tue Jun 9 22:26:30 2009 (r39482)
@@ -295,7 +295,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 1030 "compilers/imcc/imcc.y"
+#line 1035 "compilers/imcc/imcc.y"
{
IdList * idlist;
int t;
Modified: branches/pmc_i_ops/compilers/imcc/main.c
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/main.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/main.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -219,14 +219,9 @@
" -L --library add path to library search\n"
" -X --dynext add path to dynamic extension search\n"
" <Run core options>\n"
- " -R --runcore CORE\n"
- " --bounds-checks|--slow-core\n"
- " --CGP-core\n"
- " --fast-core\n"
- " --computed-goto-core\n"
- " --jit-core\n"
+ " -R --runcore slow|bounds|fast|jit|cgoto|cgp|cgp-jit\n"
+ " -R --runcore switch|switch-jit|trace|exec|gcdebug\n"
" -p --profile\n"
- " --switched-core\n"
" -t --trace [flags]\n"
" <VM options>\n"
" -D --parrot-debug[=HEXFLAGS]\n"
@@ -534,15 +529,15 @@
SET_FLAG(PARROT_DESTROY_FLAG);
break;
case 'I':
- Parrot_add_library_path_from_cstring(interp, opt.opt_arg,
+ Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
PARROT_LIB_PATH_INCLUDE);
break;
case 'L':
- Parrot_add_library_path_from_cstring(interp, opt.opt_arg,
+ Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
PARROT_LIB_PATH_LIBRARY);
break;
case 'X':
- Parrot_add_library_path_from_cstring(interp, opt.opt_arg,
+ Parrot_lib_add_path_from_cstring(interp, opt.opt_arg,
PARROT_LIB_PATH_DYNEXT);
break;
default:
Modified: branches/pmc_i_ops/compilers/imcc/parser_util.c
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/parser_util.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/parser_util.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -330,6 +330,12 @@
/* in constant */
int dirs = 1;
+ /* XXX: Maybe the check for n == 0 is the only one required
+ * and the other must be assertions? */
+ if (n == 0 || r[0] == NULL || r[0]->name == NULL)
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+ "The opcode '%s' needs arguments", name);
+
r[0] = mk_const(interp, r[0]->name, 'P');
r[0]->pmc_type = enum_class_FixedIntegerArray;
Modified: branches/pmc_i_ops/compilers/imcc/pcc.c
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/pcc.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/pcc.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -815,8 +815,14 @@
if (arg->set != 'P') {
if (!(arg->type == VTIDENTIFIER
|| arg->type == VTPASM
- || arg->type == VTREG))
- meth = mk_const(interp, arg->name, 'S');
+ || arg->type == VTREG)) {
+ if (arg->type & VT_ENCODED) {
+ meth = mk_const(interp, arg->name, 'U');
+ }
+ else {
+ meth = mk_const(interp, arg->name, 'S');
+ }
+ }
}
}
Modified: branches/pmc_i_ops/compilers/imcc/reg_alloc.c
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/reg_alloc.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/reg_alloc.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -1189,8 +1189,9 @@
&& (r->usage & usage)
&& r->use_count) {
Set *avail = sets[j];
- int first_reg = first_avail(unit, (int)r->set, &avail);
-
+ int first_reg = avail
+ ? set_first_zero(avail)
+ : first_avail(unit, (int)r->set, &avail);
set_add(avail, first_reg);
r->color = first_reg++;
@@ -1200,6 +1201,10 @@
(int)r->set, r->name, r->color);
unit->first_avail[j] = first_reg;
+
+ /* don't lose this set; we must free it */
+ if (!sets[j])
+ sets[j] = avail;
}
}
}
Modified: branches/pmc_i_ops/compilers/imcc/symreg.c
==============================================================================
--- branches/pmc_i_ops/compilers/imcc/symreg.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/compilers/imcc/symreg.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -923,7 +923,7 @@
char *aux_name = NULL;
const char * const sub_name = (uniq == U_add_uniq_sub)
/* remember to free this name; add_ns malloc()s it */
- ? (aux_name= add_ns(interp, name))
+ ? (aux_name = add_ns(interp, name))
: (char *)name;
r = _get_sym(hsh, sub_name);
Modified: branches/pmc_i_ops/docs/book/appc_command_line_options.pod
==============================================================================
--- branches/pmc_i_ops/docs/book/appc_command_line_options.pod Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/docs/book/appc_command_line_options.pod Tue Jun 9 22:26:30 2009 (r39482)
@@ -252,37 +252,59 @@
=over 4
-=item --bounds-checks
+=item -R slow
+
+Run with the I<slow core>
+
+=item -R bounds
Activate bounds checking. This also runs with the I<slow core> as a
side effect.
-=item --fast-core
+=item -R fast
Run with the I<fast core>.
-=item --computed-goto-core
+=item -R cgoto
Run the I<computed goto core> (CGoto).
-=item --jit-core
+=item -R jit
Run with the I<JIT core> if available.
-=item -p,--profile
+=item -R cgp
-Activate profiling. This prints a summary of opcode usage and
-execution times after the program stops. It also runs within the
-I<slow core>.
+Run with the I<CGoto-Prederefed> core.
-=item --CGP-core
+=item -R cgp-jit
-Run with the I<CGoto-Prederefed> core.
+Run with the I<CGoto-Prederefed with jit> core.
-=item --switched-core
+=item -R switch
Run with the I<Switched core>.
+=item -R switch-jit
+
+Run with the I<Switched core with jit>.
+
+=item -R exec
+
+Run with the I<exec core>
+(uses JIT at compile time to generate native code)
+
+=item -R gcdebug
+
+Performs a full GC run before every op dispatch
+(good for debugging GC problems)
+
+=item -p,--profile
+
+Activate profiling. This prints a summary of opcode usage and
+execution times after the program stops. It also runs within the
+I<slow core>.
+
=item -t,--trace
Trace execution. This also turns on the I<slow core>.
Modified: branches/pmc_i_ops/docs/pdds/pdd28_strings.pod
==============================================================================
--- branches/pmc_i_ops/docs/pdds/pdd28_strings.pod Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/docs/pdds/pdd28_strings.pod Tue Jun 9 22:26:30 2009 (r39482)
@@ -39,7 +39,7 @@
An encoding determines how a codepoint is represented inside a computer.
Simple encodings like ASCII define that the codepoints 0-127 simply
live as their numeric equivalents inside an eight-bit bytes. Other
-fixed-width encodings like UTF-16 use more bytes to encode more
+fixed-width encodings like UCS-2 use more bytes to encode more
codepoints. Variable-width encodings like UTF-8 use one byte for
codepoints 0-127, two bytes for codepoints 127-2047, and so on.
Modified: branches/pmc_i_ops/docs/running.pod
==============================================================================
--- branches/pmc_i_ops/docs/running.pod Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/docs/running.pod Tue Jun 9 22:26:30 2009 (r39482)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
=head1 NAME
@@ -147,35 +147,10 @@
switch-jit switch core with JIT
trace bounds checking core w/ trace info (see 'parrot --help-debug')
-=item --bounds-checks, --slow-core
-
-Select the bounds-checking slow core (default).
-
-=item --computed-goto-core
-
-Select the CGoto core (if available).
-
-=item --CGP-core
-
-Select the CGP (CGoto Predereferenced) core (if available).
-
-=item --fast-core
-
-Select the fast (or function) core. Bounds checking, profiling, and tracing
-are not available. (That's why it's so fast.)
-
-=item --jit-core
-
-Run with the JIT subsystem (if available).
-
=item -p, --profile
Run with the slow core and print an execution profile.
-=item --switched-core
-
-TODO: This needs to be documented briefly here and also in glossary.pod.
-
=item -t, --trace
Run with the slow core and print trace information to B<stderr>. See C<parrot
Modified: branches/pmc_i_ops/include/parrot/embed.h
==============================================================================
--- branches/pmc_i_ops/include/parrot/embed.h Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/include/parrot/embed.h Tue Jun 9 22:26:30 2009 (r39482)
@@ -84,12 +84,6 @@
int Parrot_revision(void);
-/* Deprecated */
-
-/* with 0.9.1 TT #266 */
-#define Parrot_readbc(i, c) Parrot_pbc_read((i), (c), 0)
-#define Parrot_loadbc(i, pf) Parrot_pbc_load((i), (pf))
-
#endif /* PARROT_EMBED_H_GUARD */
/*
Modified: branches/pmc_i_ops/include/parrot/io.h
==============================================================================
--- branches/pmc_i_ops/include/parrot/io.h Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/include/parrot/io.h Tue Jun 9 22:26:30 2009 (r39482)
@@ -150,6 +150,10 @@
FUNC_MODIFIES(*pmc);
PARROT_EXPORT
+INTVAL Parrot_io_close_piohandle(PARROT_INTERP, PIOHANDLE handle)
+ __attribute__nonnull__(1);
+
+PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL Parrot_io_eof(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
@@ -229,10 +233,9 @@
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_io_open(PARROT_INTERP,
ARGIN_NULLOK(PMC *pmc),
- ARGIN(STRING *path),
+ ARGIN_NULLOK(STRING *path),
ARGIN_NULLOK(STRING *mode))
- __attribute__nonnull__(1)
- __attribute__nonnull__(3);
+ __attribute__nonnull__(1);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
@@ -352,6 +355,8 @@
#define ASSERT_ARGS_Parrot_io_close __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc)
+#define ASSERT_ARGS_Parrot_io_close_piohandle __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_io_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc)
@@ -380,8 +385,7 @@
#define ASSERT_ARGS_Parrot_io_new_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_io_open __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(path)
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_io_peek __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc) \
Modified: branches/pmc_i_ops/include/parrot/io_portable.h
==============================================================================
--- branches/pmc_i_ops/include/parrot/io_portable.h Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/include/parrot/io_portable.h Tue Jun 9 22:26:30 2009 (r39482)
@@ -16,6 +16,8 @@
typedef FILE* PIOHANDLE;
typedef long PIOOFF_T;
+#define PIO_INVALID_HANDLE NULL
+
/* HEADERIZER BEGIN: src/io/portable.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Modified: branches/pmc_i_ops/include/parrot/io_unix.h
==============================================================================
--- branches/pmc_i_ops/include/parrot/io_unix.h Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/include/parrot/io_unix.h Tue Jun 9 22:26:30 2009 (r39482)
@@ -18,6 +18,8 @@
typedef INTVAL PIOHANDLE;
typedef off_t PIOOFF_T;
+#define PIO_INVALID_HANDLE -1
+
/* HEADERIZER BEGIN: src/io/unix.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
@@ -28,6 +30,7 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*filehandle);
+INTVAL Parrot_io_close_piohandle_unix(SHIM_INTERP, PIOHANDLE handle);
INTVAL Parrot_io_close_unix(PARROT_INTERP, ARGMOD(PMC *filehandle))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -82,6 +85,16 @@
SHIM(STRING **buf))
__attribute__nonnull__(1);
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+INTVAL Parrot_io_pipe_unix(SHIM_INTERP,
+ ARGMOD(PIOHANDLE *reader),
+ ARGMOD(PIOHANDLE *writer))
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(*reader)
+ FUNC_MODIFIES(*writer);
+
size_t Parrot_io_read_unix(PARROT_INTERP,
ARGMOD(PMC *filehandle),
ARGIN(STRING **buf))
@@ -114,6 +127,8 @@
#define ASSERT_ARGS_Parrot_io_async_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(filehandle)
+#define ASSERT_ARGS_Parrot_io_close_piohandle_unix \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
#define ASSERT_ARGS_Parrot_io_close_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(filehandle)
@@ -138,6 +153,9 @@
|| PARROT_ASSERT_ARG(path)
#define ASSERT_ARGS_Parrot_io_peek_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_io_pipe_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(reader) \
+ || PARROT_ASSERT_ARG(writer)
#define ASSERT_ARGS_Parrot_io_read_unix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(filehandle) \
@@ -269,6 +287,7 @@
#define PIO_OPEN_PIPE(interp, pmc, file, flags) \
Parrot_io_open_pipe_unix((interp), (pmc), (file), (flags))
#define PIO_CLOSE(interp, pmc) Parrot_io_close_unix((interp), (pmc))
+#define PIO_CLOSE_PIOHANDLE(interp, handle) Parrot_io_close_piohandle_unix((interp), (handle))
#define PIO_IS_CLOSED(interp, pmc) Parrot_io_is_closed_unix((interp), (pmc))
#define PIO_READ(interp, pmc, buf) Parrot_io_read_unix((interp), (pmc), (buf))
#define PIO_WRITE(interp, pmc, str) Parrot_io_write_unix((interp), (pmc), (str))
@@ -281,6 +300,8 @@
#define PIO_POLL(interp, pmc, which, sec, usec) \
Parrot_io_poll_unix((interp), (pmc), (which), (sec), (usec))
+#define PIO_PIPE(interp, reader, writer) \
+ Parrot_io_pipe_unix((interp), (reader), (writer))
#define PIO_SOCKET(interp, socket, fam, type, proto) \
Parrot_io_socket_unix((interp), (socket), (fam), (type), (proto))
#define PIO_RECV(interp, pmc, buf) \
Modified: branches/pmc_i_ops/include/parrot/io_win32.h
==============================================================================
--- branches/pmc_i_ops/include/parrot/io_win32.h Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/include/parrot/io_win32.h Tue Jun 9 22:26:30 2009 (r39482)
@@ -16,9 +16,14 @@
typedef Parrot_WIN32_HANDLE PIOHANDLE;
typedef Parrot_OFF_T PIOOFF_T;
+#define PIO_INVALID_HANDLE INVALID_HANDLE_VALUE
+
/* HEADERIZER BEGIN: src/io/win32.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+INTVAL Parrot_io_close_piohandle_win32(PARROT_INTERP, PIOHANDLE handle)
+ __attribute__nonnull__(1);
+
INTVAL Parrot_io_close_win32(PARROT_INTERP, ARGMOD(PMC *filehandle))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -72,6 +77,16 @@
SHIM(STRING **buf))
__attribute__nonnull__(1);
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+INTVAL Parrot_io_pipe_win32(SHIM_INTERP,
+ ARGMOD(PIOHANDLE *reader),
+ ARGMOD(PIOHANDLE *writer))
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(*reader)
+ FUNC_MODIFIES(*writer);
+
size_t Parrot_io_read_win32(PARROT_INTERP,
ARGMOD(PMC *filehandle),
ARGOUT(STRING **buf))
@@ -100,6 +115,9 @@
__attribute__nonnull__(2)
__attribute__nonnull__(3);
+#define ASSERT_ARGS_Parrot_io_close_piohandle_win32 \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_io_close_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(filehandle)
@@ -124,6 +142,9 @@
|| PARROT_ASSERT_ARG(path)
#define ASSERT_ARGS_Parrot_io_peek_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_io_pipe_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(reader) \
+ || PARROT_ASSERT_ARG(writer)
#define ASSERT_ARGS_Parrot_io_read_win32 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(filehandle) \
@@ -251,6 +272,7 @@
#define PIO_OPEN_PIPE(interp, pmc, file, flags) \
Parrot_io_open_pipe_win32((interp), (pmc), (file), (flags))
#define PIO_CLOSE(interp, pmc) Parrot_io_close_win32((interp), (pmc))
+#define PIO_CLOSE_PIOHANDLE(interp, handle) Parrot_io_close_piohandle_win32((interp), (handle))
#define PIO_IS_CLOSED(interp, pmc) Parrot_io_is_closed_win32((interp), (pmc))
#define PIO_READ(interp, pmc, buf) Parrot_io_read_win32((interp), (pmc), (buf))
#define PIO_WRITE(interp, pmc, str) Parrot_io_write_win32((interp), (pmc), (str))
@@ -263,6 +285,8 @@
#define PIO_POLL(interp, pmc, which, sec, usec) \
Parrot_io_poll_win32((interp), (pmc), (which), (sec), (usec))
+#define PIO_PIPE(interp, reader, writer) \
+ Parrot_io_pipe_win32((interp), (reader), (writer))
#define PIO_SOCKET(interp, socket, fam, type, proto) \
Parrot_io_socket_win32((interp), (socket), (fam), (type), (proto))
#define PIO_RECV(interp, pmc, buf) \
Modified: branches/pmc_i_ops/include/parrot/library.h
==============================================================================
--- branches/pmc_i_ops/include/parrot/library.h Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/include/parrot/library.h Tue Jun 9 22:26:30 2009 (r39482)
@@ -39,20 +39,6 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
PARROT_EXPORT
-void Parrot_add_library_path(PARROT_INTERP,
- ARGIN(STRING *path),
- enum_lib_paths which)
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
-void Parrot_add_library_path_from_cstring(PARROT_INTERP,
- ARGIN(const char *path),
- enum_lib_paths which)
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING * Parrot_get_runtime_path(PARROT_INTERP)
__attribute__nonnull__(1);
@@ -64,6 +50,20 @@
__attribute__nonnull__(1);
PARROT_EXPORT
+void Parrot_lib_add_path(PARROT_INTERP,
+ ARGIN(STRING *path_str),
+ enum_lib_paths which)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_EXPORT
+void Parrot_lib_add_path_from_cstring(PARROT_INTERP,
+ ARGIN(const char *path),
+ enum_lib_paths which)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
PARROT_MALLOC
@@ -100,17 +100,17 @@
FUNC_MODIFIES(*wo_ext)
FUNC_MODIFIES(*ext);
-#define ASSERT_ARGS_Parrot_add_library_path __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(path)
-#define ASSERT_ARGS_Parrot_add_library_path_from_cstring \
- __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(path)
#define ASSERT_ARGS_Parrot_get_runtime_path __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_get_runtime_prefix __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_lib_add_path __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(path_str)
+#define ASSERT_ARGS_Parrot_lib_add_path_from_cstring \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(path)
#define ASSERT_ARGS_Parrot_locate_runtime_file __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(file_name)
Modified: branches/pmc_i_ops/include/parrot/runcore_api.h
==============================================================================
--- branches/pmc_i_ops/include/parrot/runcore_api.h Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/include/parrot/runcore_api.h Tue Jun 9 22:26:30 2009 (r39482)
@@ -25,14 +25,17 @@
void enable_event_checking(PARROT_INTERP)
__attribute__nonnull__(1);
-void do_prederef(void **pc_prederef, PARROT_INTERP, int type)
+void do_prederef(ARGIN(void **pc_prederef), PARROT_INTERP, int type)
+ __attribute__nonnull__(1)
__attribute__nonnull__(2);
-void dynop_register(PARROT_INTERP, PMC *lib_pmc)
- __attribute__nonnull__(1);
+void dynop_register(PARROT_INTERP, ARGIN(PMC *lib_pmc))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
-void exec_init_prederef(PARROT_INTERP, void *prederef_arena)
- __attribute__nonnull__(1);
+void exec_init_prederef(PARROT_INTERP, ARGIN(void *prederef_arena))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
@@ -56,11 +59,14 @@
#define ASSERT_ARGS_enable_event_checking __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_do_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
+ PARROT_ASSERT_ARG(pc_prederef) \
+ || PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_dynop_register __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(lib_pmc)
#define ASSERT_ARGS_exec_init_prederef __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(prederef_arena)
#define ASSERT_ARGS_init_jit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_runcore_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/pmc_i_ops/lib/Parrot/Install.pm
==============================================================================
--- branches/pmc_i_ops/lib/Parrot/Install.pm Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/lib/Parrot/Install.pm Tue Jun 9 22:26:30 2009 (r39482)
@@ -5,7 +5,7 @@
use warnings;
use File::Basename qw(dirname);
use File::Copy;
-use File::Path; # mkpath
+use File::Path qw( mkpath );
use File::Spec;
use base qw( Exporter );
our @EXPORT_OK = qw(
@@ -175,9 +175,11 @@
sub create_directories {
my($destdir, $directories) = @_;
- mkpath([
- grep { ! -d } map { $destdir . $_ } keys %$directories
- ],0,0777);
+ my @dirs_created = mkpath(
+ ( grep { ! -d } map { $destdir . $_ } keys %$directories ),
+ { mode => 0777 },
+ );
+ return 1;
}
=head2 C<install_files()>
Modified: branches/pmc_i_ops/lib/Parrot/Ops2pm.pm
==============================================================================
--- branches/pmc_i_ops/lib/Parrot/Ops2pm.pm Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/lib/Parrot/Ops2pm.pm Tue Jun 9 22:26:30 2009 (r39482)
@@ -323,7 +323,7 @@
my $cwd = cwd();
my $fulldir = File::Spec->catdir( $cwd, $self->{moddir} );
if ( !-d $fulldir ) {
- if ( !File::Path::mkpath( $fulldir, 0, 0755 ) ) {
+ if ( !File::Path::mkpath( $fulldir, { mode => 0755 } ) ) {
-d $fulldir
or die "$self->{script}: Could not mkdir $fulldir: $!!\n";
}
@@ -412,7 +412,7 @@
my $cwd = cwd();
my $fulldir = File::Spec->catdir( $cwd, $self->{inc_dir} );
if ( !-d $fulldir ) {
- if ( !File::Path::mkpath( $fulldir, 0, 0755 ) ) {
+ if ( !File::Path::mkpath( $fulldir, { mode => 0755 } ) ) {
-d $fulldir
or die "$self->{script}: Could not mkdir $fulldir: $!!\n";
}
Modified: branches/pmc_i_ops/runtime/parrot/languages/parrot/parrot.pir
==============================================================================
--- branches/pmc_i_ops/runtime/parrot/languages/parrot/parrot.pir Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/runtime/parrot/languages/parrot/parrot.pir Tue Jun 9 22:26:30 2009 (r39482)
@@ -61,6 +61,46 @@
ns.'export_to'(exportns, syms)
.end
+.sub 'import' :method :multi(_,_)
+ .param pmc library
+ .local pmc i, targetns
+ i = getinterp
+ targetns = i['namespace';1]
+ .tailcall self.'import'('parrot',library,'targetns'=>targetns)
+.end
+
+.sub 'import' :method :multi(_,_,_)
+ .param string lang
+ .param pmc library
+ .param pmc targetns :named('targetns') :optional
+ .local pmc name, compiler, library, imports
+ $S0 = library
+ name = split '::', $S0
+ compiler = compreg lang
+ unless null targetns goto has_targetns
+ $P0 = getinterp
+ targetns = $P0['namespace';1]
+ has_targetns:
+ library = compiler.'load_library'(name)
+ imports = library['symbols']
+ imports = imports['DEFAULT']
+ .local pmc ns_iter, item
+ ns_iter = iter imports
+ import_loop:
+ unless ns_iter goto import_loop_end
+ $S0 = shift ns_iter
+ $P0 = imports[$S0]
+ targetns[$S0] = $P0
+ goto import_loop
+ import_loop_end:
+ #foreignlibns = library['namespace']
+ #if null foreignlibns goto no_foreign_ns
+ #$S0 = pop name
+ #set_hll_global name, $S0, foreignlibns
+ #no_foreign_ns:
+ .return (library)
+.end
+
# TODO Should this provide support for loading HLL libraries?
=head1 NAME
Modified: branches/pmc_i_ops/src/embed.c
==============================================================================
--- branches/pmc_i_ops/src/embed.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/embed.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -106,6 +106,7 @@
return make_interpreter(parent, PARROT_NO_FLAGS);
}
+
/*
=item C<void Parrot_init_stacktop(PARROT_INTERP, void *stack_top)>
@@ -388,17 +389,17 @@
PackFile *
Parrot_pbc_read(PARROT_INTERP, ARGIN_NULLOK(const char *fullname), const int debug)
{
+ PackFile *pf;
+ char *program_code;
FILE *io = NULL;
INTVAL is_mapped = 0;
- char *program_code;
- PackFile *pf;
INTVAL program_size;
#ifdef PARROT_HAS_HEADER_SYSMMAN
int fd = -1;
#endif
- if (fullname == NULL || STREQ(fullname, "-")) {
+ if (!fullname || STREQ(fullname, "-")) {
/* read from STDIN */
io = stdin;
@@ -418,8 +419,9 @@
/* we may need to relax this if we want to read bytecode from pipes */
if (!Parrot_stat_info_intval(interp, fs, STAT_ISREG)) {
- Parrot_io_eprintf(interp, "Parrot VM: '%s', is not a regular file %i.\n",
- fullname, errno);
+ Parrot_io_eprintf(interp,
+ "Parrot VM: '%s', is not a regular file %i.\n",
+ fullname, errno);
return NULL;
}
@@ -446,17 +448,18 @@
INTVAL wanted = program_size;
size_t read_result;
- program_code = (char *)mem_sys_allocate(chunk_size);
+ program_code = mem_allocate_n_typed(chunk_size, char);
+ cursor = program_code;
program_size = 0;
- cursor = (char *)program_code;
while ((read_result = fread(cursor, 1, chunk_size, io)) > 0) {
program_size += read_result;
+
if (program_size == wanted)
break;
+
chunk_size = 1024;
- program_code =
- (char *)mem_sys_realloc(program_code, program_size + chunk_size);
+ mem_realloc_n_typed(program_code, program_size + chunk_size, char);
if (!program_code) {
Parrot_io_eprintf(interp,
@@ -466,15 +469,17 @@
return NULL;
}
- cursor = (char *)program_code + program_size;
+ cursor = (char *)(program_code + program_size);
}
if (ferror(io)) {
- Parrot_io_eprintf(interp, "Parrot VM: Problem reading packfile from PIO: code %d.\n",
+ Parrot_io_eprintf(interp,
+ "Parrot VM: Problem reading packfile from PIO: code %d.\n",
ferror(io));
mem_sys_free(program_code);
return NULL;
}
+
fclose(io);
}
else {
@@ -507,12 +512,13 @@
/* try again, now with IO reading the file */
io = fopen(fullname, "rb");
if (!io) {
- Parrot_io_eprintf(interp, "Parrot VM: Can't open %s, code %i.\n",
- fullname, errno);
+ Parrot_io_eprintf(interp,
+ "Parrot VM: Can't open %s, code %i.\n", fullname, errno);
return NULL;
}
goto again;
}
+
is_mapped = 1;
#else /* PARROT_HAS_HEADER_SYSMMAN */
@@ -539,8 +545,8 @@
return NULL;
}
+ /* Set :main routine */
if (!(pf->options & PFOPT_HEADERONLY))
- /* Set :main routine */
do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
/* JITting and/or prederefing the sub/the bytecode is done
@@ -573,7 +579,7 @@
void
Parrot_pbc_load(PARROT_INTERP, NOTNULL(PackFile *pf))
{
- if (pf == NULL) {
+ if (!pf) {
Parrot_io_eprintf(interp, "Invalid packfile\n");
return;
}
@@ -582,6 +588,7 @@
interp->code = pf->cur_cs;
}
+
/*
=item C<void Parrot_pbc_fixup_loaded(PARROT_INTERP)>
@@ -599,6 +606,7 @@
PackFile_fixup_subs(interp, PBC_LOADED, NULL);
}
+
/*
=item C<static PMC* setup_argv(PARROT_INTERP, int argc, char **argv)>
@@ -614,9 +622,8 @@
setup_argv(PARROT_INTERP, int argc, ARGIN(char **argv))
{
ASSERT_ARGS(setup_argv)
+ PMC *userargv = pmc_new(interp, enum_class_ResizableStringArray);
INTVAL i;
- PMC *userargv;
-
if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
Parrot_io_eprintf(interp,
@@ -624,14 +631,10 @@
argc);
}
- userargv = pmc_new_noinit(interp, enum_class_ResizableStringArray);
-
/* immediately anchor pmc to root set */
VTABLE_set_pmc_keyed_int(interp, interp->iglobals,
(INTVAL)IGLOBALS_ARGV_LIST, userargv);
- VTABLE_init(interp, userargv);
-
for (i = 0; i < argc; i++) {
/* Run through argv, adding everything to @ARGS. */
STRING * const arg =
@@ -726,10 +729,10 @@
calibrate(PARROT_INTERP)
{
ASSERT_ARGS(calibrate)
- size_t count = 1000000;
- size_t n = count;
opcode_t code[] = { 1 }; /* noop */
opcode_t *pc = code;
+ size_t count = 1000000;
+ size_t n = count;
FLOATVAL start = Parrot_floatval_time();
FLOATVAL now = start;
@@ -869,7 +872,6 @@
set_current_sub(PARROT_INTERP)
{
ASSERT_ARGS(set_current_sub)
- opcode_t i;
Parrot_sub *sub_pmc_sub;
PMC *sub_pmc;
@@ -877,6 +879,8 @@
PackFile_FixupTable * const ft = cur_cs->fixups;
PackFile_ConstTable * const ct = cur_cs->const_table;
+ opcode_t i;
+
/*
* Walk the fixup table. The first Sub-like entry should be our
* entry point with the address at our resume_offset.
@@ -903,7 +907,7 @@
}
}
- /* if we didn't find anything put a dummy PMC into current_sub */
+ /* if we didn't find anything, put a dummy PMC into current_sub */
sub_pmc = pmc_new(interp, enum_class_Sub);
PMC_get_sub(interp, sub_pmc, sub_pmc_sub);
@@ -971,7 +975,8 @@
Parrot_io_eprintf(interp, "EXEC core");
break;
default:
- Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown run core");
+ Parrot_ex_throw_from_c_args(interp, NULL, 1,
+ "Unknown run core");
}
Parrot_io_eprintf(interp, " ***\n");
@@ -1051,11 +1056,12 @@
return NULL;
}
+
/*
=item C<static void print_constant_table(PARROT_INTERP)>
-Print the contents of the constants table.
+Prints the contents of the constants table.
=cut
@@ -1087,17 +1093,20 @@
break;
case PFC_PMC: {
Parrot_io_printf(interp, "PMC_CONST(%d): ", i);
+
switch (c->u.key->vtable->base_type) {
- /* each PBC file has a ParrotInterpreter, but it can't stringify by itself */
+ /* each PBC file has a ParrotInterpreter, but it can't
+ * stringify by itself */
case enum_class_ParrotInterpreter:
Parrot_io_printf(interp, "'ParrotInterpreter'");
break;
- /* FixedIntegerArrays are used for signatures, handy to print */
+ /* FixedIntegerArrays used for signatures, handy to print */
case enum_class_FixedIntegerArray: {
INTVAL n = VTABLE_elements(interp, c->u.key);
INTVAL i;
Parrot_io_printf(interp, "[");
+
for (i = 0; i < n; ++i) {
INTVAL val = VTABLE_get_integer_keyed_int(interp, c->u.key, i);
Parrot_io_printf(interp, "%d", val);
@@ -1237,9 +1246,8 @@
=item C<void Parrot_run_native(PARROT_INTERP, native_func_t func)>
-Run the C function C<func> through the program C<[enternative, end]>.
-This ensures that the function is run with the same setup as in other
-run loops.
+Runs the C function C<func> through the program C<[enternative, end]>. This
+ensures that the function runs with the same setup as in other run loops.
This function is used in some of the source tests in F<t/src> which use
the interpreter outside a runloop.
@@ -1273,12 +1281,13 @@
runops(interp, interp->resume_offset);
}
+
/*
=item C<Parrot_PMC Parrot_compile_string(PARROT_INTERP, Parrot_String type,
const char *code, Parrot_String *error)>
-Compile code string.
+Compiles a code string.
=cut
@@ -1289,16 +1298,14 @@
Parrot_compile_string(PARROT_INTERP, Parrot_String type,
const char *code, Parrot_String *error)
{
+ /* For the benefit of embedders that do not load any pbc
+ * before compiling a string */
- /* For the benefit of embedders that does not load any pbc
- * before compiling a string
- */
- if (! interp->initial_pf) {
+ if (!interp->initial_pf) {
PackFile *pf = PackFile_new_dummy(interp, "compile_string");
/* Assumption: there is no valid reason to fail to create it.
- * If the assumption changes, replace the assertio with a
- * runtime check
- */
+ * If the assumption changes, replace the assertion with a
+ * runtime check */
PARROT_ASSERT(interp->initial_pf);
}
@@ -1312,6 +1319,7 @@
return NULL;
}
+
/*
=back
Modified: branches/pmc_i_ops/src/gc/alloc_register.c
==============================================================================
--- branches/pmc_i_ops/src/gc/alloc_register.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/gc/alloc_register.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -181,6 +181,7 @@
mem_sys_free(ptr);
ptr = next;
}
+ interp->ctx_mem.free_list[slot] = NULL;
}
mem_sys_free(interp->ctx_mem.free_list);
}
Modified: branches/pmc_i_ops/src/hash.c
==============================================================================
--- branches/pmc_i_ops/src/hash.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/hash.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -33,7 +33,7 @@
/* the number of entries above which it's faster to hash the hashval instead of
* looping over the used HashBuckets directly */
#define SMALL_HASH_SIZE 4
-#define INITIAL_BUCKETS 16
+#define INITIAL_BUCKETS 4
/* HEADERIZER HFILE: include/parrot/hash.h */
Modified: branches/pmc_i_ops/src/io/api.c
==============================================================================
--- branches/pmc_i_ops/src/io/api.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/io/api.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -19,6 +19,10 @@
The C<FileHandle> PMC provides the class-based interface for filehandles that
is used in Parrot ops.
+TODO: Where possible, extract some of the filehandle-related details into
+src/io/filehandle.c, and extract the stringhandle details into
+src/io/io_string.c.
+
=cut
*/
@@ -26,6 +30,8 @@
#include "parrot/parrot.h"
#include "io_private.h"
#include "api.str"
+#include "../pmc/pmc_filehandle.h"
+#include "../pmc/pmc_stringhandle.h"
#include <stdarg.h>
@@ -111,20 +117,42 @@
PARROT_CANNOT_RETURN_NULL
PMC *
Parrot_io_open(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc),
- ARGIN(STRING *path), ARGIN_NULLOK(STRING *mode))
+ ARGIN_NULLOK(STRING *path), ARGIN_NULLOK(STRING *mode))
{
ASSERT_ARGS(Parrot_io_open)
- PMC *new_filehandle;
-
- if (PMC_IS_NULL(pmc))
+ PMC *new_filehandle, *filehandle;
+ INTVAL flags;
+ if (PMC_IS_NULL(pmc)) {
+ /* TODO: We should look up the HLL mapped type, instead of always
+ using FileHandle here */
new_filehandle = pmc_new(interp, enum_class_FileHandle);
+ PARROT_ASSERT(new_filehandle->vtable->base_type == enum_class_FileHandle);
+ }
else
new_filehandle = pmc;
- Parrot_PCCINVOKE(interp, new_filehandle, CONST_STRING(interp, "open"), "SS->P",
- path, mode, &new_filehandle);
-
- return new_filehandle;
+ flags = Parrot_io_parse_open_flags(interp, mode);
+ if (new_filehandle->vtable->base_type == enum_class_FileHandle) {
+ /* TODO: StringHandle may have a null path, but a filehandle really
+ shouldn't allow that. */
+ PARROT_ASSERT(new_filehandle->vtable->base_type == enum_class_FileHandle);
+ filehandle = PIO_OPEN(interp, new_filehandle, path, flags);
+ if (PMC_IS_NULL(filehandle))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ "Unable to open filehandle from path '%S'", path);
+ PARROT_ASSERT(filehandle->vtable->base_type == enum_class_FileHandle);
+ SETATTR_FileHandle_flags(interp, new_filehandle, flags);
+ SETATTR_FileHandle_filename(interp, new_filehandle, path);
+ SETATTR_FileHandle_mode(interp, new_filehandle, mode);
+ Parrot_io_setbuf(interp, filehandle, PIO_UNBOUND);
+ }
+ else if (new_filehandle->vtable->base_type == enum_class_StringHandle) {
+ SETATTR_StringHandle_flags(interp, pmc, flags);
+ filehandle = pmc;
+ }
+ else
+ Parrot_PCCINVOKE(interp, new_filehandle, CONST_STRING(interp, "read"), "SS->P", path, mode, &open);
+ return filehandle;
}
/*
@@ -187,16 +215,45 @@
Parrot_io_close(PARROT_INTERP, ARGMOD(PMC *pmc))
{
ASSERT_ARGS(Parrot_io_close)
- INTVAL result;
+ INTVAL result = 1;
if (PMC_IS_NULL(pmc))
return -1;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "close"), "->I", &result);
+ if (pmc->vtable->base_type == enum_class_FileHandle) {
+ result = Parrot_io_close_filehandle(interp, pmc);
+ SETATTR_FileHandle_flags(interp, pmc, 0);
+ }
+ else if (pmc->vtable->base_type == enum_class_StringHandle) {
+ SETATTR_StringHandle_read_offset(interp, pmc, 0);
+ }
+ else
+ Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "close"), "->I", &result);
return result;
}
+
+/*
+
+=item C<INTVAL Parrot_io_close_piohandle(PARROT_INTERP, PIOHANDLE handle)>
+
+Calls close() on the given PIOHANDLE. This is the low level OS-specific close()
+function, intended to be called directly by PMC destroy() vtables.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+INTVAL
+Parrot_io_close_piohandle(PARROT_INTERP, PIOHANDLE handle)
+{
+ ASSERT_ARGS(Parrot_io_close_piohandle)
+ return PIO_CLOSE_PIOHANDLE(interp, handle);
+}
+
+
/*
=item C<INTVAL Parrot_io_is_closed(PARROT_INTERP, PMC *pmc)>
@@ -214,12 +271,20 @@
Parrot_io_is_closed(PARROT_INTERP, ARGMOD(PMC *pmc))
{
ASSERT_ARGS(Parrot_io_is_closed)
- INTVAL result;
+ INTVAL result = 1;
if (PMC_IS_NULL(pmc))
return 1;
+ if (pmc->vtable->base_type == enum_class_FileHandle)
+ result = Parrot_io_is_closed_filehandle(interp, pmc);
+ else if (pmc->vtable->base_type == enum_class_StringHandle) {
+ STRING *stringhandle;
+ GETATTR_StringHandle_stringhandle(interp, pmc, stringhandle);
+ result = STRING_IS_NULL(stringhandle);
+ }
+ else
+ Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "is_closed"), "->I", &result);
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "is_closed"), "->I", &result);
return result;
}
@@ -242,7 +307,13 @@
if (PMC_IS_NULL(pmc))
return;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "flush"), "->");
+ if (pmc->vtable->base_type == enum_class_FileHandle)
+ Parrot_io_flush_filehandle(interp, pmc);
+ else if (pmc->vtable->base_type == enum_class_StringHandle) {
+ SETATTR_StringHandle_stringhandle(interp, pmc, NULL);
+ }
+ else
+ Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "flush"), "->");
}
/*
@@ -264,9 +335,57 @@
Parrot_io_reads(PARROT_INTERP, ARGMOD(PMC *pmc), size_t length)
{
ASSERT_ARGS(Parrot_io_reads)
- STRING *result;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "read"), "I->S",
- length, &result);
+ STRING *result = NULL;
+ if (PMC_IS_NULL(pmc))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ "Attempt to read from null or invalid PMC");
+ if (pmc->vtable->base_type == enum_class_FileHandle) {
+ INTVAL ignored;
+ INTVAL flags;
+ GETATTR_FileHandle_flags(interp, pmc, flags);
+
+ if (Parrot_io_is_closed_filehandle(interp, pmc)
+ || !(flags & PIO_F_READ))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ "Cannot read from a closed or non-readable filehandle");
+
+ result = Parrot_io_make_string(interp, &result, length);
+ result->bufused = length;
+
+ if (Parrot_io_is_encoding(interp, pmc, CONST_STRING(interp, "utf8")))
+ ignored = Parrot_io_read_utf8(interp, pmc, &result);
+ else
+ ignored = Parrot_io_read_buffer(interp, pmc, &result);
+ }
+ else if (pmc->vtable->base_type == enum_class_StringHandle) {
+ STRING *string_orig;
+ INTVAL offset;
+ /* TODO: Check that we are open for reading */
+ GETATTR_StringHandle_stringhandle(interp, pmc, string_orig);
+ if (STRING_IS_NULL(string_orig))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ "Cannot read from a closed filehandle");
+
+ if (length == 0)
+ result = Parrot_str_copy(interp, string_orig);
+ else {
+ INTVAL orig_length, read_length;
+ read_length = length;
+ orig_length = Parrot_str_byte_length(interp, string_orig);
+
+ GETATTR_StringHandle_read_offset(interp, pmc, offset);
+
+ /* Only read to the end of the string data. */
+ if (offset + read_length > orig_length)
+ read_length = orig_length - offset;
+
+ result = Parrot_str_substr(interp, string_orig, offset,
+ read_length, NULL, 0);
+ SETATTR_StringHandle_read_offset(interp, pmc, offset + read_length);
+ }
+ }
+ else
+ Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "read"), "I->S", length, &result);
return result;
}
@@ -290,8 +409,41 @@
{
ASSERT_ARGS(Parrot_io_readline)
STRING *result;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "readline"), "->S",
- &result);
+ if (pmc->vtable->base_type == enum_class_FileHandle) {
+ INTVAL flags;
+ if (Parrot_io_is_closed_filehandle(interp, pmc))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ "Cannot read from a closed filehandle");
+ GETATTR_FileHandle_flags(interp, pmc, flags);
+ if (!(flags & PIO_F_LINEBUF))
+ Parrot_io_setlinebuf(interp, pmc);
+
+ result = Parrot_io_reads(interp, pmc, 0);
+ }
+ else if (pmc->vtable->base_type == enum_class_StringHandle) {
+ INTVAL offset, newline_pos, read_length, orig_length;
+
+ GETATTR_StringHandle_stringhandle(interp, pmc, result);
+ if (STRING_IS_NULL(result))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ "Cannot read from a closed stringhandle");
+
+ orig_length = Parrot_str_byte_length(interp, result);
+ GETATTR_StringHandle_read_offset(interp, pmc, offset);
+ newline_pos = Parrot_str_find_index(interp, result, CONST_STRING(interp, "\n"), offset);
+
+ /* No newline found, read the rest of the string. */
+ if (newline_pos == -1)
+ read_length = orig_length - offset;
+ else
+ read_length = newline_pos - offset + 1; /* +1 to include the newline */
+
+ result = Parrot_str_substr(interp, result, offset,
+ read_length, NULL, 0);
+ SETATTR_StringHandle_read_offset(interp, pmc, newline_pos + 1);
+ }
+ else
+ Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "readline"), "->S", &result);
return result;
}
@@ -416,19 +568,24 @@
Parrot_io_eof(PARROT_INTERP, ARGMOD(PMC *pmc))
{
ASSERT_ARGS(Parrot_io_eof)
- INTVAL result;
+ INTVAL flags, result;
/* io could be null here, but rather than return a negative error
* we just fake EOF since eof test is usually in a boolean context.
*/
if (PMC_IS_NULL(pmc))
+ return 1;
+ if (pmc->vtable->base_type == enum_class_FileHandle) {
+ if (Parrot_io_is_closed_filehandle(interp, pmc))
return 1;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "eof"), "->I",
- &result);
-
+ GETATTR_FileHandle_flags(interp, pmc, flags);
+ if (flags & PIO_F_EOF)
+ return 1;
+ return 0;
+ }
+ Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "eof"), "->I", &result);
return result;
-
}
/*
@@ -470,9 +627,23 @@
if (PMC_IS_NULL(pmc))
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
"Cannot write to null PMC");
+ if (pmc->vtable->base_type == enum_class_FileHandle) {
+ INTVAL flags;
+ GETATTR_FileHandle_flags(interp, pmc, flags);
+
+ if (!(flags & PIO_F_WRITE))
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
+ "FileHandle is not opened for writing");
+ if (STRING_IS_NULL(s))
+ return 0;
+ if (Parrot_io_is_encoding(interp, pmc, CONST_STRING(interp, "utf8")))
+ result = Parrot_io_write_utf8(interp, pmc, s);
+ else
+ result = Parrot_io_write_buffer(interp, pmc, s);
+ }
+ else
+ Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "puts"), "S->I", s, &result);
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "puts"), "S->I",
- s, &result);
return result;
}
Modified: branches/pmc_i_ops/src/io/buffer.c
==============================================================================
--- branches/pmc_i_ops/src/io/buffer.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/io/buffer.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -79,7 +79,7 @@
/* If there is already a buffer, make sure we flush before modifying it. */
if (buffer_start)
- Parrot_io_flush(interp, filehandle);
+ Parrot_io_flush_buffer(interp, filehandle);
/* Choose an appropriate buffer size for caller */
switch (bufsize) {
@@ -286,7 +286,7 @@
/* write buffer flush */
if (buffer_flags & PIO_BF_WRITEBUF) {
- Parrot_io_flush(interp, filehandle);
+ Parrot_io_flush_buffer(interp, filehandle);
buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
}
@@ -416,7 +416,7 @@
/* write buffer flush */
if (buffer_flags & PIO_BF_WRITEBUF) {
- Parrot_io_flush(interp, filehandle);
+ Parrot_io_flush_buffer(interp, filehandle);
buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
}
@@ -623,7 +623,7 @@
long wrote;
/* Write through, skip buffer. */
- Parrot_io_flush(interp, filehandle);
+ Parrot_io_flush_buffer(interp, filehandle);
wrote = PIO_WRITE(interp, filehandle, s);
if (wrote == (long)len) {
@@ -658,7 +658,7 @@
Parrot_io_set_buffer_next(interp, filehandle, buffer_next);
Parrot_io_set_file_position(interp, filehandle, (avail +
Parrot_io_get_file_position(interp, filehandle)));
- Parrot_io_flush(interp, filehandle);
+ Parrot_io_flush_buffer(interp, filehandle);
buffer_flags |= PIO_BF_WRITEBUF;
Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
@@ -718,7 +718,7 @@
if ((newpos < file_pos - (buffer_next - buffer_start))
|| (newpos >= file_pos + (buffer_end - buffer_next))) {
- Parrot_io_flush(interp, filehandle);
+ Parrot_io_flush_buffer(interp, filehandle);
newpos = PIO_SEEK(interp, filehandle, newpos, SEEK_SET);
}
else {
Modified: branches/pmc_i_ops/src/io/unix.c
==============================================================================
--- branches/pmc_i_ops/src/io/unix.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/io/unix.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -35,6 +35,7 @@
# include <sys/types.h>
# include <sys/wait.h>
+# include <unistd.h> /* for pipe() */
/* HEADERIZER HFILE: include/parrot/io_unix.h */
@@ -357,6 +358,24 @@
return result;
}
+
+/*
+
+=item C<INTVAL Parrot_io_close_piohandle_unix(PARROT_INTERP, PIOHANDLE handle)>
+
+Closes the given file descriptor. Returns 0 on success, -1 on error.
+
+=cut
+
+*/
+
+INTVAL
+Parrot_io_close_piohandle_unix(SHIM_INTERP, PIOHANDLE handle)
+{
+ ASSERT_ARGS(Parrot_io_close_piohandle_unix)
+ return close(handle);
+}
+
/*
=item C<INTVAL Parrot_io_is_closed_unix(PARROT_INTERP, PMC *filehandle)>
@@ -767,6 +786,33 @@
}
+/*
+
+=item C<INTVAL Parrot_io_pipe_unix(PARROT_INTERP, PIOHANDLE *reader, PIOHANDLE
+*writer)>
+
+Uses C<pipe()> to create a matched pair of pipe fds. Returns 0 on success, -1
+on failure.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+INTVAL
+Parrot_io_pipe_unix(SHIM_INTERP, ARGMOD(PIOHANDLE *reader), ARGMOD(PIOHANDLE *writer))
+{
+ ASSERT_ARGS(Parrot_io_pipe_unix)
+ int fds[2], rv;
+ rv = pipe(fds);
+ if (rv >= 0) {
+ *reader = fds[0];
+ *writer = fds[1];
+ }
+ return rv;
+}
+
#endif /* PIO_OS_UNIX */
/*
Modified: branches/pmc_i_ops/src/io/win32.c
==============================================================================
--- branches/pmc_i_ops/src/io/win32.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/io/win32.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -295,6 +295,28 @@
/*
+=item C<INTVAL Parrot_io_close_piohandle_win32(PARROT_INTERP, PIOHANDLE handle)>
+
+Calls C<CloseHandle()> to close the given file descriptor. Returns 0 on
+success, -1 on error.
+
+=cut
+
+*/
+
+INTVAL
+Parrot_io_close_piohandle_win32(PARROT_INTERP, PIOHANDLE handle)
+{
+ ASSERT_ARGS(Parrot_io_close_piohandle_win32)
+
+ if (handle == INVALID_HANDLE_VALUE)
+ return -1;
+
+ return CloseHandle(handle) ? 0 : -1;
+}
+
+/*
+
=item C<INTVAL Parrot_io_close_win32(PARROT_INTERP, PMC *filehandle)>
Calls C<CloseHandle()> to close C<*io>'s file descriptor.
@@ -704,6 +726,27 @@
"pipe open error");
}
+/*
+
+=item C<INTVAL Parrot_io_pipe_win32(PARROT_INTERP, PIOHANDLE *reader, PIOHANDLE
+*writer)>
+
+Uses CreatePipe() to create a matched pair of pipe handles. Returns 0 on
+success, -1 on failure.
+
+=cut
+
+*/
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+INTVAL
+Parrot_io_pipe_win32(SHIM_INTERP, ARGMOD(PIOHANDLE *reader), ARGMOD(PIOHANDLE *writer))
+{
+ ASSERT_ARGS(Parrot_io_pipe_win32)
+ return CreatePipe(reader, writer, NULL, 0) ? 0 : -1;
+}
+
#endif /* PIO_OS_WIN32 */
/*
Modified: branches/pmc_i_ops/src/library.c
==============================================================================
--- branches/pmc_i_ops/src/library.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/library.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -594,10 +594,10 @@
/*
-=item C<void Parrot_add_library_path(PARROT_INTERP, STRING *path, enum_lib_paths
+=item C<void Parrot_lib_add_path(PARROT_INTERP, STRING *path_str, enum_lib_paths
which)>
-Add a path to the library searchpath of the given type.
+Add a path to the library searchpath of the given type (passing in a STRING).
=cut
@@ -605,41 +605,38 @@
PARROT_EXPORT
void
-Parrot_add_library_path(PARROT_INTERP,
- ARGIN(STRING *path),
+Parrot_lib_add_path(PARROT_INTERP,
+ ARGIN(STRING *path_str),
enum_lib_paths which)
{
- ASSERT_ARGS(Parrot_add_library_path)
+ ASSERT_ARGS(Parrot_lib_add_path)
PMC * const iglobals = interp->iglobals;
PMC * const lib_paths = VTABLE_get_pmc_keyed_int(interp, iglobals,
IGLOBALS_LIB_PATHS);
PMC * const paths = VTABLE_get_pmc_keyed_int(interp, lib_paths, which);
- VTABLE_push_string(interp, paths, path);
+ VTABLE_push_string(interp, paths, path_str);
}
/*
-=item C<void Parrot_add_library_path_from_cstring(PARROT_INTERP, const char
-*path, enum_lib_paths which)>
+=item C<void Parrot_lib_add_path_from_cstring(PARROT_INTERP, const char *path,
+enum_lib_paths which)>
Add a path to the library searchpath of the given type (passing in a C string).
-This function is just an interface to C<Parrot_add_library_path> for low-level
-code.
-
=cut
*/
PARROT_EXPORT
void
-Parrot_add_library_path_from_cstring(PARROT_INTERP,
+Parrot_lib_add_path_from_cstring(PARROT_INTERP,
ARGIN(const char *path),
enum_lib_paths which)
{
- ASSERT_ARGS(Parrot_add_library_path_from_cstring)
+ ASSERT_ARGS(Parrot_lib_add_path_from_cstring)
STRING * const path_str = Parrot_str_new(interp, path, 0);
- Parrot_add_library_path(interp, path_str, which);
+ Parrot_lib_add_path(interp, path_str, which);
}
/*
Modified: branches/pmc_i_ops/src/oo.c
==============================================================================
--- branches/pmc_i_ops/src/oo.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/oo.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -265,16 +265,16 @@
PARROT_CANNOT_RETURN_NULL
PMC *
-Parrot_oo_clone_object(PARROT_INTERP, ARGIN(PMC * pmc),
- ARGMOD_NULLOK(PMC * class_), ARGMOD_NULLOK(PMC * dest))
+Parrot_oo_clone_object(PARROT_INTERP, ARGIN(PMC *pmc),
+ ARGMOD_NULLOK(PMC *class_), ARGMOD_NULLOK(PMC *dest))
{
ASSERT_ARGS(Parrot_oo_clone_object)
- Parrot_Object_attributes * obj;
- Parrot_Class_attributes * _class;
- INTVAL num_classes;
- PMC * cloned;
- Parrot_Object_attributes * cloned_guts;
- INTVAL i, num_attrs;
+ Parrot_Object_attributes *obj;
+ Parrot_Object_attributes *cloned_guts;
+ Parrot_Class_attributes *_class;
+ PMC *cloned;
+ INTVAL num_classes;
+ INTVAL i, num_attrs;
if (!PMC_IS_NULL(dest)) {
PARROT_ASSERT(!PMC_IS_NULL(class_));
@@ -284,9 +284,10 @@
cloned = dest;
}
else {
- obj = PARROT_OBJECT(pmc);
+ obj = PARROT_OBJECT(pmc);
cloned = pmc_new_noinit(interp, enum_class_Object);
}
+
_class = PARROT_CLASS(obj->_class);
PARROT_ASSERT(_class);
num_classes = VTABLE_elements(interp, _class->all_parents);
@@ -299,7 +300,7 @@
PObj_is_object_SET(cloned);
/* Now create the underlying structure, and clone attributes list.class. */
- cloned_guts = mem_allocate_zeroed_typed(Parrot_Object_attributes);
+ cloned_guts = mem_allocate_typed(Parrot_Object_attributes);
PMC_data(cloned) = cloned_guts;
cloned_guts->_class = obj->_class;
cloned_guts->attrib_store = VTABLE_clone(interp, obj->attrib_store);
@@ -351,7 +352,7 @@
{
ASSERT_ARGS(Parrot_oo_new_object_attrs)
Parrot_Object_attributes * const obj_guts =
- mem_allocate_zeroed_typed(Parrot_Object_attributes);
+ mem_allocate_typed(Parrot_Object_attributes);
obj_guts->_class = class_;
obj_guts->attrib_store = pmc_new(interp, enum_class_ResizablePMCArray);
return (void *)obj_guts;
@@ -1015,8 +1016,7 @@
sizeof (Meth_cache_entry ***) * mc->mc_size);
}
else {
- mc->idx = (Meth_cache_entry ***)mem_sys_allocate_zeroed(
- sizeof (Meth_cache_entry ***) * (type + 1));
+ mc->idx = mem_allocate_n_zeroed_typed(type + 1, Meth_cache_entry**);
}
mc->mc_size = type + 1;
}
Modified: branches/pmc_i_ops/src/ops/io.ops
==============================================================================
--- branches/pmc_i_ops/src/ops/io.ops Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/ops/io.ops Tue Jun 9 22:26:30 2009 (r39482)
@@ -317,7 +317,7 @@
op print(invar PMC, in INT) :base_io {
if ($1) {
- STRING * const s = Parrot_sprintf_c(interp, INTVAL_FMT, $2);
+ STRING * const s = Parrot_str_from_int(interp, $2);
Parrot_io_putps(interp, $1, s);
}
}
Modified: branches/pmc_i_ops/src/packfile.c
==============================================================================
--- branches/pmc_i_ops/src/packfile.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/packfile.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -4696,6 +4696,12 @@
if (!pf)
Parrot_ex_throw_from_c_args(interp, NULL, 1,
"Unable to append PBC to the current directory");
+
+ mem_sys_free(pf->header);
+ pf->header = NULL;
+ mem_sys_free(pf->dirp);
+ pf->dirp = NULL;
+
}
else {
STRING *err;
@@ -4766,9 +4772,9 @@
parrot_split_path_ext(interp, path, &found_path, &found_ext);
name_length = Parrot_str_length(interp, lang_name);
found_path = Parrot_str_substr(interp, found_path, -name_length, name_length, NULL, 0);
- Parrot_add_library_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "include/")),
+ Parrot_lib_add_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "include/")),
PARROT_LIB_PATH_INCLUDE);
- Parrot_add_library_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "dynext/")),
+ Parrot_lib_add_path(interp, Parrot_str_append(interp, found_path, CONST_STRING(interp, "dynext/")),
PARROT_LIB_PATH_DYNEXT);
Modified: branches/pmc_i_ops/src/pmc.c
==============================================================================
--- branches/pmc_i_ops/src/pmc.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -196,13 +196,13 @@
PARROT_CANNOT_RETURN_NULL
PARROT_IGNORABLE_RESULT
PMC *
-pmc_reuse_by_class(PARROT_INTERP, ARGMOD(PMC * pmc), ARGIN(PMC * class_),
+pmc_reuse_by_class(PARROT_INTERP, ARGMOD(PMC *pmc), ARGIN(PMC *class_),
UINTVAL flags)
{
ASSERT_ARGS(pmc_reuse_by_class)
- const INTVAL new_type = PARROT_CLASS(class_)->id;
+ const INTVAL new_type = PARROT_CLASS(class_)->id;
VTABLE * const new_vtable = interp->vtables[new_type];
- INTVAL new_flags = flags;
+ INTVAL new_flags = flags;
if (pmc->vtable->base_type == new_type)
return pmc;
@@ -214,7 +214,8 @@
if (PObj_active_destroy_TEST(pmc))
VTABLE_destroy(interp, pmc);
- new_flags = pmc_reuse_check_pmc_ext(interp, pmc, new_flags, new_vtable->flags);
+ new_flags = pmc_reuse_check_pmc_ext(interp, pmc,
+ new_flags, new_vtable->flags);
/* we are a PMC + maybe is_PMC_EXT */
PObj_flags_SETTO(pmc, PObj_is_PMC_FLAG | new_flags);
Modified: branches/pmc_i_ops/src/pmc/codestring.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/codestring.pmc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc/codestring.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -128,7 +128,8 @@
if ('\n' != Parrot_str_indexed(INTERP, fmt, Parrot_str_byte_length(interp, fmt) - 1))
fmt = Parrot_str_concat(INTERP, fmt, newline, 0);
- S1 = Parrot_str_concat(INTERP, SELF.get_string(), fmt, 0);
+ GET_ATTR_str_val(INTERP, SELF, S1);
+ S1 = Parrot_str_concat(INTERP, S1, fmt, 0);
VTABLE_set_string_native(INTERP, SELF, S1);
RETURN(PMC *SELF);
@@ -168,17 +169,22 @@
ipos = last_pos;
}
- str = SELF.get_string();
+ GET_ATTR_str_val(INTERP, SELF, str);
jpos = Parrot_str_find_cclass(INTERP, enum_cclass_newline, str, ipos, pos);
while (jpos < pos) {
- line++;
+
+ if (ipos
+ && jpos == ipos
+ && string_ord(INTERP, str, jpos) == 10
+ && string_ord(INTERP, str, ipos - 1) == 13) {
+ /* do not increment line; \r\n is a single line separator */
+ }
+ else
+ line++;
ipos = jpos + 1;
- /* treat \r\n as a single line separator */
- ipos += (string_ord(INTERP, str, jpos) == 13
- && string_ord(INTERP, str, jpos + 1) == 10);
jpos = Parrot_str_find_cclass(INTERP, enum_cclass_newline, str, ipos, pos);
}
Modified: branches/pmc_i_ops/src/pmc/coroutine.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/coroutine.pmc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc/coroutine.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -149,7 +149,7 @@
caller_ctx = CONTEXT(interp);
ctx = Parrot_set_new_context(INTERP, co->n_regs_used);
- co->ctx = ctx;
+ co->ctx = Parrot_context_ref(interp, ctx);
co->dynamic_state = interp->dynamic_env;
ctx->caller_ctx = caller_ctx;
Modified: branches/pmc_i_ops/src/pmc/eventhandler.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/eventhandler.pmc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc/eventhandler.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2007-2008, Parrot Foundation.
+Copyright (C) 2007-2009, Parrot Foundation.
$Id$
=head1 NAME
@@ -138,9 +138,9 @@
if (! PMC_IS_NULL(e->code))
Parrot_gc_mark_PObj_alive(INTERP, (PObj *)e->code);
- }
- SUPER();
+ SUPER();
+ }
}
/*
Modified: branches/pmc_i_ops/src/pmc/filehandle.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/filehandle.pmc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc/filehandle.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -31,24 +31,11 @@
#endif
#endif
-#ifdef PIO_OS_WIN32
-# define PIO_INVALID_HANDLE INVALID_HANDLE_VALUE
-#endif
-
-#ifdef PIO_OS_UNIX
-# define PIO_INVALID_HANDLE -1
-#endif
-
-#ifdef PIO_OS_STDIO
-# define PIO_INVALID_HANDLE NULL
-#endif
-
-pmclass FileHandle need_ext {
+pmclass FileHandle extends Handle {
ATTR INTVAL flags; /* Filehandle flags */
ATTR STRING *filename; /* The opened path and filename */
ATTR STRING *mode; /* The mode string used in open */
ATTR STRING *encoding; /* The encoding for read/write */
- ATTR PIOHANDLE os_handle; /* Low level OS descriptor */
ATTR INTVAL process_id; /* Child process on pipes */
ATTR PIOOFF_T file_size; /* Current file size */
ATTR PIOOFF_T file_pos; /* Current real file pointer */
@@ -248,10 +235,9 @@
*/
METHOD open(STRING *filename :optional, INTVAL got_filename :opt_flag,
- STRING *mode :optional, INTVAL got_mode :opt_flag) {
+ STRING *mode :optional, INTVAL got_mode :opt_flag) {
PMC *filehandle;
STRING *open_filename, *open_mode;
- INTVAL flags;
if (!Parrot_io_is_closed_filehandle(INTERP, SELF))
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
@@ -278,16 +264,7 @@
SET_ATTR_mode(INTERP, SELF, open_mode);
}
- flags = Parrot_io_parse_open_flags(interp, open_mode);
- SET_ATTR_flags(INTERP, SELF, flags);
- filehandle = PIO_OPEN(INTERP, SELF, open_filename, flags);
-
- if (PMC_IS_NULL(filehandle))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
- "Unable to open filehandle from path '%S'",
- open_filename);
-
- Parrot_io_setbuf(interp, filehandle, PIO_UNBOUND);
+ filehandle = Parrot_io_open(INTERP, SELF, open_filename, open_mode);
RETURN(PMC *filehandle);
}
@@ -316,7 +293,7 @@
METHOD close() {
INTVAL status;
- status = Parrot_io_close_filehandle(interp, SELF);
+ status = Parrot_io_close(INTERP, SELF);
RETURN(INTVAL status);
}
@@ -332,7 +309,7 @@
METHOD is_closed() {
INTVAL status;
- status = Parrot_io_is_closed_filehandle(interp, SELF);
+ status = Parrot_io_is_closed(interp, SELF);
RETURN(INTVAL status);
}
@@ -348,19 +325,7 @@
METHOD read(INTVAL length) {
STRING *string_result = NULL;
- INTVAL ignored;
-
- if (Parrot_io_is_closed_filehandle(interp, SELF))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
- "Cannot read from a closed filehandle");
-
- string_result = Parrot_io_make_string(interp, &string_result, length);
- string_result->bufused = length;
-
- if (Parrot_io_is_encoding(interp, SELF, CONST_STRING(interp, "utf8")))
- ignored = Parrot_io_read_utf8(interp, SELF, &string_result);
- else
- ignored = Parrot_io_read_buffer(interp, SELF, &string_result);
+ string_result = Parrot_io_reads(INTERP, SELF, length);
RETURN(STRING *string_result);
}
@@ -377,11 +342,7 @@
METHOD readline() {
STRING *string_result;
- if (!(PARROT_FILEHANDLE(SELF)->flags & PIO_F_LINEBUF))
- Parrot_io_setlinebuf(INTERP, SELF);
-
- string_result = Parrot_io_reads(INTERP, SELF, 0);
-
+ string_result = Parrot_io_readline(INTERP, SELF);
RETURN(STRING *string_result);
}
@@ -471,6 +432,7 @@
"Cannot readall on a new file from an already open filehandle");
}
filehandle = Parrot_io_open(INTERP, PMCNULL, name, NULL);
+ PARROT_ASSERT(filehandle->vtable->base_type == enum_class_FileHandle);
SET_ATTR_encoding(INTERP, filehandle, encoding);
size = (size_t)(Parrot_stat_info_intval(INTERP, name, STAT_FILESIZE));
@@ -513,7 +475,7 @@
*/
METHOD flush() {
- Parrot_io_flush_filehandle(interp, SELF);
+ Parrot_io_flush(INTERP, SELF);
}
/*
@@ -544,30 +506,8 @@
*/
METHOD puts(STRING *to_print) {
- INTVAL flags, status;
- if (Parrot_io_is_closed_filehandle(interp, SELF))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
- "Cannot write to a closed filehandle");
-
- GET_ATTR_flags(INTERP, SELF, flags);
- if (!(flags & PIO_F_WRITE))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
- "Cannot write to a filehandle not opened for write");
-
- if (STRING_IS_NULL(to_print))
- RETURN(INTVAL 0);
-
-#if ! DISABLE_GC_DEBUG
- /* trigger GC for debug - but not during tests */
- if (0 && GC_DEBUG(interp))
- Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG);
-#endif
-
- if (Parrot_io_is_encoding(interp, SELF, CONST_STRING(interp, "utf8")))
- status = Parrot_io_write_utf8(interp, SELF, to_print);
- else
- status = Parrot_io_write_buffer(interp, SELF, to_print);
-
+ INTVAL status;
+ status = Parrot_io_putps(INTERP, SELF, to_print);
RETURN(INTVAL status);
}
@@ -707,14 +647,8 @@
METHOD eof() {
INTVAL flags;
- if (Parrot_io_is_closed_filehandle(interp, SELF))
- RETURN(INTVAL 1);
-
- GET_ATTR_flags(INTERP, SELF, flags);
- if (flags & PIO_F_EOF)
- RETURN(INTVAL 1);
-
- RETURN(INTVAL 0);
+ flags = Parrot_io_eof(INTERP, SELF);
+ RETURN(INTVAL flags);
}
Added: branches/pmc_i_ops/src/pmc/handle.pmc
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pmc_i_ops/src/pmc/handle.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -0,0 +1,44 @@
+/*
+Copyright (C) 2008, Parrot Foundation.
+$Id: socket.pmc 38794 2009-05-15 16:12:33Z coke $
+
+=head1 NAME
+
+src/pmc/handle.pmc - IO Handle PMC
+
+=head1 DESCRIPTION
+
+This is the base-class for all IO-related PMCs.
+
+=head2 Vtable Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+#include "../src/io/io_private.h"
+
+pmclass Handle provides Handle {
+ /* TODO: Consider encapsulating PIOHANDLE as a PMC type, for subclassing */
+ ATTR PIOHANDLE os_handle; /* Low level OS descriptor */
+
+ VTABLE void init() {
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ "Handle cannot be instantiated directly.");
+ }
+
+ VTABLE void init_pmc(PMC * init) {
+ Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+ "Handle cannot be instantiated directly.");
+ }
+}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: branches/pmc_i_ops/src/pmc/resizablestringarray.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/resizablestringarray.pmc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc/resizablestringarray.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -36,7 +36,6 @@
*/
VTABLE void init() {
-
Parrot_ResizableStringArray_attributes *attrs =
mem_allocate_zeroed_typed(Parrot_ResizableStringArray_attributes);
Modified: branches/pmc_i_ops/src/pmc/socket.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/socket.pmc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc/socket.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -20,7 +20,7 @@
#include "../src/io/io_private.h"
-pmclass Socket extends FileHandle need_ext {
+pmclass Socket extends Handle {
ATTR PMC *local; /* Local addr */
ATTR PMC *remote; /* Remote addr */
@@ -49,7 +49,7 @@
=item C<PMC *clone()>
-Create a copy of the filehandle.
+Create a copy of the socket handle.
=cut
@@ -68,9 +68,24 @@
/*
+=item C<INTVAL does(STRING * role)>
+
+=cut
+
+*/
+
+ VTABLE INTVAL does(STRING * role) {
+ Parrot_Socket_attributes * const attrs = PARROT_SOCKET(SELF);
+ if (Parrot_str_equal(interp, role, CONST_STRING(interp, "socket")))
+ return 1;
+ return SUPER(role);
+ }
+
+/*
+
=item C<void mark()>
-Mark active filehandle data as live.
+Mark active socket handle data as live.
=cut
@@ -100,7 +115,9 @@
if (PARROT_SOCKET(SELF)) {
Parrot_Socket_attributes *data_struct = PARROT_SOCKET(SELF);
- /* TODO Shutdown socket */
+ if (data_struct->os_handle != PIO_INVALID_HANDLE)
+ Parrot_io_close_piohandle(interp, data_struct->os_handle);
+ data_struct->os_handle = PIO_INVALID_HANDLE;
}
}
@@ -179,6 +196,28 @@
/*
+=item C<close>
+
+Close a socket.
+
+=cut
+
+*/
+
+ METHOD close() {
+ INTVAL result = -1;
+ if (PARROT_SOCKET(SELF)) {
+ Parrot_Socket_attributes *data_struct = PARROT_SOCKET(SELF);
+
+ if (data_struct->os_handle != PIO_INVALID_HANDLE)
+ result = Parrot_io_close_piohandle(interp, data_struct->os_handle);
+ data_struct->os_handle = PIO_INVALID_HANDLE;
+ }
+ RETURN(INTVAL result);
+ }
+
+/*
+
=item C<recv>
Receives a message from a connected socket object. It returns
Modified: branches/pmc_i_ops/src/pmc/stringhandle.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/stringhandle.pmc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc/stringhandle.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -46,7 +46,7 @@
return Parrot_str_equal(interp, s, CONST_STRING(interp, "utf8"));
}
-pmclass StringHandle need_ext {
+pmclass StringHandle extends Handle need_ext {
ATTR INTVAL flags; /* Filehandle flags */
ATTR STRING *stringhandle; /* The string data */
ATTR STRING *mode; /* The mode string used in open */
@@ -220,8 +220,7 @@
SET_ATTR_mode(INTERP, SELF, open_mode);
}
- flags = Parrot_io_parse_open_flags(interp, open_mode);
- SET_ATTR_flags(INTERP, SELF, flags);
+ Parrot_io_open(INTERP, SELF, filename, open_mode);
RETURN(PMC *SELF);
}
@@ -266,13 +265,9 @@
*/
METHOD is_closed() {
- STRING *stringhandle;
- GET_ATTR_stringhandle(INTERP, SELF, stringhandle);
-
- if (STRING_IS_NULL(stringhandle))
- RETURN(INTVAL 1);
-
- RETURN(INTVAL 0);
+ INTVAL status;
+ status = Parrot_io_is_closed(INTERP, SELF);
+ RETURN(INTVAL status);
}
/*
@@ -287,32 +282,8 @@
*/
METHOD read(INTVAL length) {
- STRING *string_result, *string_orig;
- INTVAL offset;
-
- GET_ATTR_stringhandle(INTERP, SELF, string_orig);
- if (STRING_IS_NULL(string_orig))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
- "Cannot read from a closed filehandle");
-
- if (length == 0)
- string_result = Parrot_str_copy(INTERP, string_orig);
- else {
- INTVAL orig_length, read_length;
- read_length = length;
- orig_length = Parrot_str_byte_length(INTERP, string_orig);
-
- GET_ATTR_read_offset(INTERP, SELF, offset);
-
- /* Only read to the end of the string data. */
- if (offset + read_length > orig_length)
- read_length = orig_length - offset;
-
- string_result = Parrot_str_substr(INTERP, string_orig, offset,
- read_length, NULL, 0);
- SET_ATTR_read_offset(INTERP, SELF, offset + read_length);
- }
-
+ STRING *string_result;
+ string_result = Parrot_io_reads(INTERP, SELF, length);
RETURN(STRING *string_result);
}
@@ -329,27 +300,7 @@
METHOD readline() {
STRING *string_result;
- INTVAL offset, newline_pos, read_length, orig_length;
-
- GET_ATTR_stringhandle(INTERP, SELF, string_result);
- if (STRING_IS_NULL(string_result))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
- "Cannot read from a closed filehandle");
-
- orig_length = Parrot_str_byte_length(INTERP, string_result);
- GET_ATTR_read_offset(INTERP, SELF, offset);
- newline_pos = Parrot_str_find_index(INTERP, string_result, CONST_STRING(INTERP, "\n"), offset);
-
- /* No newline found, read the rest of the string. */
- if (newline_pos == -1)
- read_length = orig_length - offset;
- else
- read_length = newline_pos - offset + 1; /* +1 to include the newline */
-
- string_result = Parrot_str_substr(INTERP, string_result, offset,
- read_length, NULL, 0);
- SET_ATTR_read_offset(INTERP, SELF, newline_pos + 1);
-
+ string_result = Parrot_io_readline(INTERP, SELF);
RETURN(STRING *string_result);
}
@@ -393,7 +344,7 @@
*/
METHOD flush() {
- SET_ATTR_stringhandle(INTERP, SELF, NULL);
+ Parrot_io_flush(INTERP, SELF);
}
/*
Modified: branches/pmc_i_ops/src/pmc/undef.pmc
==============================================================================
--- branches/pmc_i_ops/src/pmc/undef.pmc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc/undef.pmc Tue Jun 9 22:26:30 2009 (r39482)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2004-2008, Parrot Foundation.
+Copyright (C) 2004-2009, Parrot Foundation.
$Id$
=head1 NAME
@@ -46,8 +46,19 @@
}
else {
PMC * const class_ = PARROT_OBJECT(other)->_class;
+ PMC *clone = VTABLE_clone(interp, other);
+ void *attrs;
pmc_reuse_by_class(INTERP, SELF, class_, PObj_is_object_FLAG);
- Parrot_oo_clone_object(interp, other, class_, SELF);
+
+ /* now swap memory without leaking it */
+ attrs = PMC_data(SELF);
+ PMC_data(SELF) = PMC_data(clone);
+ PMC_data(clone) = attrs;
+ VTABLE_destroy(interp, clone);
+
+ PObj_is_object_SET(SELF);
+ PObj_active_destroy_SET(SELF);
+
}
}
Modified: branches/pmc_i_ops/src/pmc_freeze.c
==============================================================================
--- branches/pmc_i_ops/src/pmc_freeze.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/pmc_freeze.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -742,8 +742,11 @@
op_append(PARROT_INTERP, ARGIN(STRING *s), opcode_t b, size_t len)
{
ASSERT_ARGS(op_append)
+ char *str_pos;
+
op_check_size(interp, s, len);
- *((opcode_t *)((ptrcast_t)s->strstart + s->bufused)) = b;
+ str_pos = s->strstart + s->bufused;
+ *((opcode_t *)(str_pos)) = b;
s->bufused += len;
s->strlen += len;
}
Modified: branches/pmc_i_ops/src/runcore/main.c
==============================================================================
--- branches/pmc_i_ops/src/runcore/main.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/runcore/main.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -88,7 +88,7 @@
static void prederef_args(
ARGMOD(void **pc_prederef),
PARROT_INTERP,
- ARGIN(opcode_t *pc),
+ ARGIN(const opcode_t *pc),
ARGIN(const op_info_t *opinfo))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -170,8 +170,8 @@
/*
-=item C<static void prederef_args(void **pc_prederef, PARROT_INTERP, opcode_t
-*pc, const op_info_t *opinfo)>
+=item C<static void prederef_args(void **pc_prederef, PARROT_INTERP, const
+opcode_t *pc, const op_info_t *opinfo)>
Called from C<do_prederef()> to deal with any arguments.
@@ -183,7 +183,7 @@
static void
prederef_args(ARGMOD(void **pc_prederef), PARROT_INTERP,
- ARGIN(opcode_t *pc), ARGIN(const op_info_t *opinfo))
+ ARGIN(const opcode_t *pc), ARGIN(const op_info_t *opinfo))
{
ASSERT_ARGS(prederef_args)
const PackFile_ConstTable * const const_table = interp->code->const_table;
@@ -298,7 +298,7 @@
*/
void
-do_prederef(void **pc_prederef, PARROT_INTERP, int type)
+do_prederef(ARGIN(void **pc_prederef), PARROT_INTERP, int type)
{
ASSERT_ARGS(do_prederef)
const size_t offset = pc_prederef - interp->code->prederef.code;
@@ -619,13 +619,13 @@
*/
void
-exec_init_prederef(PARROT_INTERP, void *prederef_arena)
+exec_init_prederef(PARROT_INTERP, ARGIN(void *prederef_arena))
{
ASSERT_ARGS(exec_init_prederef)
load_prederef(interp, PARROT_CGP_CORE);
if (!interp->code->prederef.code) {
- void **temp = (void **)prederef_arena;
+ void ** const temp = (void **)prederef_arena;
interp->code->prederef.code = temp;
/* TODO */
@@ -1086,7 +1086,7 @@
*/
void
-dynop_register(PARROT_INTERP, PMC *lib_pmc)
+dynop_register(PARROT_INTERP, ARGIN(PMC *lib_pmc))
{
ASSERT_ARGS(dynop_register)
op_lib_t *lib, *core;
Modified: branches/pmc_i_ops/src/string/api.c
==============================================================================
--- branches/pmc_i_ops/src/string/api.c Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/src/string/api.c Tue Jun 9 22:26:30 2009 (r39482)
@@ -721,7 +721,7 @@
UINTVAL len, ARGIN_NULLOK(const char *charset_name), UINTVAL flags)
{
ASSERT_ARGS(string_make)
- const CHARSET *charset;
+ const CHARSET *charset;
if (!charset_name)
charset_name = "ascii";
@@ -732,7 +732,6 @@
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
"Can't make '%s' charset strings", charset_name);
-
return Parrot_str_new_init(interp, buffer, len,
charset->preferred_encoding, charset, flags);
Modified: branches/pmc_i_ops/t/compilers/imcc/syn/file.t
==============================================================================
--- branches/pmc_i_ops/t/compilers/imcc/syn/file.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/compilers/imcc/syn/file.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -33,7 +33,8 @@
my $ended_ok = 0;
-my ($FOO, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', DIR => cwd(), UNLINK => 1 );
+#my ($FOO, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', DIR => cwd(), UNLINK => 1 );
+my ($FOO, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', UNLINK => 1 );
print $FOO <<'ENDF';
.macro_const BAR 42
Modified: branches/pmc_i_ops/t/compilers/imcc/syn/pcc.t
==============================================================================
--- branches/pmc_i_ops/t/compilers/imcc/syn/pcc.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/compilers/imcc/syn/pcc.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -1,5 +1,5 @@
#!perl
-# Copyright (C) 2001-2005, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
use strict;
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Config;
-use Parrot::Test tests => 22;
+use Parrot::Test tests => 23;
##############################
# Parrot Calling Conventions
@@ -542,6 +542,27 @@
pir_output_is( $too_many_params, "didn't segfault\n", "calling a sub with way too many params" );
+pir_output_is( <<'CODE', <<'OUT', 'Unicode allowed in method names, TT #730' );
+.sub 'main' :main
+ $P0 = newclass 'Foo'
+ $P1 = new $P0
+ $S0 = unicode:"foo\x{b1}"
+ $P1.$S0(1)
+ $P1.unicode:"foo\x{b1}"(2)
+.end
+
+.namespace ['Foo']
+.sub unicode:"foo\x{b1}" :method
+ .param int count
+ print 'ok '
+ print count
+ say ' - Unicode method names allowed'
+.end
+CODE
+ok 1 - Unicode method names allowed
+ok 2 - Unicode method names allowed
+OUT
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: branches/pmc_i_ops/t/library/pcre.t
==============================================================================
--- branches/pmc_i_ops/t/library/pcre.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/library/pcre.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -57,10 +57,10 @@
.local pmc lib_paths
lib_paths = interp[.IGLOBALS_LIB_PATHS]
- # XXX - hard-coded magic constant (should be PARROT_LIB_PATH_DYNEXT)
- .local pmc include_paths
- include_paths = lib_paths[2]
- unshift include_paths, '$pcre_libpath'
+ # TT #747 - hard-coded magic constant (should be PARROT_LIB_PATH_DYNEXT)
+ .local pmc dynext_path
+ dynext_path = lib_paths[2]
+ unshift dynext_path, '$pcre_libpath'
load_bytecode 'pcre.pbc'
.local pmc func
Modified: branches/pmc_i_ops/t/native_pbc/annotations.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/native_pbc/integer_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/native_pbc/integer_4.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/native_pbc/number_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/native_pbc/number_2.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/native_pbc/number_4.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/native_pbc/number_5.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/native_pbc/string_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/native_pbc/string_4.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/pmc_i_ops/t/op/arithmetics_pmc.t
==============================================================================
--- branches/pmc_i_ops/t/op/arithmetics_pmc.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/op/arithmetics_pmc.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -61,7 +61,7 @@
logical_xor xor
};
-# XXX Put BigInt and BigNum here
+# XXX Put BigInt and BigNum here
my @pmcs = qw{
Integer Float
};
Modified: branches/pmc_i_ops/t/op/interp.t
==============================================================================
--- branches/pmc_i_ops/t/op/interp.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/op/interp.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -56,13 +56,6 @@
print "uno\n"
runinterp test_interp, pasm
print "dos\n"
-
- get_stdout:
- $S0 = readline stdout
- actual .= $S0
- if $S0 goto get_stdout
-
- print actual
goto pasm_end
pasm:
Modified: branches/pmc_i_ops/t/pmc/array.t
==============================================================================
--- branches/pmc_i_ops/t/pmc/array.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/pmc/array.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -1,13 +1,7 @@
-#! perl
-# Copyright (C) 2001-2007, Parrot Foundation.
+#! parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 16;
-
=head1 NAME
t/pmc/array.t - Array PMC
@@ -23,448 +17,396 @@
=cut
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting array size" );
- new P0, ['Array']
+.namespace []
+
+.include "except_types.pasm"
+.include 'fp_equality.pasm'
+
+.sub main :main
+ .include 'test_more.pir'
+
+ plan(64)
+
+ setting_array_size() # 4 tests
+ setting_first_element() # 3 tests
+ setting_second_element() # 3 tests
+ setting_out_of_bounds_element() # 2 tests
+ defined_sub() # 8 tests
+ exists_sub() # 6 tests
+ set_via_pmc_keys_access_via_ints() # 4 tests
+ set_via_ints_access_via_pmc_keys() # 4 tests
+ multikeyed_access_i_arg() # 5 tests
+ multikeyed_access_p_arg() # 5 tests
+ delete_sub() # 3 tests
+ check_whether_interface_is_done() # 3 tests
+ get_bool() # 4 tests
+ freeze_thaw() # 5 tests
+ array_comparison() # 5 tests
+.end
+
+
+.sub setting_array_size
+ .local pmc foo, ifoo
+ .local int size
+
+ foo = new ['Array']
+ size = foo
+ is(size, 0, 'array size initialised to 0 correctly')
+
+ foo = 1
+ size = foo
+ is(size, 1, 'array size set to 1 correctly')
+
+ foo = 2
+ size = foo
+ is(size, 2, 'array size set to 2 correctly')
+
+ ifoo = new ['Integer']
+ ifoo = 3
+ foo = ifoo
+ size = foo
+ is(size, 3, 'array size set to 3 correctly')
+.end
+
+.sub setting_first_element
+ .local pmc foo
+ .local int ival
+ .local num nval
+ .local string sval
+
+ foo = new ['Array']
+ foo = 1
+
+ foo[0] = -7
+ ival = foo[0]
+ is(ival, -7, 'array first element set to integer correctly')
+
+ foo[0] = 3.7
+ nval = foo[0]
+ is(nval, 3.7, 'array first element set to number correctly')
+
+ foo[0] = "Buckaroo"
+ sval = foo[0]
+ is(sval, "Buckaroo", 'array first element set to string correctly')
+.end
+
+.sub setting_second_element
+ .local pmc foo
+ .local int ival
+ .local num nval
+ .local string sval
+
+ foo = new ['Array']
+ foo = 2
+
+ foo[1] = -7
+ ival = foo[1]
+ is(ival, -7, 'array second element set to integer correctly')
+
+ foo[1] = 3.7
+ nval = foo[1]
+ is(nval, 3.7, 'array second element set to number correctly')
+
+ foo[1] = "Buckaroo"
+ sval = foo[1]
+ is(sval, "Buckaroo", 'array second element set to string correctly')
+.end
+
+.sub setting_out_of_bounds_element
+ .local pmc foo, eh
+ .local int ifoo
+
+ foo = new ['Array']
+ foo = 1
+
+ eh = new ['ExceptionHandler']
+ eh.'handle_types'(.EXCEPTION_OUT_OF_BOUNDS)
+ set_addr eh, eh_label
+
+ foo[0] = 42
+ ifoo = foo[0]
+ is(ifoo, 42, 'array in-bounds element set correctly')
+
+ push_eh eh
+ foo[1] = -7
+ pop_eh
+
+ ok(0, 'setting_out_of_bounds_element')
+ goto end
+
+eh_label:
+ .local string message
+ .get_results($P0)
+ message = $P0['message']
+ is(message, "Array index out of bounds!", 'setting_out_of_bounds_element')
+
+end:
+.end
+
+.sub defined_sub
+ .local pmc foo, bar, baz
+ .local int ival
+
+ foo = new ['Array']
+ defined ival, foo
+ is(ival, 1, 'newed array is defined')
+
+ defined ival, bar
+ is(ival, 0, 'unreferenced pmc is undefined')
+
+ foo = 5
+ foo[0] = 1
+ defined ival, foo[0]
+ is(ival, 1, 'assigned array element is defined')
+
+ defined ival, foo[1]
+ is(ival, 0, 'unassigned in-bounds array element is undefined')
+
+ defined ival, foo[100]
+ is(ival, 0, 'unassigned out-of-bounds array element is undefined')
+
+ bar = new ['Undef']
+ foo[2] = bar
+ defined ival, foo[2]
+ is(ival, 0, 'assigned undef pmc is undefined')
+
+ baz = new ['Key']
+ baz = 3
+ foo[3] = 4
+ defined ival, foo[baz]
+ is(ival, 1, 'defined keyed array element is defined')
+
+ baz = 4
+ defined ival, foo[baz]
+ is(ival, 0, 'undefined keyed array element is defined')
+.end
+
+.sub exists_sub
+ .local pmc foo, bar, baz
+ .local int ival
+
+ foo = new ['Array']
+ foo = 5
+ foo[0] = 1
+ exists ival, foo[0]
+ is(ival, 1, 'assigned array element exists')
+
+ exists ival, foo[1]
+ is(ival, 0, 'unassigned in-bounds array element does not exist')
+
+ exists ival, foo[100]
+ is(ival, 0, 'unassigned out-of-bounds array element does not exist')
+
+ bar = new ['Undef']
+ foo[2] = bar
+ exists ival, foo[2]
+ is(ival, 1, 'assigned undef array element exists')
+
+ baz = new ['Key']
+ baz = 3
+ foo[3] = 4
+ exists ival, foo[baz]
+ is(ival, 1, 'defined keyed array element exists')
+
+ baz = 4
+ exists ival, foo[baz]
+ is(ival, 0, 'undefined keyed array element does not exist')
+.end
+
+.sub set_via_pmc_keys_access_via_ints
+ .local pmc foo, bar, baz, faz
+ .local int ival
+ .local num nval
+ .local string sval, inner
+
+ foo = new ['Array']
+ foo = 4
+ bar = new ['Key']
+
+ bar = 0
+ foo[bar] = 25
+ ival = foo[0]
+ is(ival, 25, 'integer element can be retrieved from array')
+
+ bar = 1
+ foo[bar] = 2.5
+ nval = foo[1]
+ is(nval, 2.5, 'number element can be retrieved from array')
+
+ bar = 2
+ foo[bar] = "Squeek"
+ sval = foo[2]
+ is(sval, "Squeek", 'string element can be retrieved from array')
+
+ bar = 3
+ baz = new ['Hash']
+ baz["a"] = "apple"
+ foo[bar] = baz
+
+ faz = foo[3]
+ inner = faz["a"]
+ is(inner, "apple", 'inner string element can be retrieved from array')
+.end
+
+.sub set_via_ints_access_via_pmc_keys
+ .local pmc foo, bar, baz, faz
+ .local int ival, inner
+ .local num nval
+ .local string sval
+
+ foo = new ['Array']
+ foo = 1024
+
+ foo[25] = 125
+ foo[128] = -9.9
+ foo[513] = "qwertyuiopasdfghjklzxcvbnm"
+ bar = new ['Integer']
+ bar = 123456
+ foo[1023] = bar
+
+ baz = new ['Key']
+ baz = 25
+
+ ival = foo[baz]
+ is(ival, 125, 'integer element can be retrieved from array')
+
+ baz = 128
+ nval = foo[baz]
+ is(nval, -9.9, 'number element can be retrieved from array')
+
+ baz = 513
+ sval = foo[baz]
+ is(sval, "qwertyuiopasdfghjklzxcvbnm", 'string element can be retrieved from array')
+
+ baz = 1023
+ faz = foo[baz]
+ inner = faz
+ is(inner, 123456, 'indirect integer element can be retrieved from array')
+.end
+
+.sub multikeyed_access_i_arg
+ .local pmc foo, bar, baz
+ .local int ival, inum
+ .local string pmctype
+
+ foo = new ['Array']
+ foo = 1
+ bar = new ['Array']
+ bar = 1
+
+ foo[0] = bar
+ foo[0;0] = 20
+ baz = foo[0]
+ typeof pmctype, baz
+ is(pmctype, 'Array', 'pmc is an array')
+
+ ival = foo[0;0]
+ is(ival, 20, 'access to array via [int;int] works correctly')
+
+ inum = 0
+ ival = foo[inum;0]
+ is(ival, 20, 'access to array via [var;int] works correctly')
+
+ ival = foo[0;inum]
+ is(ival, 20, 'access to array via [int;var] works correctly')
+
+ ival = foo[inum;inum]
+ is(ival, 20, 'access to array via [var;var] works correctly')
+.end
+
+.sub multikeyed_access_p_arg
+ .local pmc foo, bar, baz, faz
+ .local int ival, inum
+ .local string pmctype
+
+ foo = new ['Array']
+ foo = 1
+ bar = new ['Array']
+ bar = 1
+
+ faz = new ['Integer']
+ faz = 20
+ foo[0] = bar
+ foo[0;0] = faz
+ baz = foo[0]
+ typeof pmctype, baz
+ is(pmctype, 'Array', 'pmc is an array')
+
+ ival = foo[0;0]
+ is(ival, 20, 'access to array via [int;int] works correctly')
+
+ inum = 0
+ ival = foo[inum;0]
+ is(ival, 20, 'access to array via [var;int] works correctly')
+
+ ival = foo[0;inum]
+ is(ival, 20, 'access to array via [int;var] works correctly')
+
+ ival = foo[inum;inum]
+ is(ival, 20, 'access to array via [var;var] works correctly')
+.end
+
+.sub delete_sub
+ .local pmc foo
+ .local int ival
+
+ foo = new ['Array']
+ foo = 3
+ foo[0] = 10
+ foo[1] = 20
+ foo[2] = 30
+
+ delete foo[1]
+ ival = foo
+ is(ival, 2, 'array with deleted element correctly sized')
- set I0,P0
- eq I0,0,OK_1
- print "not "
-OK_1: print "ok 1\n"
-
- set P0,1
- set I0,P0
- eq I0,1,OK_2
- print "not "
-OK_2: print "ok 2\n"
-
- set P0,2
- set I0,P0
- eq I0,2,OK_3
- print "not "
-OK_3: print "ok 3\n"
-
- new P1, ['Integer']
- set P1, 3
- set P0,P1
- set I0,P0
- eq I0,3,OK_4
- print "not "
-OK_4: print "ok 4\n"
-
-
- end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting first element" );
- new P0, ['Array']
- set P0, 1
-
- set P0[0],-7
- set I0,P0[0]
- eq I0,-7,OK_1
- print "not "
-OK_1: print "ok 1\n"
-
- set P0[0],3.7
- set N0,P0[0]
- eq N0,3.7,OK_2
- print "not "
-OK_2: print "ok 2\n"
-
- set P0[0],"Buckaroo"
- set S0,P0[0]
- eq S0,"Buckaroo",OK_3
- print "not "
-OK_3: print "ok 3\n"
-
- end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "Setting second element" );
- new P0, ['Array']
- set P0, 2
-
- set P0[1], -7
- set I0, P0[1]
- eq I0,-7,OK_1
- print "not "
-OK_1: print "ok 1\n"
-
- set P0[1], 3.7
- set N0, P0[1]
- eq N0,3.7,OK_2
- print "not "
-OK_2: print "ok 2\n"
-
- set P0[1],"Buckaroo"
- set S0, P0[1]
- eq S0,"Buckaroo",OK_3
- print "not "
-OK_3: print "ok 3\n"
-
- end
-CODE
-ok 1
-ok 2
-ok 3
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Setting out-of-bounds elements" );
- new P0, ['Array']
- set P0, 1
-
- set P0[1], -7
-
- end
-CODE
-/^Array index out of bounds!
-current instr/
-OUTPUT
-
-pasm_error_output_like( <<'CODE', <<'OUTPUT', "Getting out-of-bounds elements" );
- new P0, ['Array']
- set P0, 1
-
- set I0, P0[1]
- end
-CODE
-/^Array index out of bounds!
-current instr/
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "defined" );
- new P0, ['Array']
- defined I0, P0
- print I0
- print "\n"
- defined I0, P1
- print I0
- print "\n"
- set P0, 5
- set P0[0], 1
- defined I0, P0[0]
- print I0
- print "\n"
- defined I0, P0[1]
- print I0
- print "\n"
- defined I0, P0[100]
- print I0
- print "\n"
- new P1, ['Undef']
- set P0[2], P1
- defined I0, P0[2]
- print I0
- print "\n"
- new P2, ['Key']
- set P2, 3
- set P0[3], 4
- defined I0, P0[P2]
- print I0
- print "\n"
- set P2, 4
- defined I0, P0[P2]
- print I0
- print "\n"
- end
-CODE
-1
-0
-1
-0
-0
-0
-1
-0
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "exists" );
- new P0, ['Array']
- set P0, 5
- set P0[0], 1
- exists I0, P0[0]
- print I0
- print "\n"
- exists I0, P0[1]
- print I0
- print "\n"
- exists I0, P0[100]
- print I0
- print "\n"
- new P1, ['Undef']
- set P0[2], P1
- exists I0, P0[2]
- print I0
- print "\n"
- new P2, ['Key']
- set P2, 3
- set P0[3], 4
- exists I0, P0[P2]
- print I0
- print "\n"
- set P2, 4
- exists I0, P0[P2]
- print I0
- print "\n"
- end
-CODE
-1
-0
-0
-1
-1
-0
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via PMC keys, access via INTs" );
- .include 'fp_equality.pasm'
- new P0, ['Array']
- set P0, 4
- new P1, ['Key']
-
- set P1, 0
- set P0[P1], 25
-
- set P1, 1
- set P0[P1], 2.5
-
- set P1, 2
- set P0[P1], "Squeek"
-
- set P1, 3
- new P2, ['Hash']
- set P2["a"], "apple"
- set P0[P1], P2
-
- set I0, P0[0]
- eq I0, 25, OK1
- print "not "
-OK1: print "ok 1\\n"
-
- set N0, P0[1]
- .fp_eq_pasm(N0, 2.5, OK2)
- print "not "
-OK2: print "ok 2\\n"
-
- set S0, P0[2]
- eq S0, "Squeek", OK3
- print "not "
-OK3: print "ok 3\\n"
-
- set P3, P0[3]
- set S1, P3["a"]
- eq S1, "apple", OK4
- print "not "
-OK4: print "ok 4\\n"
-
- end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', "Set via INTs, access via PMC Keys" );
- .include 'fp_equality.pasm'
- new P0, ['Array']
- set P0, 1024
-
- set P0[25], 125
- set P0[128], -9.9
- set P0[513], "qwertyuiopasdfghjklzxcvbnm"
- new P1, ['Integer']
- set P1, 123456
- set P0[1023], P1
-
- new P2, ['Key']
- set P2, 25
- set I0, P0[P2]
- eq I0, 125, OK1
- print "not "
-OK1: print "ok 1\\n"
-
- set P2, 128
- set N0, P0[P2]
- .fp_eq_pasm(N0, -9.9, OK2)
- print "not "
-OK2: print "ok 2\\n"
-
- set P2, 513
- set S0, P0[P2]
- eq S0, "qwertyuiopasdfghjklzxcvbnm", OK3
- print "not "
-OK3: print "ok 3\\n"
-
- set P2, 1023
- set P3, P0[P2]
- set I1, P3
- eq I1, 123456, OK4
- print "not "
-OK4: print "ok 4\\n"
-
- end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUT, "multikeyed access I arg" );
- new P0, ['Array']
- set P0, 1
- new P1, ['Array']
- set P1, 1
- set P0[0], P1
- set P0[0;0], 20
- set P2, P0[0]
- typeof S0, P2
- print S0
- print "\n"
- set I2, P0[0;0]
- print I2
- set I3, 0
- set I2, P0[I3;0]
- print I2
- set I2, P0[0;I3]
- print I2
- set I2, P0[I3;I3]
- print I2
- print "\n"
- end
-CODE
-Array
-20202020
-OUT
-
-pasm_output_is( <<'CODE', <<OUT, "multikeyed access P arg" );
- new P0, ['Array']
- set P0, 1
- new P1, ['Array']
- set P1, 1
- new P3, ['Integer']
- set P3, 20
- set P0[0], P1
- set P0[0;0], P3
- set P2, P0[0]
- typeof S0, P2
- print S0
- print "\n"
- set I2, P0[0;0]
- print I2
- set I3, 0
- set I2, P0[I3;0]
- print I2
- set I2, P0[0;I3]
- print I2
- set I2, P0[I3;I3]
- print I2
- print "\n"
- end
-CODE
-Array
-20202020
-OUT
-
-pasm_output_is( <<'CODE', <<OUT, "delete" );
- new P0, ['Array']
- set P0, 3
- set P0[0], 10
- set P0[1], 20
- set P0[2], 30
-
- delete P0[1]
- set I0, P0
- print I0
-
- set I0, P0[0]
- print I0
- set I0, P0[1]
- print I0
- print "\n"
- end
-CODE
-21030
-OUT
+ ival = foo[0]
+ is(ival, 10, 'array with deleted element has correct first element')
-pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
+ ival = foo[1]
+ is(ival, 30, 'array with deleted element has correct first element')
+.end
-.sub _main
+.sub check_whether_interface_is_done
.local pmc pmc1
pmc1 = new ['Array']
.local int bool1
does bool1, pmc1, "scalar"
- print bool1
- print "\n"
+ is(bool1, 0, 'pmc array does not do scalar correctly')
+
does bool1, pmc1, "array"
- print bool1
- print "\n"
+ is(bool1, 1, 'pmc array does array correctly')
+
does bool1, pmc1, "no_interface"
- print bool1
- print "\n"
- end
+ is(bool1, 0, 'pmc array does not do no_interface correctly')
.end
-CODE
-0
-1
-0
-OUTPUT
-
-pir_output_is( << 'CODE', << 'OUTPUT', "get_bool" );
-
-.sub _main
+.sub get_bool
.local pmc p
.local int i
- p = new ['Array']
-
- if p goto L1
- print "not "
-L1: say "true"
+ p = new ['Array']
+ is(p, 0, 'newed array is not true correctly')
+
p = 4
-
- if p goto L2
- print "is not "
-L2: say "true"
-
+ is(p, 4, 'resized array is true correctly')
p[0] = 2
- if p goto L3
- print "not "
-L3: say "true"
+ is(p, 4, 'assigned array is true correctly')
p = new ['Array']
p = 0
- if p goto L4
- print "not "
-L4: say "true"
-
-.end
-CODE
-not true
-true
-true
-not true
-OUTPUT
-
-TODO: {
- local $TODO = "freeze/thaw known to be broken";
-pir_output_is( << 'CODE', << 'OUTPUT', "freeze/thaw" );
-.sub main
+ is(p, 0, 'newed array set to zero length is not true correctly')
+.end
+
+
+.sub freeze_thaw
.local pmc p, it, val
.local string s
+ .local string reason
+ reason = "freeze/thaw known to be broken"
+
p = new ['Array']
unshift p, 2
@@ -478,70 +420,77 @@
it = iter p
-iter_loop:
- unless it goto iter_end
val = shift it
- print val
- print "\n"
- goto iter_loop
-
-iter_end:
-
-.end
-CODE
-p
--3
-9999
-foo
-2
-OUTPUT
-}
+ #is(val, '"p"', 'first thawed array element accessed correctly')
+ unless null val goto NOT_NULL_1
+ val = new 'String'
+ NOT_NULL_1:
+ $I0 = cmp val, '"p"'
+ $I0 = not $I0
+ todo($I0, 'first thawed array element accessed correctly', reason)
+
+ val = shift it
+ #is(val, '-3', 'second thawed array element accessed correctly')
+ unless null val goto NOT_NULL_2
+ val = new 'String'
+ NOT_NULL_2:
+ $I0 = cmp val, -3
+ $I0 = not $I0
+ todo($I0, 'second thawed array element accessed correctly', reason)
+
+ val = shift it
+ #is(val, '9999', 'third thawed array element accessed correctly')
+ unless null val goto NOT_NULL_3
+ val = new 'String'
+ NOT_NULL_3:
+ $I0 = cmp val, '9999'
+ $I0 = not $I0
+ todo($I0, 'third thawed array element accessed correctly', reason)
+
+ val = shift it
+ #is(val, 'foo', 'fourth thawed array element accessed correctly')
+ unless null val goto NOT_NULL_4
+ val = new 'String'
+ NOT_NULL_4:
+ $I0 = cmp val, 'foo'
+ $I0 = not $I0
+ todo($I0, 'fourth thawed array element accessed correctly', reason)
-pir_output_is( << 'CODE', << 'OUTPUT', "array comparison" );
-.sub main
+ val = shift it
+ #is(val, '2', 'fifth thawed array element accessed correctly')
+ unless null val goto NOT_NULL_5
+ val = new 'String'
+ NOT_NULL_5:
+ $I0 = cmp val, '2'
+ $I0 = not $I0
+ todo($I0, 'fifth thawed array element accessed correctly', reason)
+.end
+
+.sub array_comparison
.local pmc a1, a2
.local int i
a1 = new ['Array']
a2 = new ['Array']
- if a1 == a2 goto L1
- print "not "
-L1: say "equal"
+ is(a1, a2, 'two newed arrays are equal correctly')
a1 = 4
-
- if a1 == a2 goto L2
- print "not "
-L2: say "equal"
+ isnt(a1, a2, 'a sized array is not the same as a newed array correctly')
a2 = 4
+ is(a1, a2, 'two identically sized arrays are equal correctly')
a1[0] = "foo"
a2[0] = "foo"
-
- if a1 == a2 goto L3
- print "not "
-L3: say "equal"
+ is(a1, a2, 'two identically assigned arrays are equal correctly')
a1[1] = 234
a2[1] = 234
a1[3] = "bar"
a2[3] = "bar"
-
- if a1 == a2 goto L4
- print "not "
-L4: say "equal"
-
+ is(a1, a2, 'two identically assigned arrays are equal correctly')
.end
-CODE
-equal
-not equal
-equal
-equal
-OUTPUT
-
-1;
# Local Variables:
# mode: cperl
Modified: branches/pmc_i_ops/t/pmc/io.t
==============================================================================
--- branches/pmc_i_ops/t/pmc/io.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/pmc/io.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 42;
+use Parrot::Test tests => 41;
use Parrot::Test::Util 'create_tempfile';
use Parrot::Test::Util 'create_tempfile';
@@ -39,58 +39,6 @@
close $FOO;
}
-TODO: {
- local $TODO = "IO on some invalid types";
-
- pir_output_is( <<'CODE', <<'OUTPUT', "IO on some invalid types" );
-.sub main
- $P0 = null
- test($P0, "Undef")
- new $P0, ['Integer']
- test($P0, "null")
- new $P0, ['Undef']
- test($P0, "Integer")
- new $P0, ['String']
- test($P0, "String")
-.end
-.sub test
- .param pmc io
- .param string name
-
- print name
- read $S0, io, 1
- length $I0, $S0
- if $I0 == 0 goto ok1
- print " not"
-ok1:
- print " ok 1\n"
-
- print name
- # what should happen here?
- close io
- print " ok 2\n"
-
- print name
- # what should happen here?
- print io, "not"
- print " ok 3\n"
-.end
-CODE
-Undef ok 1
-Undef ok 2
-Undef ok 3
-null ok 1
-null ok 2
-null ok 3
-Integer ok 1
-Integer ok 2
-Integer ok 3
-String ok 1
-String ok 2
-String ok 3
-OUTPUT
-}
-
my (undef, $temp_file) = create_tempfile( UNLINK => 1 );
pasm_output_is( <<"CODE", <<'OUTPUT', "open/close" );
Modified: branches/pmc_i_ops/t/pmc/pmc.t
==============================================================================
--- branches/pmc_i_ops/t/pmc/pmc.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/pmc/pmc.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -49,7 +49,7 @@
my $checkTypes;
my %types_we_cant_test
= map { $_ => 1; } ( # These require initializers.
- qw(default Null Iterator Enumerate ParrotObject ParrotThread BigInt LexInfo LexPad Object),
+ qw(default Null Iterator Enumerate ParrotObject ParrotThread BigInt LexInfo LexPad Object Handle),
# Instances of these appear to have other types.
qw(PMCProxy Class) );
Modified: branches/pmc_i_ops/t/steps/auto_icu-01.t
==============================================================================
--- branches/pmc_i_ops/t/steps/auto_icu-01.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/steps/auto_icu-01.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -228,7 +228,7 @@
my $expected_include_dir =
$expected_dir . $conf->data->get('slash') . q{include};
mkdir $expected_dir or croak "Unable to make testing directory";
- mkpath($expected_include_dir, 0, 0755)
+ mkpath($expected_include_dir, { mode => 0755 })
or croak "Unable to make second-level testing directory";
($icuheaders, $without) =
$step->_handle_icuheaders($conf, qq{$expected_dir\n}, 0);
Modified: branches/pmc_i_ops/t/steps/auto_jit-01.t
==============================================================================
--- branches/pmc_i_ops/t/steps/auto_jit-01.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/steps/auto_jit-01.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -50,7 +50,7 @@
my $cpuarch = 'bar';
my $osname = 'baz';
my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
- mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0,
"Got expected value for _check_jitcapability(): no core.jit case");
@@ -65,7 +65,7 @@
my $cpuarch = 'bar';
my $osname = 'baz';
my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
- mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
open my $FH, '>', $corejit
or croak "Unable to open handle to file for testing";
@@ -84,7 +84,7 @@
my $cpuarch = 'bar';
my $osname = 'baz';
my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
- mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
open my $FH, '>', $corejit
or croak "Unable to open handle to file for testing";
@@ -106,7 +106,7 @@
my $cpuarch = 'i386';
my $osname = 'darwin';
my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
- mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
open my $FH, '>', $corejit
or croak "Unable to open handle to file for testing";
@@ -128,7 +128,7 @@
my $cpuarch = 'i386';
my $osname = 'MSWin32';
my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
- mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
open my $FH, '>', $corejit
or croak "Unable to open handle to file for testing";
@@ -152,8 +152,8 @@
my $cpuarch = 'bar';
my $jitarchname = "${cpuarch}-baz";
my $asmdir = File::Spec->catdir( $jitbase, $cpuarch );
- mkpath( $asmdir, 0, 755 ) or croak "Unable to make testing directory";
- mkpath( q{src}, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $asmdir, { mode => 0755 } ) or croak "Unable to make testing directory";
+ mkpath( q{src}, { mode => 0755 } ) or croak "Unable to make testing directory";
ok(auto::jit::_handle_asm( {
conf => $conf,
@@ -175,8 +175,8 @@
my $cpuarch = 'bar';
my $jitarchname = "${cpuarch}-baz";
my $asmdir = File::Spec->catdir( $jitbase, $cpuarch );
- mkpath( $asmdir, 0, 755 ) or croak "Unable to make testing directory";
- mkpath( q{src}, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $asmdir, { mode => 0755 } ) or croak "Unable to make testing directory";
+ mkpath( q{src}, { mode => 0755 } ) or croak "Unable to make testing directory";
my $sjit =
File::Spec->catfile( $jitbase, $cpuarch, qq{${jitarchname}.s} );
@@ -205,8 +205,8 @@
my $cpuarch = 'bar';
my $jitarchname = "${cpuarch}-baz";
my $asmdir = File::Spec->catdir( $jitbase, $cpuarch );
- mkpath( $asmdir, 0, 755 ) or croak "Unable to make testing directory";
- mkpath( q{src}, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $asmdir, { mode => 0755 } ) or croak "Unable to make testing directory";
+ mkpath( q{src}, { mode => 0755 } ) or croak "Unable to make testing directory";
my $asm = File::Spec->catfile( $jitbase, $cpuarch, q{asm.s} );
open my $FH, '>', $asm
or croak "Unable to open handle to file for testing";
@@ -314,7 +314,7 @@
my $cpuarch = 'i386';
my $osname = 'darwin';
my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch );
- mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $corejitdir, { mode => 0755 } ) or croak "Unable to make testing directory";
my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} );
open my $FH, '>', $corejit
or croak "Unable to open handle to file for testing";
Modified: branches/pmc_i_ops/t/steps/auto_pmc-01.t
==============================================================================
--- branches/pmc_i_ops/t/steps/auto_pmc-01.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/steps/auto_pmc-01.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -95,7 +95,7 @@
ok( chdir $tdir, 'changed to temp directory for testing' );
my $pmcdir = qq{$tdir/src/pmc};
- ok(mkpath($pmcdir, 0, 0755), "Able to make directory for testing");
+ ok(mkpath($pmcdir, { mode => 0755 }), "Able to make directory for testing");
my $num = qq{$pmcdir/pmc.num};
open my $IN3, ">", $num or croak "Unable to open file for writing: $!";
print $IN3 "# comment line\n";
@@ -132,7 +132,7 @@
ok( chdir $tdir, 'changed to temp directory for testing' );
my $pmcdir = qq{$tdir/src/pmc};
- ok(mkpath($pmcdir, 0, 0755), "Able to make directory for testing");
+ ok(mkpath($pmcdir, { mode => 0755 }), "Able to make directory for testing");
eval { my $order_ref = auto::pmc::get_pmc_order(); };
like($@,
qr/Can't read src\/pmc\/pmc\.num/, "Got expected 'die' message");
Modified: branches/pmc_i_ops/t/steps/gen_platform-01.t
==============================================================================
--- branches/pmc_i_ops/t/steps/gen_platform-01.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/steps/gen_platform-01.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -120,7 +120,7 @@
chdir $tdir or croak "Unable to change to temporary directory";
$conf->data->set( platform_asm => 1 );
my $platform = 'aix';
- mkpath( 'src', 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( 'src', { mode => 0755 } ) or croak "Unable to make testing directory";
my $asmfile = File::Spec->catfile( 'src', 'platform_asm.s' );
open my $FH, '>', $asmfile or croak "Unable to open handle for writing";
print $FH "Hello asm\n";
@@ -140,7 +140,7 @@
$conf->data->set( platform_asm => 1 );
my $platform = 'aix';
- mkpath( 'src', 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( 'src', { mode => 0755 } ) or croak "Unable to make testing directory";
my $asmfile = File::Spec->catfile( 'src', 'platform_asm.s' );
open my $FH, '>', $asmfile or croak "Unable to open handle for writing";
@@ -148,7 +148,7 @@
close $FH or croak "Unable to close handle after writing";
my $path = File::Spec->catdir( 'config', 'gen', 'platform', $platform );
- mkpath( $path, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $path, { mode => 0755 } ) or croak "Unable to make testing directory";
my $configfile = File::Spec->catfile( $path, 'asm.s' );
open my $FH2, '>', $configfile or croak "Unable to open handle for writing";
@@ -172,12 +172,12 @@
my $platform = 'darwin';
my $path = File::Spec->catdir( 'config', 'gen', 'platform', $platform );
- mkpath( $path, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $path, { mode => 0755 } ) or croak "Unable to make testing directory";
copy qq{$cwd/config/gen/platform/$platform/begin.c},
qq{$path/begin.c}
or croak "Unable to copy file for testing";
- mkpath( 'src', 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( 'src', { mode => 0755 } ) or croak "Unable to make testing directory";
my $plat_c = q{src/platform.c};
open my $PLATFORM_C, '>', $plat_c
or croak "Unable to open handle for writing";
Modified: branches/pmc_i_ops/t/tools/install/02-install_files.t
==============================================================================
--- branches/pmc_i_ops/t/tools/install/02-install_files.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/tools/install/02-install_files.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -10,7 +10,6 @@
use Carp;
use Cwd;
use File::Copy;
-use File::Path qw( mkpath );
use File::Temp qw( tempdir );
use lib qw( lib );
use Parrot::Install qw(
Modified: branches/pmc_i_ops/t/tools/install/03-lines_to_files.t
==============================================================================
--- branches/pmc_i_ops/t/tools/install/03-lines_to_files.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/tools/install/03-lines_to_files.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -10,7 +10,6 @@
use Carp;
use Cwd;
use File::Copy;
-use File::Path qw( mkpath );
use File::Temp qw( tempdir );
use lib qw( lib );
use Parrot::Install qw(
Modified: branches/pmc_i_ops/t/tools/install/dev_overall.t
==============================================================================
--- branches/pmc_i_ops/t/tools/install/dev_overall.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/tools/install/dev_overall.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -116,7 +116,8 @@
src/pmc
);
my @created =
- mkpath( map { File::Spec->catdir( $builddir, $_ ) } @dirs_needed );
+ mkpath( ( map { File::Spec->catdir( $builddir, $_ ) } @dirs_needed ),
+ { mode => 0777} );
print STDERR "dirs created: @created\n" if $DEBUG;
foreach my $f ( keys %testfiles ) {
my $src = File::Spec->catfile( $cwd, $testlibdir, $f );
Modified: branches/pmc_i_ops/t/tools/install/overall.t
==============================================================================
--- branches/pmc_i_ops/t/tools/install/overall.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/tools/install/overall.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -101,7 +101,8 @@
compilers/pge
);
my @created =
- mkpath( map { File::Spec->catdir( $builddir, $_ ) } @dirs_needed );
+ mkpath( ( map { File::Spec->catdir( $builddir, $_ ) } @dirs_needed ),
+ { mode => 0777 } );
print STDERR "dirs created: @created\n" if $DEBUG;
foreach my $f ( keys %testfiles ) {
my $src = File::Spec->catfile( $cwd, $testlibdir, $f );
Modified: branches/pmc_i_ops/t/tools/ops2pm/05-renum_op_map_file.t
==============================================================================
--- branches/pmc_i_ops/t/tools/ops2pm/05-renum_op_map_file.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/tools/ops2pm/05-renum_op_map_file.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -32,7 +32,7 @@
my $tdir = tempdir( CLEANUP => 1 );
chdir $tdir or croak "Unable to change to testing directory: $!";
my $opsdir = File::Spec->catdir ( $tdir, 'src', 'ops' );
- mkpath( $opsdir, 0, 755 ) or croak "Unable to make testing directory";
+ mkpath( $opsdir, { mode => 0755 } ) or croak "Unable to make testing directory";
##### Stage 1: Generate ops.num de novo #####
Modified: branches/pmc_i_ops/t/tools/ops2pm/10-print_module.t
==============================================================================
--- branches/pmc_i_ops/t/tools/ops2pm/10-print_module.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/tools/ops2pm/10-print_module.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -188,7 +188,7 @@
Directory failure: can it be provoked?
if ( !-d $fulldir ) {
- File::Path::mkpath( $fulldir, 0, 0755 )
+ File::Path::mkpath( $fulldir, { mode => 0755 } )
or die "$self->{script}: Could not mkdir $fulldir: $!!\n";
}
Modified: branches/pmc_i_ops/t/tools/ops2pm/11-print_h.t
==============================================================================
--- branches/pmc_i_ops/t/tools/ops2pm/11-print_h.t Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/t/tools/ops2pm/11-print_h.t Tue Jun 9 22:26:30 2009 (r39482)
@@ -120,7 +120,7 @@
Directory failure: can it be provoked?
if ( !-d $fulldir ) {
- File::Path::mkpath( $fulldir, 0, 0755 )
+ File::Path::mkpath( $fulldir, { mode => 0755 } )
or die "$self->{script}: Could not mkdir $fulldir: $!!\n";
}
Modified: branches/pmc_i_ops/tools/dev/create_language.pl
==============================================================================
--- branches/pmc_i_ops/tools/dev/create_language.pl Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/tools/dev/create_language.pl Tue Jun 9 22:26:30 2009 (r39482)
@@ -210,7 +210,7 @@
while (<$PARROT_CONFIG>) {
if (/(\w+) => '(.*)'/) { $config{$1} = $2 }
}
- close $PARROT_CONFIG or die $!;
+ close $PARROT_CONFIG;
last if %config;
}
}
@@ -360,11 +360,16 @@
# the default target
all: @lclang@$(EXE)
+installable: installable_ at lclang@$(EXE)
+
## targets for building a standalone executable
@lclang@$(EXE): @lclang at .pbc
$(PBC_TO_EXE) @lclang at .pbc
@win32_libparrot_copy@
+installable_ at lclang@$(EXE): @lclang at .pbc
+ $(PBC_TO_EXE) @lclang at .pbc --install
+
# the compiler .pbc
@lclang at .pbc: Makefile $(PARROT) $(SOURCES) $(BUILTINS_PIR)
$(PARROT) $(PARROT_ARGS) -o @lclang at .pbc @lclang at .pir
Modified: branches/pmc_i_ops/tools/dev/fetch_languages.pl
==============================================================================
--- branches/pmc_i_ops/tools/dev/fetch_languages.pl Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/tools/dev/fetch_languages.pl Tue Jun 9 22:26:30 2009 (r39482)
@@ -30,10 +30,11 @@
use Cwd;
my ( $update_flag, $checkout_flag ) = ( 0, 1 );
-GetOptions( "update" => \$update_flag ) or pod2usage();
+GetOptions( 'update' => \$update_flag ) or pod2usage();
-mkdir 'languages';
-chdir 'languages';
+my $languages_dir = 'languages';
+mkdir $languages_dir;
+chdir $languages_dir;
# some commands
my %checkout_cmd = (
@@ -266,6 +267,12 @@
},
{
+ name => 'steme',
+ scm => 'GIT',
+ repository => 'git://github.com/tene/steme.git'
+ },
+
+ {
name => 'tcl',
scm => 'SVN',
repository => 'http://partcl.googlecode.com/svn/trunk'
Modified: branches/pmc_i_ops/tools/dev/mk_native_pbc
==============================================================================
--- branches/pmc_i_ops/tools/dev/mk_native_pbc Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/tools/dev/mk_native_pbc Tue Jun 9 22:26:30 2009 (r39482)
@@ -139,6 +139,18 @@
perl t/harness t/native_pbc/number.t && \
perl t/harness t/native_pbc/string.t
+./parrot -o t/native_pbc/annotations.pbc - <<EOF
+.sub 'main'
+.annotate "file", "annotations.pir"
+.annotate "creator", "Parrot Foundation"
+.annotate "line", 1
+ say "Hi"
+ say "line"
+.annotate "line", 2
+ .return ()
+.end
+EOF
+
if [ "$enable_long_double" = "1" ]; then
if [ "$1" = "--noconf" ]; then
echo "Hmm. You have no long double, and we want to try --floatval=long double"
Modified: branches/pmc_i_ops/tools/dev/parrot-fuzzer
==============================================================================
--- branches/pmc_i_ops/tools/dev/parrot-fuzzer Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/tools/dev/parrot-fuzzer Tue Jun 9 22:26:30 2009 (r39482)
@@ -60,10 +60,10 @@
=item C<--runcore=--some-runcore>
-Specify which runcore to use when running Parrot. By default, --slow-core is
-used. This option is passed directly to the parrot exectuable. Other runcores
-include C<--CGP-core>, C<--fast-core>, C<--computed-goto-core>, C<--jit-core>,
-C<--switched-core> and C<--profile>.
+Specify which runcore to use when running Parrot. The default is the C<slow>
+core. This option corresponds directly to Parrot's C<--runcore> option. Other
+runcores include C<fast>, C<jit>, C<cgoto>, C<cgp>, C<cgp-jit>, and C<switch>.
+See Parrot's help for more details.
=item C<--ignore_blacklist>
Modified: branches/pmc_i_ops/tools/install/smoke_languages.pl
==============================================================================
--- branches/pmc_i_ops/tools/install/smoke_languages.pl Tue Jun 9 22:15:55 2009 (r39481)
+++ branches/pmc_i_ops/tools/install/smoke_languages.pl Tue Jun 9 22:26:30 2009 (r39482)
@@ -9,7 +9,7 @@
use Getopt::Long;
use File::Spec::Functions;
-use Test::More tests => 31;
+use Test::More tests => 32;
=head1 NAME
@@ -489,6 +489,19 @@
SKIP:
{
+skip("steme", 1) unless (-d "$langdir/steme");
+$filename = 'test.scm';
+open $FH, '>', $filename
+ or die "Can't open $filename ($!).\n";
+print $FH "( say \"Hello, World!\" )\n";
+close $FH;
+$out = `$parrot $langdir/steme/steme.pbc $filename`;
+ok($out eq "Hello, World!\n", "check steme");
+unlink($filename);
+}
+
+SKIP:
+{
skip("Squaak", 1) unless (-d "$langdir/squaak");
$filename = 'test.squaak';
open $FH, '>', $filename
More information about the parrot-commits
mailing list