// joycub V2 - an interpeter for the programming language Joy
// (c) 2004-2006 Sergey Zubkov 
// prototype.cc - prototype module to test out the new design considerations
static char RCSID[] ="$Id: bool.cc,v 1.1 2006/02/27 18:50:34 cubbi Exp cubbi $";

#include <iostream>
#include "exceptions.h"
#include "bool.h"

// global object counters (for memory debugging)
int bool_type_count = 0;

JC_bool::JC_bool(bool i) : JC_int(i ? 1 : 0) {
	bool_type_count++;
};

JC_bool::JC_bool(const std::string& s) {
	if (s=="true")  JC_int(1);
	else if (s=="false") JC_int(0);
	else throw ("cannot convert " + s + " to bool");
	bool_type_count++;
}

JC_bool::JC_bool(const JC_bool& j) {
	content = j.content;
	_key = j._key;
	bool_type_count++;
};

JC_bool::~JC_bool(void) {
	bool_type_count--;
};
