develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33524 - in trunk/languages/perl6/src: builtins classes parser

From:
jonathan
Date:
December 5, 2008 11:19
Subject:
[svn:parrot] r33524 - in trunk/languages/perl6/src: builtins classes parser
Message ID:
20081205191909.408BACB9AF@x12.develooper.com
Author: jonathan
Date: Fri Dec  5 11:19:08 2008
New Revision: 33524

Modified:
   trunk/languages/perl6/src/builtins/any-list.pir
   trunk/languages/perl6/src/builtins/any-str.pir
   trunk/languages/perl6/src/builtins/control.pir
   trunk/languages/perl6/src/builtins/globals.pir
   trunk/languages/perl6/src/classes/Signature.pir
   trunk/languages/perl6/src/parser/actions.pm

Log:
[rakudo] Switch us from using Perl6Str to using Str. Either this, one of the Parrot changes that were required to make this work or something else entirely means we are failing a couple of tests in S02-builtin_data_types/bool.t. These relate to expecting an isa test for Int is a Num to work (it works with smartmatch, where we override the Num proto's ACCEPTS to specially handle this, but they aren't actually in a type relationshp); not sure how that test ever passed, and if we're really testing isa rather than just some kind of wider acceptance, I'm not completely sure they're correct.

Modified: trunk/languages/perl6/src/builtins/any-list.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/any-list.pir	(original)
+++ trunk/languages/perl6/src/builtins/any-list.pir	Fri Dec  5 11:19:08 2008
@@ -65,6 +65,7 @@
 .sub 'join' :multi('String')
     .param string sep
     .param pmc values          :slurpy
+say "in join"
     .tailcall values.'join'(sep)
 .end
 
@@ -72,6 +73,7 @@
 .sub 'join' :method :multi(_)
     .param string sep          :optional
     .param int has_sep         :opt_flag
+say "in join2"
     if has_sep goto have_sep
     sep = ' '
   have_sep:

Modified: trunk/languages/perl6/src/builtins/any-str.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/any-str.pir	(original)
+++ trunk/languages/perl6/src/builtins/any-str.pir	Fri Dec  5 11:19:08 2008
@@ -45,7 +45,7 @@
     .local pmc retv
     .local int len
 
-    retv = new 'Perl6Str'
+    retv = new 'Str'
     tmps = self
 
     len = length tmps
@@ -94,7 +94,7 @@
 
     tmps = self
     chopn tmps, 1
-    retv = new 'Perl6Str'
+    retv = new 'Str'
     retv = tmps
     .return(retv)
 .end
@@ -120,7 +120,7 @@
     if lastchar != "\n" goto done
     chopn tmps, 1
   done:
-       retv = new 'Perl6Str'
+       retv = new 'Str'
        retv = tmps
        .return (retv)
 .end
@@ -264,7 +264,7 @@
     tmps = self
     downcase tmps
 
-    retv = new 'Perl6Str'
+    retv = new 'Str'
     retv = tmps
 
     .return(retv)
@@ -284,7 +284,7 @@
     .local pmc retv
     .local int len
 
-    retv = new 'Perl6Str'
+    retv = new 'Str'
     tmps = self
 
     len = length tmps
@@ -559,7 +559,7 @@
     .return(retval)
 .end
 
-# TODO: Note the multisub type here should be 'Perl6Str' or 'Str', but mapping
+# TODO: Note the multisub type here should be 'Str' or 'Str', but mapping
 # issues currently prevent this from working correctly unless 'String' is used
 
 .sub '!transtable' :multi('String')
@@ -597,7 +597,7 @@
   process_pstring:
     unless prior, start_range
     $S2 = shift prior
-    next_str = new 'Perl6Str'
+    next_str = new 'Str'
     next_str = $S2
     push retval, next_str
     goto process_pstring
@@ -609,7 +609,7 @@
     # If needed we can switch this over to use a true string Range
     if $I0 > $I1 goto next_loop
     $S2 = chr $I0
-    next_str = new 'Perl6Str'
+    next_str = new 'Str'
     next_str = $S2
     push retval, next_str
     inc $I0
@@ -631,7 +631,7 @@
   process_lstring:
     unless prior, check_rval
     $S0 = shift prior
-    next_str = new 'Perl6Str'
+    next_str = new 'Str'
     next_str = $S0
     push retval, next_str
     goto process_lstring
@@ -665,7 +665,7 @@
     by = get_hll_global 'infix:<=>'
     # itable maps matching positions to key, value array
     itable = new 'Perl6Hash'
-    retv = new 'Perl6Str'
+    retv = new 'Str'
 
   init_pair_loop:
     .local pmc pair, pkey, pval, pairlist
@@ -723,7 +723,7 @@
     val = lastval
     goto init_index_loop
   get_prev2:
-    val = new 'Perl6Str'
+    val = new 'Str'
     val = ''
   init_index_loop:
     nhits = 0
@@ -819,7 +819,7 @@
   st_trans:
     .local int k_isa_match, v_isa_closure, pass_match
     .local pmc lastmatch, v
-    lastmatch = new 'Perl6Str'
+    lastmatch = new 'Str'
     lastmatch = ''
     pos = 0 # original unadjusted position
     pr_pos = 0 # prior unadjusted position
@@ -1021,7 +1021,7 @@
     tmps = self
     upcase tmps
 
