cvsuser     04/12/24 15:08:32

  Modified:    .        MANIFEST
               config/gen/makefiles dynclasses.in
               dynclasses pybuiltin.pmc pyconsts.h
               languages/python/t/pie b6.t
               src      call_list.txt
  Added:       dynclasses pyslice.pmc
  Log:
  Pass b6 - fdiv
  
  Revision  Changes    Path
  1.812     +1 -0      parrot/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /cvs/public/parrot/MANIFEST,v
  retrieving revision 1.811
  retrieving revision 1.812
  diff -u -r1.811 -r1.812
  --- MANIFEST  24 Dec 2004 04:41:54 -0000      1.811
  +++ MANIFEST  24 Dec 2004 23:08:28 -0000      1.812
  @@ -382,6 +382,7 @@
   dynclasses/pyobject.pmc                           [devel]
   dynclasses/pyproxyclass.pmc                       [devel]
   dynclasses/pyproxytype.pmc                        [devel]
  +dynclasses/pyslice.pmc                            [devel]
   dynclasses/pystring.pmc                           [devel]
   dynclasses/pytuple.pmc                            [devel]
   dynclasses/pytype.pmc                             [devel]
  
  
  
  1.19      +2 -1      parrot/config/gen/makefiles/dynclasses.in
  
  Index: dynclasses.in
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/makefiles/dynclasses.in,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- dynclasses.in     21 Dec 2004 17:37:40 -0000      1.18
  +++ dynclasses.in     24 Dec 2004 23:08:29 -0000      1.19
  @@ -27,6 +27,7 @@
     pymodule \
     pynone \
     pytype \
  +  pyslice \
     pystring \
     pytuple \
   pyproxytype \
  @@ -48,7 +49,7 @@
        $(RM_F) ../t/dynclass/*.imc
   
   clean : testclean
  -     $(RM_F) *.c *.h *$(LOAD_EXT) *.dump lib-* *$(O)
  +     $(RM_F) *.c pmc_*.h *_group.h *$(LOAD_EXT) *.dump lib-* *$(O)
   
   realclean: clean
        $(RM_F) Makefile build.pl
  
  
  
  1.35      +5 -3      parrot/dynclasses/pybuiltin.pmc
  
  Index: pybuiltin.pmc
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pybuiltin.pmc,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- pybuiltin.pmc     23 Dec 2004 23:49:32 -0000      1.34
  +++ pybuiltin.pmc     24 Dec 2004 23:08:30 -0000      1.35
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: pybuiltin.pmc,v 1.34 2004/12/23 23:49:32 rubys Exp $
  +$Id: pybuiltin.pmc,v 1.35 2004/12/24 23:08:30 rubys Exp $
   
   =head1 NAME
   
  @@ -96,6 +96,7 @@
               PyBuiltin_PyObject     = Parrot_PMC_typenum(INTERP, "PyObject");
               PyBuiltin_PyProxyClass = Parrot_PMC_typenum(INTERP, 
"PyProxyClass");
               PyBuiltin_PyProxyType  = Parrot_PMC_typenum(INTERP, 
"PyProxyType");
  +            PyBuiltin_PySlice      = Parrot_PMC_typenum(INTERP, "PySlice");
               PyBuiltin_PyString     = Parrot_PMC_typenum(INTERP, "PyString");
               PyBuiltin_PyTuple      = Parrot_PMC_typenum(INTERP, "PyTuple");
               PyBuiltin_PyType       = Parrot_PMC_typenum(INTERP, "PyType");
  @@ -265,10 +266,11 @@
           scratchpad_store_by_name(INTERP, pad, 0, key, item);
           PyBuiltin_PyTuple_class = item;
   
  -        /* TODO: convert this to instances of <type> */
           key = const_string(INTERP, "xrange");
  -        item = pmc_new(INTERP, enum_class_Slice);
  +        item = make_type(INTERP, PyBuiltin_PySlice, key);
  +        VTABLE_setprop(INTERP, item, PyString_bases, parent);
           scratchpad_store_by_name(INTERP, pad, 0, key, item);
  +        PyBuiltin_PySlice_class = item;
   
           /* Begin main! */
           item = pmc_new(INTERP, PyBuiltin_PyString);
  
  
  
  1.2       +2 -0      parrot/dynclasses/pyconsts.h
  
  Index: pyconsts.h
  ===================================================================
  RCS file: /cvs/public/parrot/dynclasses/pyconsts.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pyconsts.h        23 Dec 2004 23:49:32 -0000      1.1
  +++ pyconsts.h        24 Dec 2004 23:08:30 -0000      1.2
  @@ -15,6 +15,7 @@
   INTVAL PyBuiltin_PyNone;
   INTVAL PyBuiltin_PyProxyClass;
   INTVAL PyBuiltin_PyProxyType;
  +INTVAL PyBuiltin_PySlice;
   INTVAL PyBuiltin_PyString;
   INTVAL PyBuiltin_PyTuple;
   INTVAL PyBuiltin_PyType;
  @@ -28,6 +29,7 @@
   PMC *PyBuiltin_PyFloat_class;
   PMC *PyBuiltin_PyList_class;
   PMC *PyBuiltin_PyLong_class;
  +PMC *PyBuiltin_PySlice_class;
   PMC *PyBuiltin_PyTuple_class;
   
   /* constant strings */
  
  
  
  1.1                  parrot/dynclasses/pyslice.pmc
  
  Index: pyslice.pmc
  ===================================================================
  /*
  Copyright: 2004 The Perl Foundation.  All Rights Reserved.
  $Id: pyslice.pmc,v 1.1 2004/12/24 23:08:30 rubys Exp $
  
  =head1 NAME
  
  dynclasses/pyslice.pmc - Python Slice PMC
  
  =head1 DESCRIPTION
  
  These are the vtable functions for the Python slice PMC class.
  
  =head2 Methods
  
  =over 4
  
  =cut
  
  */
  
  #include "parrot/parrot.h"
  #include "pyconsts.h"
  
  pmclass PySlice need_ext extends Slice dynpmc group python_group {
  
  /*
  
  =item C<PMC* "__new__"(PMC *class, PMC *start, PMC *stop, PMC *step)>
  
  Create a new slice
  
  =cut
  
  */
  
      METHOD PMC* __new__(PMC *class, PMC *start, PMC *stop, PMC *step) {
          int argcP = REG_INT(3);
          PMC *xro = pmc_new_noinit(INTERP, PyBuiltin_PySlice);
  
          parrot_range_t *range = mem_sys_allocate(sizeof *range);
  
          PMC_struct_val(xro) = range;
          range->next = NULL;
          range->type = enum_type_INTVAL;
          if (argcP == 2) {
              RVal_int(range->start) = 0;
              RVal_int(range->end) = VTABLE_get_integer(INTERP, start);
              RVal_int(range->step) = 1;
          }
          else if (argcP == 3) {
              RVal_int(range->start) = VTABLE_get_integer(INTERP, start);
              RVal_int(range->end) = VTABLE_get_integer(INTERP, stop);
              RVal_int(range->step) = 1;
          }
          else if (argcP == 4) {
              RVal_int(range->start) = VTABLE_get_integer(INTERP, start);
              RVal_int(range->end) = VTABLE_get_integer(INTERP, stop);
              RVal_int(range->step) = VTABLE_get_integer(INTERP, step);
              if (RVal_int(range->step) == 0)
                  real_exception(interpreter, NULL, E_ValueError,
                          "xrange() step argument must not be zero");
          }
          else
              real_exception(INTERP, NULL, E_TypeError,
                      "xrange() requires 1-3 int arguments");
          RVal_int(range->cur) = RVal_int(range->start);
          if (RVal_int(range->step) > 0)
              RVal_int(range->end)--;
          else
              RVal_int(range->end)++;
          PMC_pmc_val(xro) = pmc_new_noinit(INTERP, PyBuiltin_PyInt);
          PObj_custom_mark_destroy_SETALL(xro);
          return xro;
      }
  
  /*
  
  =item C<PMC *get_class()>
  
  Return the class of this object.
  
  =cut
  
  */
  
      PMC* get_class() {
          return PyBuiltin_PySlice_class;
      }
  
  /*
  
  =item C<void* invoke(void*)>
  
  Invoke is not supported by instances.
  
  =cut
  
  */
  
      void* invoke(void *next) {
          return Parrot_default_invoke(INTERP, SELF, next);
      }
  
  }
  
  /*
  
  =back
  
  =cut
  
  */
  
  /*
   * Local variables:
   * c-indentation-style: bsd
   * c-basic-offset: 4
   * indent-tabs-mode: nil
   * End:
   *
   * vim: expandtab shiftwidth=4:
  */
  
  
  
  1.6       +3 -3      parrot/languages/python/t/pie/b6.t
  
  Index: b6.t
  ===================================================================
  RCS file: /cvs/public/parrot/languages/python/t/pie/b6.t,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- b6.t      23 Dec 2004 17:38:43 -0000      1.5
  +++ b6.t      24 Dec 2004 23:08:31 -0000      1.6
  @@ -1,4 +1,4 @@
  -# $Id: b6.t,v 1.5 2004/12/23 17:38:43 rubys Exp $
  +# $Id: b6.t,v 1.6 2004/12/24 23:08:31 rubys Exp $
   
   use strict;
   use lib '../../lib';
  @@ -54,8 +54,6 @@
       main()
   CODE
   
  -SKIP: {
  -  skip("dictionaries with non-string keys", 2);
   test(<<'CODE', 'b6 - fdiv');
   # from b5 import check
   show = True
  @@ -82,6 +80,8 @@
       main()
   CODE
   
  +SKIP: {
  +  skip("dictionaries with non-string keys", 1);
   test(<<'CODE', 'b6');
   show=True
   # from b5 import check
  
  
  
  1.51      +1 -0      parrot/src/call_list.txt
  
  Index: call_list.txt
  ===================================================================
  RCS file: /cvs/public/parrot/src/call_list.txt,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- call_list.txt     2 Dec 2004 14:56:46 -0000       1.50
  +++ call_list.txt     24 Dec 2004 23:08:32 -0000      1.51
  @@ -251,6 +251,7 @@
   P    IOPP
   P    IOPPP
   v    IOPP
  +P    IOPPPP
   
   # Parrot builtins
   d    IOd
  
  
  

Reply via email to