cvsuser     05/01/10 11:58:14

  Modified:    .        MANIFEST
               config/gen/makefiles dynclasses.in
               dynclasses pyboundmeth.pmc pybuiltin.pmc pyclass.pmc
                        pyconsts.h pyfunc.pmc pylist.pmc pystring.pmc
                        pytuple.pmc
               src      spf_render.c
               t/dynclass pyfunc.t
  Added:       dynclasses pyboundcall.pmc
  Log:
  t/pie/b0 now completes parse
  
  Revision  Changes    Path
  1.819     +1 -0      parrot/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /cvs/public/parrot/MANIFEST,v
  retrieving revision 1.818
  retrieving revision 1.819
  diff -u -r1.818 -r1.819
  --- MANIFEST  9 Jan 2005 14:50:52 -0000       1.818
  +++ MANIFEST  10 Jan 2005 19:58:10 -0000      1.819
  @@ -363,6 +363,7 @@
   dynclasses/match.pmc                              [devel]
   dynclasses/matchrange.pmc                         [devel]
   dynclasses/pyboolean.pmc                          [devel]
  +dynclasses/pyboundcall.pmc                        [devel]
   dynclasses/pyboundmeth.pmc                        [devel]
   dynclasses/pybuiltin.pmc                          [devel]
   dynclasses/pycomplex.pmc                          [devel]
  
  
  
  1.24      +1 -0      parrot/config/gen/makefiles/dynclasses.in
  
  Index: dynclasses.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/makefiles/dynclasses.in,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- dynclasses.in     9 Jan 2005 04:18:02 -0000       1.23
  +++ dynclasses.in     10 Jan 2005 19:58:11 -0000      1.24
  @@ -19,6 +19,7 @@
     pyexception \
     pyfloat \
     pyfunc \
  +    pyboundcall \
       pyboundmeth \
       pynci \
       pystaticmeth \
  
  
  
  1.3       +3 -36     parrot/dynclasses/pyboundmeth.pmc
  
  Index: pyboundmeth.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pyboundmeth.pmc,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- pyboundmeth.pmc   9 Jan 2005 04:18:03 -0000       1.2
  +++ pyboundmeth.pmc   10 Jan 2005 19:58:12 -0000      1.3
  @@ -1,14 +1,14 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: pyboundmeth.pmc,v 1.2 2005/01/09 04:18:03 rubys Exp $
  +$Id: pyboundmeth.pmc,v 1.3 2005/01/10 19:58:12 rubys Exp $
   
   =head1 NAME
   
  -classes/nci.pmc - Python Native Call Interface Functions
  +classes/pyboundmeth.pmc - Python Bound Method
   
   =head1 DESCRIPTION
   
  -Extends Parrot's NCI to include attributes, implemented as properties.
  +A Python Method, bound to an object, and callable as a function
   
   =head2 Methods
   
  @@ -58,39 +58,6 @@
   
   /*
   
  -=item C<PMC *find_method(STRING *method_name)>
  -
  -Find a method call on the indicated object.
  -
  -=cut
  -
  -*/
  -
  -    PMC* find_method(STRING* method_name) {
  -        if (0 == string_compare(INTERP, method_name, PyString_call)) {
  -            int i = REG_INT(3)++;
  -            while (i--)
  -                REG_PMC(6+i)=REG_PMC(5+i);
  -            REG_PMC(5) = PMC_struct_val(SELF); 
  -        }
  -        return VTABLE_find_method(INTERP, PMC_pmc_val(SELF), method_name);
  -    }
  -/*
  -
  -=item C<PMC* get_attr_str(STRING *name)>
  -
  -Return attribute named C<name>.
  -
  -=cut
  -
  -*/
  -
  -    PMC* get_attr_str(STRING* idx) {
  -        return VTABLE_get_attr_str(INTERP, PMC_pmc_val(SELF), idx);
  -    }
  -
  -/*
  -
   =item C<STRING *get_string()>
   
   Return the representation of this object.
  
  
  
  1.46      +22 -1     parrot/dynclasses/pybuiltin.pmc
  
  Index: pybuiltin.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pybuiltin.pmc,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- pybuiltin.pmc     9 Jan 2005 04:18:03 -0000       1.45
  +++ pybuiltin.pmc     10 Jan 2005 19:58:12 -0000      1.46
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: pybuiltin.pmc,v 1.45 2005/01/09 04:18:03 rubys Exp $
  +$Id: pybuiltin.pmc,v 1.46 2005/01/10 19:58:12 rubys Exp $
   
   =head1 NAME
   
  @@ -84,6 +84,7 @@
           if (pass) {
               PyBuiltin_PyBoolean    = Parrot_PMC_typenum(INTERP, "PyBoolean");
               PyBuiltin_PyBoundMeth  = Parrot_PMC_typenum(INTERP, 
"PyBoundMeth");
  +            PyBuiltin_PyBoundCall  = Parrot_PMC_typenum(INTERP, 
"PyBoundCall");
               PyBuiltin_PyClass      = Parrot_PMC_typenum(INTERP, "PyClass");
               PyBuiltin_PyComplex    = Parrot_PMC_typenum(INTERP, "PyComplex");
               PyBuiltin_PyDict       = Parrot_PMC_typenum(INTERP, "PyDict");
  @@ -125,6 +126,10 @@
               PyString_str   = const_string(INTERP, "__str__");
   
               PyString_next  = const_string(INTERP, "next");
  +
  +            PyFunc_args     = const_string(INTERP, "func_args");
  +            PyFunc_varargs  = const_string(INTERP, "func_varargs");
  +            PyFunc_defaults = const_string(INTERP, "func_defaults");
           }
       }
   
  @@ -962,6 +967,22 @@
   
   /*
   
  +=item C<PMC* "repr"(PMC *value)>
  +
  +Returns the representation of C<value>.
  +
  +=cut
  +
  +*/
  +
  +    METHOD PMC* repr(PMC *value) {
  +        PMC * ret = pmc_new(INTERP, PyBuiltin_PyString);
  +        VTABLE_set_string_native(INTERP, ret, VTABLE_get_repr(INTERP, 
value));
  +        return ret;
  +    }
  +
  +/*
  +
   =back
   
   =cut
  
  
  
  1.24      +3 -1      parrot/dynclasses/pyclass.pmc
  
  Index: pyclass.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pyclass.pmc,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- pyclass.pmc       9 Jan 2005 04:18:03 -0000       1.23
  +++ pyclass.pmc       10 Jan 2005 19:58:12 -0000      1.24
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: pyclass.pmc,v 1.23 2005/01/09 04:18:03 rubys Exp $
  +$Id: pyclass.pmc,v 1.24 2005/01/10 19:58:12 rubys Exp $
   
   =head1 NAME
   
  @@ -373,6 +373,8 @@
   
       void* invoke(void* next) {
           PMC *call = VTABLE_find_method(INTERP, SELF, PyString_call);
  +        if (!REG_INT(3)) REG_INT(3)=1;
  +        REG_PMC(5) = SELF;
           return VTABLE_invoke(INTERP, call, next);
       }
   
  
  
  
  1.11      +5 -0      parrot/dynclasses/pyconsts.h
  
  Index: pyconsts.h
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pyconsts.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- pyconsts.h        9 Jan 2005 04:18:03 -0000       1.10
  +++ pyconsts.h        10 Jan 2005 19:58:12 -0000      1.11
  @@ -8,6 +8,7 @@
   
   PYVAR_SCOPE INTVAL PyBuiltin_PyBoolean;
   PYVAR_SCOPE INTVAL PyBuiltin_PyBoundMeth;
  +PYVAR_SCOPE INTVAL PyBuiltin_PyBoundCall;
   PYVAR_SCOPE INTVAL PyBuiltin_PyClass;
   PYVAR_SCOPE INTVAL PyBuiltin_PyComplex;
   PYVAR_SCOPE INTVAL PyBuiltin_PyDict;
  @@ -69,6 +70,10 @@
   PYVAR_SCOPE STRING *PyString_repr;
   PYVAR_SCOPE STRING *PyString_str;
   
  +PYVAR_SCOPE STRING *PyFunc_args;
  +PYVAR_SCOPE STRING *PyFunc_varargs;
  +PYVAR_SCOPE STRING *PyFunc_defaults;
  +
   /* utility functions */
   
   struct parrot_regs_t *
  
  
  
  1.14      +17 -81    parrot/dynclasses/pyfunc.pmc
  
  Index: pyfunc.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pyfunc.pmc,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- pyfunc.pmc        9 Jan 2005 04:18:03 -0000       1.13
  +++ pyfunc.pmc        10 Jan 2005 19:58:12 -0000      1.14
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: pyfunc.pmc,v 1.13 2005/01/09 04:18:03 rubys Exp $
  +$Id: pyfunc.pmc,v 1.14 2005/01/10 19:58:12 rubys Exp $
   
   =head1 NAME
   
  @@ -21,34 +21,10 @@
   #include "parrot/parrot.h"
   #include "pyconsts.h"
   
  -static STRING *FUNC_ARGS;
  -static STRING *FUNC_DEFAULTS;
  -static STRING *FUNC_VARARGS;
  -
   pmclass PyFunc extends Closure dynpmc group python_group {
   
   /*
   
  -=item C<void class_init()>
  -
  -Class initialization. Caches the type id of various PMCs because
  -they will be used frequently here.
  -
  -=cut
  -
  -*/
  -
  -    void class_init() {
  -        if (pass) {
  -            FUNC_ARGS = const_string(INTERP, "func_args");
  -            FUNC_VARARGS = const_string(INTERP, "func_varargs");
  -            FUNC_DEFAULTS = const_string(INTERP, "func_defaults");
  -        }
  -    }
  -
  -
  -/*
  -
   =item C<void init()>
   
   Create an (empty) list of function arguments
  @@ -61,7 +37,7 @@
           PMC *func_args;
           SUPER();
           func_args = pmc_new(INTERP, PyBuiltin_PyList);
  -        VTABLE_setprop(INTERP, SELF, FUNC_ARGS, func_args);
  +        VTABLE_setprop(INTERP, SELF, PyFunc_args, func_args);
       }
   
   /*
  @@ -76,58 +52,14 @@
   
   TODO: error checking (e.g., missing, duplicate or extra arguments)
   
  -XXX: the __call__ support is bad, bad, bad.  Consider the following
  -conversation: Do you have a __call__ method?  Sure!  Meanwhile I hope
  -you don't mind me rearranging your registers.  I hope you are intending
  -to call the method real soon...  Have a nice day!
  -
  -The right way to accomplish this would be to create a method-wrapper
  -object and return it.  And this overhead could be avoided in the normal
  -case if there were a VTABLE_call_method entry which unambiguously
  -involved a find_method in anticipation of an invoke.
  -
   */
   
       PMC* find_method(STRING* method_name) {
           if (0 == string_compare(INTERP, method_name, PyString_call)) {
  -            PMC *args = REG_PMC(5);
  -            PMC *keywords = REG_PMC(6);
  -            PMC *func_args = VTABLE_getprop(INTERP, SELF, FUNC_ARGS);
  -            PMC *func_defaults = VTABLE_getprop(INTERP, SELF, FUNC_DEFAULTS);
  -            INTVAL j;
  -
  -            INTVAL n = VTABLE_elements(INTERP, func_args);
  -            REG_INT(3) = n;
  -
  -            /* fill in defaults */
  -            if (func_defaults && VTABLE_defined(INTERP, func_defaults)) {
  -                INTVAL nd = VTABLE_elements(INTERP, func_defaults);
  -                for (j=n-nd; j<n && j<11; j++) {
  -                    REG_PMC(5+j) = VTABLE_get_pmc_keyed_int(INTERP,
  -                        func_defaults, j+nd-n);
  -                }
  -            }
  -
  -            /* fill in positional arguments */
  -            if (VTABLE_get_bool(INTERP, args)) {
  -                INTVAL np = VTABLE_elements(INTERP, args);
  -                for (j=0; j<np && j<11; j++) {
  -                    REG_PMC(5+j) = VTABLE_get_pmc_keyed_int(INTERP, args, j);
  -                }
  -            }
  -
  -            /* fill in keyword arguments */
  -            if (VTABLE_get_bool(INTERP, keywords)) {
  -                for (j=0; j<n && j<11; j++) {
  -                    PMC *name = VTABLE_get_pmc_keyed_int(INTERP, func_args, 
j);
  -                    if (VTABLE_exists_keyed(INTERP, keywords, name)) {
  -                        REG_PMC(5+j) =
  -                            VTABLE_get_pmc_keyed(INTERP, keywords, name);
  -                    }
  -                }
  -            }
  -
  -            return SELF;
  +            PMC *ret = pmc_new(INTERP, PyBuiltin_PyBoundCall);
  +            VTABLE_set_pointer(INTERP, ret, SELF);
  +            VTABLE_set_pmc(INTERP, ret, SELF);
  +            return ret;
           }
   
           return SUPER(method_name);
  @@ -202,13 +134,17 @@
   */
   
       void* invoke(void* next) {
  -        PMC *func_args = VTABLE_getprop(INTERP, SELF, FUNC_ARGS);
  -        PMC *func_varargs = VTABLE_getprop(INTERP, SELF, FUNC_VARARGS);
  -        INTVAL n = VTABLE_elements(INTERP, func_args);
  -        INTVAL j;
  +        PMC *func_args = VTABLE_getprop(INTERP, SELF, PyFunc_args);
  +        PMC *func_varargs = VTABLE_getprop(INTERP, SELF, PyFunc_varargs);
  +        INTVAL n,j;
  +
  +        if (func_args && VTABLE_defined(INTERP, func_args))
  +            n = VTABLE_elements(INTERP, func_args);
  +        else
  +            n = REG_INT(3);
   
           if (n > REG_INT(3)) {
  -            PMC *func_defaults = VTABLE_getprop(INTERP,SELF,FUNC_DEFAULTS);
  +            PMC *func_defaults = VTABLE_getprop(INTERP, SELF, 
PyFunc_defaults);
   
               if (func_defaults && VTABLE_defined(INTERP, func_defaults)) {
                   INTVAL nd = VTABLE_elements(INTERP, func_defaults);
  @@ -250,7 +186,7 @@
   */
   
       void set_integer_keyed_int (INTVAL key, INTVAL value) {
  -        PMC *func_args = VTABLE_getprop(INTERP, SELF, FUNC_ARGS);
  +        PMC *func_args = VTABLE_getprop(INTERP, SELF, PyFunc_args);
           VTABLE_set_integer_keyed_int(INTERP, func_args, key, value);
       }
   
  @@ -265,7 +201,7 @@
   */
   
       void set_string_keyed_int (INTVAL key, STRING* value) {
  -        PMC *func_args = VTABLE_getprop(INTERP, SELF, FUNC_ARGS);
  +        PMC *func_args = VTABLE_getprop(INTERP, SELF, PyFunc_args);
           VTABLE_set_string_keyed_int(INTERP, func_args, key, value);
       }
   
  
  
  
  1.22      +19 -3     parrot/dynclasses/pylist.pmc
  
  Index: pylist.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pylist.pmc,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- pylist.pmc        7 Jan 2005 03:09:39 -0000       1.21
  +++ pylist.pmc        10 Jan 2005 19:58:12 -0000      1.22
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: pylist.pmc,v 1.21 2005/01/07 03:09:39 rubys Exp $
  +$Id: pylist.pmc,v 1.22 2005/01/10 19:58:12 rubys Exp $
   
   =head1 NAME
   
  @@ -378,8 +378,9 @@
           List *list = (List *)PMC_data(SELF);
           PMC *ret = list_get(INTERP, list, key, enum_type_PMC);
   
  -        if (ret == (void*) -1)
  -            /* XXX throw IndexError: list index out of range */ ;
  +        if (!ret)
  +            real_exception(INTERP, NULL, E_IndexError,
  +                "IndexError: list index out of range");
           else {
               ret = *(PMC**) ret;
               if (ret == NULL)
  @@ -422,6 +423,21 @@
   
   /*
   
  +=item C<STRING* get_string_keyed(PMC* key)>
  +
  +Returns the PMC value of the element at index C<key> as a string.
  +
  +=cut
  +
  +*/
  +
  +    STRING* get_string_keyed (PMC* key) {
  +        PMC *item = VTABLE_get_pmc_keyed(INTERP, SELF, key);
  +        return VTABLE_get_string(INTERP, item);
  +    }
  +
  +/*
  +
   =item C<INTVAL is_equal (PMC* value)>
   
   The C<==> operation. Compares two array to hold equal elements.
  
  
  
  1.19      +33 -2     parrot/dynclasses/pystring.pmc
  
  Index: pystring.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pystring.pmc,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- pystring.pmc      4 Jan 2005 21:58:46 -0000       1.18
  +++ pystring.pmc      10 Jan 2005 19:58:12 -0000      1.19
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: pystring.pmc,v 1.18 2005/01/04 21:58:46 scog Exp $
  +$Id: pystring.pmc,v 1.19 2005/01/10 19:58:12 rubys Exp $
   
   =head1 NAME
   
  @@ -483,6 +483,37 @@
   
   /*
   
  +=item C<PMC* "join"(PMC *self, PMC *sequence)>
  +
  +Return True if all characters in S are whitespace and there is at least one
  +character in S, False otherwise.
  +
  +=cut
  +
  +*/
  +
  +    METHOD PMC* join (PMC *self, PMC *sequence) {
  +        PMC *ret = pmc_new(INTERP, PyBuiltin_PyString);
  +        PMC *iter = VTABLE_get_iter(INTERP, sequence);
  +        STRING *s;
  +
  +        if (!VTABLE_get_bool(INTERP, iter))
  +           s = string_from_cstring(INTERP, "", 0); 
  +        else {
  +           s = VTABLE_shift_string(INTERP, iter);
  +           while (VTABLE_get_bool(INTERP, iter)) {
  +               s = string_append(INTERP, s, PMC_str_val(self), 0);
  +               s = string_append(INTERP, s, 
  +                   VTABLE_get_string(INTERP, iter), 0);
  +           }
  +        }
  +
  +        VTABLE_set_string_native(INTERP, ret, s);
  +        return ret;
  +    }
  +
  +/*
  +
   =item C<PMC* "lower"(PMC *self)>
   
   downcase this string
  @@ -535,7 +566,7 @@
            * SELF is formatstring, value = argument array or item
            */
           /* TODO: figure out why C<DOES> doesn't work for dynclasses */
  -        if (value->vtable->base_type != enum_class_FixedPMCArray) {
  +        if (value->vtable->base_type != PyBuiltin_PyTuple) {
               /* not a tuple - make one */
               ar = pmc_new(INTERP, PyBuiltin_PyTuple);
               VTABLE_set_integer_native(INTERP, ar, 1);
  
  
  
  1.12      +3 -3      parrot/dynclasses/pytuple.pmc
  
  Index: pytuple.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pytuple.pmc,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- pytuple.pmc       3 Jan 2005 16:16:02 -0000       1.11
  +++ pytuple.pmc       10 Jan 2005 19:58:12 -0000      1.12
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: pytuple.pmc,v 1.11 2005/01/03 16:16:02 rubys Exp $
  +$Id: pytuple.pmc,v 1.12 2005/01/10 19:58:12 rubys Exp $
   
   =head1 NAME
   
  @@ -193,8 +193,8 @@
       PMC* get_pmc_keyed_int (INTVAL key) {
           PMC **data;
           if (key < 0 || key >= PMC_int_val(SELF))
  -            internal_exception(OUT_OF_BOUNDS,
  -                "PyTuple: index out of bounds!");
  +            real_exception(INTERP, NULL, E_IndexError,
  +                "IndexError: tuple index out of range");
   
           data = (PMC **)PMC_data(SELF);
           return data[key];
  
  
  
  1.1                  parrot/dynclasses/pyboundcall.pmc
  
  Index: pyboundcall.pmc
  ===================================================================
  /*
  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  $Id: pyboundcall.pmc,v 1.1 2005/01/10 19:58:12 rubys Exp $
  
  =head1 NAME
  
  classes/nci.pmc - Python Native Call Interface Functions
  
  =head1 DESCRIPTION
  
  Extends Parrot's NCI to include attributes, implemented as properties.
  
  =head2 Methods
  
  =over 4
  
  =cut
  
  */
  
  #include "parrot/parrot.h"
  #include "pyconsts.h"
  
  pmclass PyBoundCall extends PyBoundMeth dynpmc group python_group {
  
  /*
  
  =item C<void* invoke(void* next)>
  
  Invoke a method call on the indicated object.
  
  =cut
  
  */
  
      void* invoke(void* next) {
          PMC *self = REG_PMC(5);
          PMC *args = REG_PMC(6);
          PMC *keywords = REG_PMC(7);
          PMC *func_args = VTABLE_getprop(INTERP, self, PyFunc_args);
          PMC *func_defaults = VTABLE_getprop(INTERP, self, PyFunc_defaults);
          INTVAL j,n;
  
          if (func_args && VTABLE_defined(INTERP, func_args))
              n = VTABLE_elements(INTERP, func_args);
          else
              n = VTABLE_elements(INTERP, args);
  
          REG_INT(3) = n;
  
          /* fill in defaults */
          if (func_defaults && VTABLE_defined(INTERP, func_defaults)) {
              INTVAL nd = VTABLE_elements(INTERP, func_defaults);
              for (j=n-nd; j<n && j<11; j++) {
                  REG_PMC(5+j) = VTABLE_get_pmc_keyed_int(INTERP,
                      func_defaults, j+nd-n);
              }
          }
  
          /* fill in positional arguments */
          if (VTABLE_get_bool(INTERP, args)) {
              INTVAL np = VTABLE_elements(INTERP, args);
              for (j=0; j<np && j<11; j++) {
                  REG_PMC(5+j) = VTABLE_get_pmc_keyed_int(INTERP, args, j);
              }
          }
  
          /* fill in keyword arguments */
          if (VTABLE_get_bool(INTERP, keywords)) {
              for (j=0; j<n && j<11; j++) {
                  PMC *name = VTABLE_get_pmc_keyed_int(INTERP, func_args, j);
                  if (VTABLE_exists_keyed(INTERP, keywords, name)) {
                      REG_PMC(5+j) =
                          VTABLE_get_pmc_keyed(INTERP, keywords, name);
                  }
              }
          }
  
          return VTABLE_invoke(INTERP, PMC_pmc_val(SELF), next);
      }
  
  }
  
  /*
  
  =back
  
  =head1 SEE ALSO
  
  F<docs/pdds/pdd03_calling_conventions.pod>.
  
  =head1 HISTORY
  
  Initial revision by sean 2002/08/04.
  
  =cut
  
  */
  
  /*
   * Local variables:
   * c-indentation-style: bsd
   * c-basic-offset: 4
   * indent-tabs-mode: nil
   * End:
   *
   * vim: expandtab shiftwidth=4:
  */
  
  
  
  1.36      +20 -2     parrot/src/spf_render.c
  
  Index: spf_render.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/spf_render.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- spf_render.c      28 Sep 2004 08:51:48 -0000      1.35
  +++ spf_render.c      10 Jan 2005 19:58:13 -0000      1.36
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: spf_render.c,v 1.35 2004/09/28 08:51:48 leo Exp $
  +$Id: spf_render.c,v 1.36 2005/01/10 19:58:13 rubys Exp $
   
   =head1 NAME
   
  @@ -689,8 +689,26 @@
                               break;
   
                               /* STRINGS */
  +                        case 'r':        /* Python repr */
  +                            /* XXX the right fix is to add a getrepr entry *
  +                             * to SPRINTF_OBJ, but for now, getstring_pmc  *
  +                             * is inlined and modified to call get_repr    */
  +                            if (obj->getstring == pmc_core.getstring) {
  +                                PMC *tmp = 
VTABLE_get_pmc_keyed_int(interpreter,
  +                                    ((PMC *)obj->data), (obj->index));
  +                               
  +                                obj->index++;
  +                                string = (VTABLE_get_repr(interpreter, tmp));
  +
  +                                ts = handle_flags(interpreter, &info, string,
  +                                    0, NULL);
  +
  +                                string_append(interpreter, targ, ts, 0);
  +
  +                                break;
  +                            }
  +
                           case 's':
  -                        case 'r':        /* Python repr??? */
                             CASE_s:
                               string = obj->getstring
                                   (interpreter, info.type, obj);
  
  
  
  1.2       +7 -7      parrot/t/dynclass/pyfunc.t
  
  Index: pyfunc.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/dynclass/pyfunc.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pyfunc.t  2 Dec 2004 14:56:47 -0000       1.1
  +++ pyfunc.t  10 Jan 2005 19:58:14 -0000      1.2
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: pyfunc.t,v 1.1 2004/12/02 14:56:47 rubys Exp $
  +# $Id: pyfunc.t,v 1.2 2005/01/10 19:58:14 rubys Exp $
   
   =head1 NAME
   
  @@ -106,15 +106,15 @@
       find_type $I2, "PyDict"
       new $P2, $I2
   
  -    $P0.__call__($P1, $P2)
  +    $P0.__call__($P0, $P1, $P2)
   
       push $P1, "one"
   
  -    $P0.__call__($P1, $P2)
  +    $P0.__call__($P0, $P1, $P2)
   
       push $P1, "two"
   
  -    $P0.__call__($P1, $P2)
  +    $P0.__call__($P0, $P1, $P2)
   .end
   CODE
   uno dos tres
  @@ -134,15 +134,15 @@
   
       $P2['y'] = "two"
   
  -    $P0.__call__($P1, $P2)
  +    $P0.__call__($P0, $P1, $P2)
   
       $P2['z'] = "three"
   
  -    $P0.__call__($P1, $P2)
  +    $P0.__call__($P0, $P1, $P2)
   
       $P2['x'] = "one"
   
  -    $P0.__call__($P1, $P2)
  +    $P0.__call__($P0, $P1, $P2)
   .end
   CODE
   uno two tres
  
  
  

Reply via email to