Author: jkeenan Date: Sun Oct 28 17:19:24 2007 New Revision: 22576 Modified: branches/autogcc/CREDITS branches/autogcc/DEPRECATED.pod branches/autogcc/compilers/pge/PGE/Match.pir branches/autogcc/runtime/parrot/library/Data/Dumper.pir branches/autogcc/src/pmc/undef.pmc branches/autogcc/t/configure/036-config_steps.t
Log: Synching autogcc branch with trunk. Modified: branches/autogcc/CREDITS ============================================================================== --- branches/autogcc/CREDITS (original) +++ branches/autogcc/CREDITS Sun Oct 28 17:19:24 2007 @@ -182,6 +182,7 @@ N: David Romano D: PGE tests and fixes +D: POD for the Undef PMC E: [EMAIL PROTECTED] N: Dennis Rieks Modified: branches/autogcc/DEPRECATED.pod ============================================================================== --- branches/autogcc/DEPRECATED.pod (original) +++ branches/autogcc/DEPRECATED.pod Sun Oct 28 17:19:24 2007 @@ -34,19 +34,6 @@ =head1 Deprecated methods -=over 4 - -=item C<newfrom> sub/method in PGE (RT#46971) - -The C<newfrom> method in PGE is now deprecated. Use C<new> instead. -To get access to the C<new> method when a Match object isn't available, -use the PGE::Match protoobject (available in the C<PGE> namespace): - - $P0 = get_hll_global ['PGE'], 'Match' - object = $P0.'new'(...) - -=back - =head1 Deprecated ops From L<http://www.parrotcode.org/docs/ops/var.html>, the following ops are Modified: branches/autogcc/compilers/pge/PGE/Match.pir ============================================================================== --- branches/autogcc/compilers/pge/PGE/Match.pir (original) +++ branches/autogcc/compilers/pge/PGE/Match.pir Sun Oct 28 17:19:24 2007 @@ -21,63 +21,6 @@ .return () .end -=head2 Functions - -=over 4 - -=item C<newfrom(PMC mob [, int from [, string grammar]])> - -Creates a new Match object, based on C<mob>. If C<grammar> is -specified then the newly created object is an instance of that class, -otherwise if C<isa mob, 'PGE::Match'> then the new object is the -same class as C<mob>, otherwise the new object is a 'PGE::Match' -object. The optional C<from> parameter says how to initialize -the C<$.from> attribute of the new object if it can't start from -the current position of C<mob>. - -=cut - -.sub 'newfrom' - .param pmc mob - .param int fromd :optional # default from for new - .param int has_fromd :opt_flag - .param string grammar :optional # grammar to use - .param int has_grammar :opt_flag - .local pmc me, target, from, pos - - newfrom_1: - $I0 = isa mob, 'PGE::Match' - if $I0 goto newfrom_mob - target = new 'String' - assign target, mob - from = new 'Integer' - from = -1 - if has_grammar goto new_me - grammar = 'PGE::Match' - goto new_me - newfrom_mob: - if has_grammar goto newfrom_2 - grammar = classname mob - newfrom_2: - target = getattribute mob, '$.target' - from = getattribute mob, '$.pos' - from = clone from - new_me: - me = new grammar - setattribute me, '$.target', target - setattribute me, '$.from', from - pos = new 'Integer' - pos = -1 - setattribute me, '$.pos', pos - if has_fromd == 0 goto end - if from >= 0 goto end - from = fromd - end: - .return (me, target, from, pos) -.end - -=back - =head2 Methods =over 4 Modified: branches/autogcc/runtime/parrot/library/Data/Dumper.pir ============================================================================== --- branches/autogcc/runtime/parrot/library/Data/Dumper.pir (original) +++ branches/autogcc/runtime/parrot/library/Data/Dumper.pir Sun Oct 28 17:19:24 2007 @@ -35,7 +35,7 @@ push_eh ERROR2 ddd_class = get_class "Data::Dumper::Default" style = ddd_class."new"() - clear_eh + pop_eh style."prepare"( self, indent ) style."dumpWithName"( name, name, dump ) Modified: branches/autogcc/src/pmc/undef.pmc ============================================================================== --- branches/autogcc/src/pmc/undef.pmc (original) +++ branches/autogcc/src/pmc/undef.pmc Sun Oct 28 17:19:24 2007 @@ -28,11 +28,33 @@ pmclass Undef extends default no_ro { +/* + +=item C<void set_pmc(PMC *other)> + +Sets the current PMC to C<*other> by first changing the current PMC to the +appropriate type. + +=cut + +*/ + void set_pmc(PMC *other) { VTABLE_morph(INTERP, SELF, enum_class_Ref); VTABLE_set_pmc(INTERP, SELF, other); } +/* + +=item C<void assign_pmc(PMC *other)> + +Assigns the PMC to the value of C<*other>by first changing the PMC to the +appropriate type. + +=cut + +*/ + void assign_pmc(PMC *other) { VTABLE_morph(INTERP, SELF, other->vtable->base_type); @@ -41,49 +63,159 @@ VTABLE_set_pmc(INTERP, SELF, other); } - void morph(INTVAL new_type) { +/* + +=item C<void morph(INTVAL new_type)> + +Changes the current PMC's type to C<new_type>. + +=cut + +*/ + + void morph(INTVAL new_type) { pmc_reuse(INTERP, SELF, new_type, 0); } +/* + +=item C<INTVAL get_integer()> + +Returns 0. + +=cut + +*/ + INTVAL get_integer() { return 0; } +/* + +=item C<INTVAL defined()> + +Returns 0. + +=cut + +*/ + INTVAL defined() { return 0; } +/* + +=item C<void set_integer_native(INTVAL value)> + +Morphs the current PMC to an C<Integer> and sets the value from C<value>. + +=cut + +*/ + void set_integer_native(INTVAL value) { VTABLE_morph(INTERP, SELF, enum_class_Integer); VTABLE_set_integer_native(INTERP, SELF, value); } +/* + +=item C<FLOATVAL get_number()> + +Returns 0.0. + +=cut + +*/ + FLOATVAL get_number() { return 0.0; } +/* + +=item C<void set_number_native(FLOATVAL value)> + +Morphs the current PMC to a C<Float> and sets the value from C<value>. + +=cut + +*/ + void set_number_native(FLOATVAL value) { VTABLE_morph(INTERP, SELF, enum_class_Float); VTABLE_set_number_native(INTERP, SELF, value); } +/* + +=item C<STRING *get_string()> + +Returns an empty string. + +=cut + +*/ + STRING *get_string() { return string_make_empty(INTERP, enum_stringrep_one, 0); } +/* + +=item C<void set_string_native(STRING *value)> + +Morphs the current PMC to a C<String> and sets the value from C<value>. + +=cut + +*/ + void set_string_native(STRING *value) { VTABLE_morph(INTERP, SELF, UNDEF_STRING_CLASS); VTABLE_set_string_native(INTERP, SELF, value); } +/* + +=item C<INTVAL get_bool()> + +Returns 0. + +=cut + +*/ + INTVAL get_bool() { return 0; } +/* + +=item C<void share()> + +Unknown. (TODO) + +=cut + +*/ + void share() { /* see src/pmc/integer.pmc */ } +/* + +=item C<PMC *share_ro()> + +Unknown. (TODO) + +=cut + +*/ + PMC *share_ro() { if (PObj_is_PMC_shared_TEST(SELF)) return SELF; @@ -91,10 +223,30 @@ return pt_shared_fixup(INTERP, SELF); } +/* + +=item C<PMC *clone()> + +Clones the current Undef PMC. + +=cut + +*/ + PMC *clone() { return pmc_new(INTERP, SELF->vtable->base_type); } +/* + +=item C<INTVAL is_equal(PMC *value)> + +Returns 1 if the C<*value> is an Undef PMC, 0 otherwise. + +=cut + +*/ + INTVAL is_equal(PMC *value) { MMD_Undef: { return 1; Modified: branches/autogcc/t/configure/036-config_steps.t ============================================================================== --- branches/autogcc/t/configure/036-config_steps.t (original) +++ branches/autogcc/t/configure/036-config_steps.t Sun Oct 28 17:19:24 2007 @@ -24,22 +24,23 @@ =cut -my @steps; -sub wanted { /^.*\.pm\z/s && push @steps, $File::Find::name; } -find( { wanted => \&wanted }, 'config' ); - -if ( $^O !~ /win32/i ) { - @steps = grep { $_ !~ /win32/i } @steps; -} - -my $testcount = @steps + 1; - -# my $testcount = @steps; - -plan tests => $testcount; -foreach my $step (@steps) { - require_ok($step); -} +#my @steps; +#sub wanted { /^.*\.pm\z/s && push @steps, $File::Find::name; } +#find( { wanted => \&wanted }, 'config' ); +# +#if ( $^O !~ /win32/i ) { +# @steps = grep { $_ !~ /win32/i } @steps; +#} +# +#my $testcount = @steps + 1; +# +## my $testcount = @steps; +# +#plan tests => $testcount; +#foreach my $step (@steps) { +# require_ok($step); +#} +plan tests => 1; pass("Completed all tests in $0");