-    retv = new 'Perl6Str'
+    retv = new 'Str'
     retv = tmps
 
     .return(retv)
@@ -1041,7 +1041,7 @@
     .local pmc retv
     .local int len
 
-    retv = new 'Perl6Str'
+    retv = new 'Str'
     tmps = self
 
     len = length tmps

Modified: trunk/languages/perl6/src/builtins/control.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/control.pir	(original)
+++ trunk/languages/perl6/src/builtins/control.pir	Fri Dec  5 11:19:08 2008
@@ -134,7 +134,7 @@
     .param pmc message        :optional
     .param int have_message   :opt_flag
     if have_message goto message_done
-    message = new 'Perl6Str'
+    message = new 'Str'
     message = "Attempt to execute stub code (...)"
   message_done:
     'fail'(message)

Modified: trunk/languages/perl6/src/builtins/globals.pir
==============================================================================
--- trunk/languages/perl6/src/builtins/globals.pir	(original)
+++ trunk/languages/perl6/src/builtins/globals.pir	Fri Dec  5 11:19:08 2008
@@ -38,17 +38,17 @@
     ##  set up $*OS, $*OSVER $*EXECUTABLE_NAME
     .local string info
     info = sysinfo .SYSINFO_PARROT_OS
-    $P0 = new 'Perl6Str'
+    $P0 = new 'Str'
     $P0 = info
     set_hll_global '$OS', $P0
 
     info = sysinfo .SYSINFO_PARROT_OS_VERSION
-    $P0 = new 'Perl6Str'
+    $P0 = new 'Str'
     $P0 = info
     set_hll_global '$OSVER', $P0
 
     info = interpinfo .INTERPINFO_EXECUTABLE_FULLNAME
-    $P0 = new 'Perl6Str'
+    $P0 = new 'Str'
     $P0 = info
     set_hll_global '$EXECUTABLE_NAME', $P0
 

Modified: trunk/languages/perl6/src/classes/Signature.pir
==============================================================================
--- trunk/languages/perl6/src/classes/Signature.pir	(original)
+++ trunk/languages/perl6/src/classes/Signature.pir	Fri Dec  5 11:19:08 2008
@@ -136,7 +136,7 @@
 
 .sub 'perl' :method
     .local pmc s
-    s = new 'Perl6Str'
+    s = new 'Str'
     concat s, ':('
 
     # Output parameters.

Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm	(original)
+++ trunk/languages/perl6/src/parser/actions.pm	Fri Dec  5 11:19:08 2008
@@ -2647,12 +2647,12 @@
 
 
 ##  for a variety of reasons, this is easier in PIR than NQP for now.
-##  NQP doesn't have assign yet, and Perl6Str is lighter-weight than Str.
+##  NQP doesn't have assign yet, and Str is lighter-weight than Str.
 method integer($/) {
     my $str;
     PIR q<  $P0 = find_lex '$/'   >;
     PIR q<  $S0 = $P0             >;
-    PIR q<  $P1 = new 'Perl6Str'  >;
+    PIR q<  $P1 = new 'Str'  >;
     PIR q<  assign $P1, $S0       >;
     PIR q<  store_lex '$str', $P1 >;
     make PAST::Val.new(
@@ -2667,7 +2667,7 @@
     my $str;
     PIR q<  $P0 = find_lex '$/'   >;
     PIR q<  $S0 = $P0             >;
-    PIR q<  $P1 = new 'Perl6Str'  >;
+    PIR q<  $P1 = new 'Str'  >;
     PIR q<  assign $P1, $S0       >;
     PIR q<  store_lex '$str', $P1 >;
     make PAST::Val.new(
@@ -2769,7 +2769,7 @@
     if ($key eq 'literal') {
         $past := PAST::Val.new(
             :value( ~$<quote_literal> ),
-            :returns('Perl6Str'), :node($/)
+            :returns('Str'), :node($/)
         );
     }
     elsif ($key eq 'variable') {
@@ -3242,7 +3242,7 @@
     my $past := PAST::Stmts.new();
 
     # What type of expression do we have?
-    if $expr.isa(PAST::Val) && $expr.returns() eq 'Perl6Str' {
+    if $expr.isa(PAST::Val) && $expr.returns() eq 'Str' {
         # Just a single string mapping.
         my $name := ~$expr.value();
         my $method := make_handles_method($/, $name, $name, $attr_name);
@@ -3257,7 +3257,7 @@
           $expr.name() eq 'list' {
         # List of something, but what is it?
         for @($expr) {
-            if $_.isa(PAST::Val) && $_.returns() eq 'Perl6Str' {
+            if $_.isa(PAST::Val) && $_.returns() eq 'Str' {
                 # String value.
                 my $name := ~$_.value();
                 my $method := make_handles_method($/, $name, $name, $attr_name);
@@ -3278,7 +3278,7 @@
     elsif $expr.isa(PAST::Stmts) && $expr[0].name() eq 'infix:,' {
         # Also a list, but constructed differently.
         for @($expr[0]) {
-            if $_.isa(PAST::Val) && $_.returns() eq 'Perl6Str' {
+            if $_.isa(PAST::Val) && $_.returns() eq 'Str' {
                 # String value.
                 my $name := ~$_.value();
                 my $method := make_handles_method($/, $name, $name, $attr_name);



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About