Author: coke
Date: Fri Oct 21 08:19:55 2005
New Revision: 9528
Modified:
trunk/build_tools/pmc2c.pl
trunk/classes/boolean.pmc
trunk/t/pmc/boolean.t
Log:
Add a 'boolean' category for does types, and have boolean implement it.
Modified: trunk/build_tools/pmc2c.pl
==============================================================================
--- trunk/build_tools/pmc2c.pl (original)
+++ trunk/build_tools/pmc2c.pl Fri Oct 21 08:19:55 2005
@@ -158,6 +158,7 @@ The default is "scalar". Other currently
library : PMC that corresponds to a dynamic library
ref : PMC that references another PMC
string : PMC that behaves similarly to the base string type
+ boolean : PMC that does true/false only.
integer : PMC that behaves similarly to the base int type
float : PMC that behaves similarly to the base number type
scalar : (only used by the sample dynclasses/foo.pmc)
Modified: trunk/classes/boolean.pmc
==============================================================================
--- trunk/classes/boolean.pmc (original)
+++ trunk/classes/boolean.pmc Fri Oct 21 08:19:55 2005
@@ -24,7 +24,7 @@ it doesn't morph to other types. Only it
#include "parrot/parrot.h"
#include "parrot/perltypes.h"
-pmclass Boolean extends Integer {
+pmclass Boolean extends Integer does boolean does scalar {
/*
Modified: trunk/t/pmc/boolean.t
==============================================================================
--- trunk/t/pmc/boolean.t (original)
+++ trunk/t/pmc/boolean.t Fri Oct 21 08:19:55 2005
@@ -272,6 +272,9 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "c
does bool1, pmc1, "scalar"
print bool1
print "\n"
+ does bool1, pmc1, "boolean"
+ print bool1
+ print "\n"
does bool1, pmc1, "no_interface"
print bool1
print "\n"
@@ -279,6 +282,7 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "c
.end
CODE
1
+1
0
OUTPUT