Author: autrijus
Date: Sat Mar 11 11:12:31 2006
New Revision: 11867

Modified:
   trunk/MANIFEST
   trunk/languages/pugs/config/makefiles/root.in   (contents, props changed)
   trunk/languages/pugs/include/pugs_common.h   (contents, props changed)
   trunk/languages/pugs/pmc/pugsany.pmc   (contents, props changed)
   trunk/languages/pugs/pmc/pugsbit.pmc   (contents, props changed)
   trunk/languages/pugs/pmc/pugsbool.pmc   (contents, props changed)
   trunk/languages/pugs/pmc/pugsint.pmc   (contents, props changed)
   trunk/languages/pugs/pmc/pugsnum.pmc   (contents, props changed)
   trunk/languages/pugs/pmc/pugsstr.pmc   (contents, props changed)
   trunk/languages/pugs/t/harness   (props changed)
   trunk/languages/pugs/t/pmc/bit.t   (contents, props changed)

Log:
* pugs: reorgnize the inheritance lattice for values; nativize eol.

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Sat Mar 11 11:12:31 2006
@@ -1005,11 +1005,13 @@
 languages/lua/t/pmc/thread.t                      [lua]
 languages/lua/t/pmc/userdata.t                    [lua]
 languages/pugs/config/makefiles/root.in           [pugs]
+languages/pugs/include/pugs_common.h              [pugs]
 languages/pugs/pmc/pugsany.pmc                    [pugs]
+languages/pugs/pmc/pugsbit.pmc                    [pugs]
+languages/pugs/pmc/pugsbool.pmc                   [pugs]
 languages/pugs/pmc/pugsint.pmc                    [pugs]
 languages/pugs/pmc/pugsnum.pmc                    [pugs]
 languages/pugs/pmc/pugsstr.pmc                    [pugs]
-languages/pugs/include/pugs_common.h              [pugs]
 languages/pugs/t/harness                          [pugs]
 languages/pugs/t/pmc/bit.t                        [pugs]
 languages/m4/BUGS                                 [m4]

Modified: trunk/languages/pugs/config/makefiles/root.in
==============================================================================
--- trunk/languages/pugs/config/makefiles/root.in       (original)
+++ trunk/languages/pugs/config/makefiles/root.in       Sat Mar 11 11:12:31 2006
@@ -13,6 +13,7 @@
 PMCS = \
  pugsany \
  pugsbit \
+ pugsbool \
  pugsint \
  pugsnum \
  pugsstr

Modified: trunk/languages/pugs/include/pugs_common.h
==============================================================================
--- trunk/languages/pugs/include/pugs_common.h  (original)
+++ trunk/languages/pugs/include/pugs_common.h  Sat Mar 11 11:12:31 2006
@@ -1,9 +1,9 @@
 #if !defined(PARROT_PUGS_COMMONL_H_GUARD)
 #define PARROT_PUGS_COMMONL_H_GUARD
 
-#ifndef PUGS_BIT
-extern PMC *pugs_bit_true;
-extern PMC *pugs_bit_false;
+#ifndef PUGS_BOOL
+extern PMC *pugs_bool_true;
+extern PMC *pugs_bool_false;
 #endif
 
 #endif

Modified: trunk/languages/pugs/pmc/pugsany.pmc
==============================================================================
--- trunk/languages/pugs/pmc/pugsany.pmc        (original)
+++ trunk/languages/pugs/pmc/pugsany.pmc        Sat Mar 11 11:12:31 2006
@@ -29,6 +29,6 @@
 
     METHOD PMC* not_nil() {
         INTVAL retval = VTABLE_defined(INTERP, SELF);
-        return retval ? pugs_bit_true : pugs_bit_false;
+        return retval ? pugs_bool_true : pugs_bool_false;
     }
 }

Modified: trunk/languages/pugs/pmc/pugsbit.pmc
==============================================================================
--- trunk/languages/pugs/pmc/pugsbit.pmc        (original)
+++ trunk/languages/pugs/pmc/pugsbit.pmc        Sat Mar 11 11:12:31 2006
@@ -18,16 +18,9 @@
 
 */
 
-#define PUGS_BIT
-
 #include "parrot/parrot.h"
-#include "pmc_pugsbit.h"
-#include "../include/pugs_common.h"
-
-PMC *pugs_bit_true;
-PMC *pugs_bit_false;
 
-pmclass PugsBit
+pmclass PugsBit extends PugsAny
     extends Boolean
     does scalar
     does boolean
@@ -35,14 +28,7 @@
     dynpmc
     group pugs_group
     hll Perl6
-    maps Boolean
 {
-    void class_init() {
-        /* generate a PugsBitTrue and a PugsBitFalse here */
-        pugs_bit_true  = pmc_new(interp, entry);
-        pugs_bit_false = pmc_new(interp, entry);
-        VTABLE_set_integer_native(interp, pugs_bit_true, 1);
-    }
 }
 
 /*

Modified: trunk/languages/pugs/pmc/pugsbool.pmc
==============================================================================
--- trunk/languages/pugs/pmc/pugsbool.pmc       (original)
+++ trunk/languages/pugs/pmc/pugsbool.pmc       Sat Mar 11 11:12:31 2006
@@ -18,16 +18,16 @@
 
 */
 
