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

[svn:parrot] r35372 - in trunk: include/parrot src

From:
Whiteknight
Date:
January 10, 2009 18:03
Subject:
[svn:parrot] r35372 - in trunk: include/parrot src
Message ID:
20090111020304.CAA66CB9F9@x12.develooper.com
Author: Whiteknight
Date: Sat Jan 10 18:03:04 2009
New Revision: 35372

Modified:
   trunk/include/parrot/enums.h
   trunk/src/inter_call.c

Log:
[Core] add some basic infrastructure for :lookahead parameters, although it's all commented-out now

Modified: trunk/include/parrot/enums.h
==============================================================================
--- trunk/include/parrot/enums.h	(original)
+++ trunk/include/parrot/enums.h	Sat Jan 10 18:03:04 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: trunk/src/inter_call.c
==============================================================================
--- trunk/src/inter_call.c	(original)
+++ trunk/src/inter_call.c	Sat Jan 10 18:03:04 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