develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35374 - in branches/pdd09gc_part2: include/parrot languages/APL/tools languages/perl6/src/classes src

From:
allison
Date:
January 10, 2009 18:34
Subject:
[svn:parrot] r35374 - in branches/pdd09gc_part2: include/parrot languages/APL/tools languages/perl6/src/classes src
Message ID:
20090111023445.B8A98CB9F9@x12.develooper.com
Author: allison
Date: Sat Jan 10 18:34:44 2009
New Revision: 35374

Modified:
   branches/pdd09gc_part2/include/parrot/enums.h
   branches/pdd09gc_part2/languages/APL/tools/gen_operator_defs.pl
   branches/pdd09gc_part2/languages/perl6/src/classes/Signature.pir
   branches/pdd09gc_part2/src/inter_call.c

Log:
[pdd09gc] Bringing the pdd09gc_part2 branch up-to-date with trunk r35373.


Modified: branches/pdd09gc_part2/include/parrot/enums.h
==============================================================================
--- branches/pdd09gc_part2/include/parrot/enums.h	(original)
+++ branches/pdd09gc_part2/include/parrot/enums.h	Sat Jan 10 18:34:44 2009
@@ -59,7 +59,8 @@
     PARROT_ARG_OPTIONAL         = 0x080, /* 128 */
     PARROT_ARG_OPT_FLAG         = 0x100, /* 256 prev optional was set */
     PARROT_ARG_NAME             = 0x200, /* 512 this String is an arg name */
-    PARROT_ARG_INVOCANT         = 0x400  /* 1024 this PMC is an invocant */
+    PARROT_ARG_LOOKAHEAD        = 0x400, /* 1024 this is a lookahead argument */
+    PARROT_ARG_INVOCANT         = 0x800  /* 2048 this PMC is an invocant */
     /* more to come soon */
 
 } Call_bits_enum_t;

Modified: branches/pdd09gc_part2/languages/APL/tools/gen_operator_defs.pl
==============================================================================
--- branches/pdd09gc_part2/languages/APL/tools/gen_operator_defs.pl	(original)
+++ branches/pdd09gc_part2/languages/APL/tools/gen_operator_defs.pl	Sat Jan 10 18:34:44 2009
@@ -57,7 +57,7 @@
 
 .sub "__load_inlinetable" :load :init
     $P0 = new 'Hash'
-    store_global "APL", "%pirtable", $P0
+    set_hll_global ['APL'], "%pirtable", $P0
     .local pmc itable
     itable = new 'Hash'
     set_hll_global ['APL';'Grammar';'Actions'], '%inlinetable', itable

Modified: branches/pdd09gc_part2/languages/perl6/src/classes/Signature.pir
==============================================================================
--- branches/pdd09gc_part2/languages/perl6/src/classes/Signature.pir	(original)
+++ branches/pdd09gc_part2/languages/perl6/src/classes/Signature.pir	Sat Jan 10 18:34:44 2009
@@ -295,9 +295,19 @@
     unless $P0 goto err_param_type
     goto param_val_done
   param_array:
+    $I0 = does orig, 'Positional'
+    if $I0 goto param_array_1
+    $I0 = does orig, 'array'
+    unless $I0 goto err_array
+  param_array_1:
     var = '!CALLMETHOD'('Array', orig)
     goto param_val_done
   param_hash:
+    $I0 = does orig, 'Associative'
+    if $I0 goto param_hash_1
+    $I0 = does orig, 'hash'
+    unless $I0 goto err_hash
+  param_hash_1:
     var = '!CALLMETHOD'('Hash', orig)
   param_val_done:
     ## handle readonly/copy traits
@@ -321,12 +331,23 @@
   param_done:
   end:
     .return ()
+
   err_param_type:
-    $S0 = callersub
-    if $S0 goto have_callersub_name
-    $S0 = '<anon>'
-  have_callersub_name:
-    'die'('Parameter type check failed in call to ', $S0)
+    .local string errmsg
+    errmsg = 'Parameter type check failed'
+    goto err_throw
+  err_array:
+    errmsg = 'Non-Positional argument'
+    goto err_throw
+  err_hash:
+    errmsg = 'Non-Associative argument'
+  err_throw:
+    .local string callername
+    callername = callersub
+    if callername goto have_callername
+    callername = '<anon>'
+  have_callername:
+    'die'(errmsg, ' for ', name, ' in call to ', callername)
 .end
 
 

Modified: branches/pdd09gc_part2/src/inter_call.c
==============================================================================
--- branches/pdd09gc_part2/src/inter_call.c	(original)
+++ branches/pdd09gc_part2/src/inter_call.c	Sat Jan 10 18:34:44 2009
@@ -2146,6 +2146,7 @@
             case 's':
             case 'o':
             case 'p':
+            /* case 'l': */ /* lookahead parameter */
             case 'i':
                 break;
             default:
@@ -2474,6 +2475,7 @@
                 case 's': cur |= PARROT_ARG_SLURPY_ARRAY; break;
                 case 'o': cur |= PARROT_ARG_OPTIONAL;     break;
                 case 'p': cur |= PARROT_ARG_OPT_FLAG;     break;
+                case 'l': cur |= PARROT_ARG_LOOKAHEAD;    break;
                 case 'i': cur |= PARROT_ARG_INVOCANT;     break;
                 default:
                     Parrot_ex_throw_from_c_args(interp, NULL,
@@ -2552,6 +2554,8 @@
   s slurpy
   o optional
   p opt flag
+  l lookahead parameter (next positional, or next named if no positionals)
+  i invocant
 
   -> is the separator between args and results, similar to type theory
   notation.
@@ -2701,6 +2705,7 @@
                 case 's': cur |= PARROT_ARG_SLURPY_ARRAY; break;
                 case 'o': cur |= PARROT_ARG_OPTIONAL;     break;
                 case 'p': cur |= PARROT_ARG_OPT_FLAG;     break;
+                /* case 'l': cur |= PARROT_ARG_LOOKAHEAD;    break; */
                 default:
                     Parrot_ex_throw_from_c_args(interp, NULL,
                         EXCEPTION_INVALID_OPERATION,



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