-#define PUGS_BIT
+#define PUGS_BOOL
 
 #include "parrot/parrot.h"
-#include "pmc_pugsbit.h"
+#include "pmc_pugsbool.h"
 #include "../include/pugs_common.h"
 
-PMC *pugs_bit_true;
-PMC *pugs_bit_false;
+PMC *pugs_bool_true;
+PMC *pugs_bool_false;
 
-pmclass PugsBit
+pmclass PugsBool extends PugsAny
     extends Boolean
     does scalar
     does boolean
@@ -38,10 +38,10 @@
     maps Boolean
 {
     void class_init() {
-        /* generate a PugsBitTrue and a PugsBitFalse here */
-        pugs_bit_true  = pmc_new(interp, entry);
-        pugs_bit_false = pmc_new(interp, entry);
-        VTABLE_set_integer_native(interp, pugs_bit_true, 1);
+        /* generate a bool::true and a bool::false here */
+        pugs_bool_true  = pmc_new(interp, entry);
+        pugs_bool_false = pmc_new(interp, entry);
+        VTABLE_set_integer_native(interp, pugs_bool_true, 1);
     }
 }
 

Modified: trunk/languages/pugs/pmc/pugsint.pmc
==============================================================================
--- trunk/languages/pugs/pmc/pugsint.pmc        (original)
+++ trunk/languages/pugs/pmc/pugsint.pmc        Sat Mar 11 11:12:31 2006
@@ -20,9 +20,8 @@
 
 #include "parrot/parrot.h"
 
-pmclass PugsInt
+pmclass PugsInt extends PugsAny
     extends Integer
-    extends PugsAny
     does scalar
     does integer
     dynpmc

Modified: trunk/languages/pugs/pmc/pugsnum.pmc
==============================================================================
--- trunk/languages/pugs/pmc/pugsnum.pmc        (original)
+++ trunk/languages/pugs/pmc/pugsnum.pmc        Sat Mar 11 11:12:31 2006
@@ -20,9 +20,8 @@
 
 #include "parrot/parrot.h"
 
-pmclass PugsNum
+pmclass PugsNum extends PugsAny
     extends Float
-    extends PugsAny
     does scalar
     does float
     dynpmc

Modified: trunk/languages/pugs/pmc/pugsstr.pmc
==============================================================================
--- trunk/languages/pugs/pmc/pugsstr.pmc        (original)
+++ trunk/languages/pugs/pmc/pugsstr.pmc        Sat Mar 11 11:12:31 2006
@@ -20,9 +20,8 @@
 
 #include "parrot/parrot.h"
 
-pmclass PugsStr
+pmclass PugsStr extends PugsAny
     extends String
-    extends PugsAny
     does scalar
     does string
     dynpmc

Modified: trunk/languages/pugs/t/pmc/bit.t
==============================================================================
--- trunk/languages/pugs/t/pmc/bit.t    (original)
+++ trunk/languages/pugs/t/pmc/bit.t    Sat Mar 11 11:12:31 2006
@@ -1,41 +1,41 @@
-#! perl -w

-# Copyright: 2005-2006 The Perl Foundation.  All Rights Reserved.

-# $Id: /mirror/trunk/languages/lua/t/pmc/boolean.t 11586 
2006-02-16T17:44:54.559622Z fperrad  $

-

-=head1 NAME

-

-t/pmc/bit.t - PugsBit

-

-=head1 SYNOPSIS

-

-    % perl -I../../lib t/pmc/bit.t

-

-=cut

-

-use Parrot::Test 'no_plan';

-use Test::More;

-

-pir_output_is(<< 'CODE', << 'OUTPUT', "check sanity");

-.sub _main

-    loadlib $P1, "pugs_group"

-    $I0 = defined $P1 

-    if $I0 goto ok

-    print "not "

-ok:

-    print "ok\n"

-.end

-CODE

-ok

-OUTPUT

-

-pir_output_is(<< 'CODE', << 'OUTPUT', "check sanity");

-.HLL "Perl6", "pugs_group"

-.sub _main

-    .local pmc pmc1

-    pmc1 = new .PugsBit

-    print "ok\n"

-.end

-CODE

-ok

-OUTPUT

-

+#! perl -w
+# Copyright: 2005-2006 The Perl Foundation.  All Rights Reserved.
+# $Id: /mirror/trunk/languages/lua/t/pmc/boolean.t 11586 
2006-02-16T17:44:54.559622Z fperrad  $
+
+=head1 NAME
+
+t/pmc/bit.t - PugsBit
+
+=head1 SYNOPSIS
+
+    % perl -I../../lib t/pmc/bit.t
+
+=cut
+
+use Parrot::Test 'no_plan';
+use Test::More;
+
+pir_output_is(<< 'CODE', << 'OUTPUT', "check sanity");
+.sub _main
+    loadlib $P1, "pugs_group"
+    $I0 = defined $P1 
+    if $I0 goto ok
+    print "not "
+ok:
+    print "ok\n"
+.end
+CODE
+ok
+OUTPUT
+
+pir_output_is(<< 'CODE', << 'OUTPUT', "check sanity");
+.HLL "Perl6", "pugs_group"
+.sub _main
+    .local pmc pmc1
+    pmc1 = new .PugsBit
+    print "ok\n"
+.end
+CODE
+ok
+OUTPUT
+

Reply via email to