Index: source/interpreter.d
===================================================================
--- source/interpreter.d	(revision 112)
+++ source/interpreter.d	(working copy)
@@ -4,14 +4,17 @@
 	structure,
 	text,
 	value;
-
+
+	
+	
+	
 void parse(Value self, Value cc)
 {
-	const(char)[] source = self.s;
-	const(char)*
+	const_char[] source = self.s;
+	const_char*
 		p, 
 		pStart,
-		last = &source[$];
+		last = &source[length-1];
 	size_t
 		line = 1;
 	Value[] buffer;
@@ -25,19 +28,23 @@
 		}
 		if(v.type == TYPE.EOF) {
 			// evaluate the contents of the buffer.
-			return;
+			break;
 		}
 		if(v.type == TYPE.SEMI) {
 			// evaluate the contents of the buffer.
 			continue;
 		}
 		buffer ~= v;
+	}
+	foreach(b; buffer) {
+		std.stdio.writefln("GOT TOK %s", b.toString());
 	}
 }
 
-Value tokenize(ref const(char)* p, const(char)* pStart, const(char)* last, ref size_t line, Value cc)
+Value tokenize(inout const_char* p, const_char* pStart, const_char* last, inout  size_t line, Value cc)
 {
-	Value v;
+	Value v;
+	//std.string.writefln("got string %d", *p);
 	switch(*p) {
 		case 0x00:
 		case 0x01:
@@ -336,7 +343,7 @@
 			while(p < last && ((0x41 <= *p && *p <= 0x5A) || (0x61 <= *p && *p <= 0x7A))) {
 				p++;
 			}
-			const(char)[] word = pStart[0..(p-pStart)];
+			const_char[] word = pStart[0..(p-pStart)];
 			p--;
 			switch(word) {
 				/// ECMA 7.5.2
Index: source/methods.d
===================================================================
--- source/methods.d	(revision 112)
+++ source/methods.d	(working copy)
@@ -11,7 +11,7 @@
 	text,
 	value;
 
-import
+private import
 	std.c.stdlib,
 	std.date,
 	std.math,
@@ -20,7 +20,38 @@
 	std.string,
 	std.uri,
 	std.uni;
-
+	
+// from : http://www.jb.man.ac.uk/~slowe/cpp/itoa.html
+char* itoa( int value, char* result, int base ) {
+	// check that the base if valid
+	if (base < 2 || base > 16) { *result = 0; return result; }
+	char* outs = result;
+	int quotient = value;
+	
+	do {
+		*outs = "0123456789abcdef"[ abs( quotient % base ) ];
+		++outs;
+		quotient /= base;
+	
+	} while ( quotient );
+	
+	// Only apply negative sign for base 10
+	if ( value < 0 && base == 10) *outs++ = '-';
+	strreverse( result, outs );
+	*outs = 0;
+	return result;
+}
+void strreverse(char* begin, char* end) {
+	
+	char aux;
+	
+	while(end>begin)
+	
+		aux=*end, *end--=*begin, *begin++=aux;
+	
+}
+ 
+	 
 /**
 	Standards: non-standard
 	Arguments: none
@@ -63,7 +94,10 @@
 		}
 		if(base == 0)
 			base = 10;
-		return cast(Value) std.string.toString(std.string.itoa( arguments[0].toInteger(), s, base ));
+		return cast(Value) std.string.toString(
+				itoa( 
+					arguments[0].toInteger(), s, base 
+			));
 	}
 	return NAN;
 }
@@ -207,7 +241,7 @@
 	Synopsis:
 */
 static Value Object_prototype_toSource(Value self, Value cc, Value[] arguments ...) {
-	const(char)[] buffer = "{";
+	const_char[] buffer = "{";
 	bool any = false;
 	Value v;
 	for(int i = 0; i < self.length; i++) {
@@ -365,7 +399,7 @@
 	Synopsis:
 */
 static Value Array_prototype_toLocaleString(Value self, Value cc, Value[] arguments ...) {
-	const(char)[] r = "[";
+	const_char[] r = "[";
 	char c = ','; // this character needs to be locale "list separator"
 	if(self.a.length) {
 		r ~= self.a[0].toString();
@@ -385,7 +419,7 @@
 	Synopsis:
 */
 static Value Array_prototype_toSource(Value self, Value cc, Value[] arguments ...) {
-	const(char)[] r = "[";
+	const_char[] r = "[";
 	if(self.a.length) {
 		r ~= self.a[0].toString();
 		for(int i = 1; i < self.a.length; i++) {
@@ -421,10 +455,10 @@
 	Synopsis:
 */
 static Value Array_prototype_join(Value self, Value cc, Value[] arguments ...) {
-	const(char)[] s = TEXT_;
+	const_char[] s = TEXT_;
 	if(arguments.length)
 		s = arguments[0].toString();
-	const(char)[] r = self.a[0].toString();
+	const_char[] r = self.a[0].toString();
 	for(int i = 1; i < self.a.length; i++) {
 		r ~= s;
 		r ~= self.a[i].toString();
@@ -679,9 +713,9 @@
 */
 static Value String_prototype_match(Value self, Value cc, Value[] arguments ...) {
 	if(arguments.length && arguments[0].type == TYPE.REGEXP) {
-		const(char)[][] m = arguments[0].r.match(self.toString());
+		const_char[][] m = arguments[0].r.match(self.toString());
 		Value[] v = [];
-		foreach(const(char)[] s; m) {
+		foreach(const_char[] s; m) {
 			v ~= cast(Value) s;
 		}
 		return cast(Value) v;
@@ -745,19 +779,24 @@
 	if(!arguments.length)
 		goto _no0;
 	if(arguments[0].type == TYPE.REGEXP) {
-		const(char)[][] v = arguments[0].r.split(self.toString());
-		foreach(const(char)[] s; v) {
+		const_char[][] v = arguments[0].r.split(self.toString());
+		foreach(const_char[] s; v) {
 			a ~= cast(Value) s;
 		}
 		return cast(Value) a;
 	}
-	const(char)[] sep;
+	const_char[] sep;
 	sep = arguments[0].toString();
 	if(sep.length == 0) {
 		_no0:
 		a.length = self.s.length;
 		a[i].type = TYPE.STRING;
-		a[i].s = self.s.idup;
+		version(D_Version2) {
+			a[i].s = self.s.idup;
+		} else {
+			a[i].s = self.s.dup;
+		}
+		
 	}
 	else {
 		if(arguments.length > 1)
@@ -843,7 +882,7 @@
 	foreach(char c; self.toString()) {
 		s[i++] = std.uni.toUniLower(c);
 	}
-	return cast(Value) cast(const(char)[]) s;
+	return cast(Value) cast(const_char[]) s;
 }
 
 /**
@@ -868,7 +907,7 @@
 	foreach(char c; self.toString()) {
 		s[i++] = std.uni.toUniUpper(c);
 	}
-	return cast(Value) cast(const(char)[]) s;
+	return cast(Value) cast(const_char[]) s;
 }
 
 /**
@@ -1219,7 +1258,7 @@
 	Synopsis:
 */
 static Value Date_parse(Value self, Value cc, Value[] arguments ...) {
-	return cast(Value) (arguments.length? parse(arguments[0].toString()) : d_time_nan);
+	return cast(Value) (arguments.length? std.date.parse(arguments[0].toString()) : d_time_nan);
 }
 
 /**
@@ -2005,8 +2044,8 @@
 static Value RegExp_prototype_exec(Value self, Value cc, Value[] arguments ...) {
 	if(arguments.length) {
 		Value[] a = [];
-		const(char)[][] m = self.r.exec(arguments[0].toString());
-		foreach(const(char)[] s; m) {
+		const_char[][] m = self.r.exec(arguments[0].toString());
+		foreach(const_char[] s; m) {
 			a ~= cast(Value) s;
 		}
 		return cast(Value) a;
Index: source/main.d
===================================================================
--- source/main.d	(revision 112)
+++ source/main.d	(working copy)
@@ -16,9 +16,9 @@
 	structure,
 	text,
 	value;
+version(Win32) 
+	pragma(lib,"bin\\walnut.lib");
 
-pragma(lib,"bin\\walnut.lib");
-
 enum EXIT {
 	SUCCESS	= 0x00,
 	FAILURE	= 0x01,
@@ -32,12 +32,12 @@
 	
 	/// Initialize the program state
 	Value global = Global_init();
-	const(char)[] path, source;
+	char[] path, source;
 	
 	/// Grab the files and collect the source
 	for(size_t i = 1; i < arguments.length; i++) {
 		path = std.path.defaultExt(arguments[i],"nut");
-		source ~= cast(const(char)[]) std.file.read(path);
+		source ~= cast(char[]) std.file.read(path);
 	}
 	
 	/// we insert a stop program character so we don't need to have a separate branch to test against the length of the stream.
Index: source/text.d
===================================================================
--- source/text.d	(revision 112)
+++ source/text.d	(working copy)
@@ -292,8 +292,9 @@
 TEXT_ScriptEngineMajorVersion = "ScriptEngineMajorVersion",
 TEXT_ScriptEngineMinorVersion = "ScriptEngineMinorVersion",
 TEXT_Walnut = "Walnut";
-
-version(Windows) 
+/*
+version(Windows) 
+*/
 	static const char[]
 	TEXT_ActiveXObject = "ActiveXObject",
 
Index: source/value.d
===================================================================
--- source/value.d	(revision 112)
+++ source/value.d	(working copy)
@@ -20,6 +20,24 @@
 
 alias std.date.d_time d_time;
 alias std.regexp.RegExp RegExp;
+
+
+version(D_Version2) {
+	
+	alias const char  const_char; 
+	alias const double const_double; 
+	alias const int const_int;  
+	alias const d_time const_d_time; 
+	alias const Value const_Value;
+} else {
+	alias char const_char;
+	alias double const_double;
+	alias int const_int;
+	alias d_time const_d_time;
+	alias Value const_Value;
+}
+
+
 
 ///	TYPE can be checked at runtime to find out what the type of a Value is.
 enum TYPE : ubyte {
@@ -114,7 +132,7 @@
 	union {		
 		struct {
 			uint length;
-			const(char)[]* keys;
+			const_char[]* keys;
 			Value* values;
 		}
 		struct {
@@ -122,11 +140,11 @@
 			ubyte arity;
 		}
 		struct {
-			const(char)* start;
-			const(char)* end;
+			const_char* start;
+			const_char* end;
 		}
 		Value[] a;
-		const(char)[] s;
+		const_char[] s;
 		bool b;
 		int i;
 		double d;
@@ -136,7 +154,7 @@
 	ubyte type;
 	ubyte access;
 	
-	bool opIn_r(const(char)[] key) {
+	bool opIn_r(const_char[] key) {
 		/// OPTIMIZE: linear search
 		for(int i = 0; i < length; i++) {
 			if(keys[i] == key)
@@ -144,9 +162,9 @@
 		}
 		return false;
 	}
-	const Value opIndex(const(char)[] key) {
+	Value opIndex(const_char[] key) {
 		/// OPTIMIZE: linear search
-		const(Value)* self = this;
+		const_Value* self = this;
 		int i;
 		do {
 			for(i = 0; i < self.length; i++) {
@@ -157,7 +175,7 @@
 		} while(self !is null);
 		return UNDEFINED;
 	}
-	void opIndexAssign(Value v, const(char)[] key) {
+	void opIndexAssign(Value v, const_char[] key) {
 		/// OPTIMIZE: linear search
 		for(int i = 0; i < length; i++) {
 			if(keys[i] == key){
@@ -166,7 +184,7 @@
 			}
 		}
 		length++;
-		keys = cast(const(char)[]*) std.c.stdlib.realloc(keys,length);
+		keys = cast(const_char[]*) std.c.stdlib.realloc(keys,length);
 		values = cast(Value*) std.c.stdlib.realloc(values,Value.sizeof * length);
 	}
 
@@ -195,11 +213,11 @@
 		char[] s;
 		s[0] = x;
 		Value v;
-		v.s = cast(const(char)[]) s;
+		v.s = cast(const_char[]) s;
 		v.type = TYPE.STRING;
 		return v;
 	}
-	static Value opCall(const(char)[] x) {
+	static Value opCall(const_char[] x) {
 		Value v;
 		v.s = x;
 		v.type = TYPE.STRING;
@@ -251,10 +269,10 @@
 	void opAssign(char x) {
 		char[] s;
 		s[0] = x;
-		this.s = cast(const(char)[]) s;
+		this.s = cast(const_char[]) s;
 		type = TYPE.STRING;
 	}
-	void opAssign(const(char)[] x) {
+	void opAssign(const_char[] x) {
 		s = x;
 		type = TYPE.STRING;
 	}
@@ -278,7 +296,7 @@
 		r = x;
 		type = TYPE.REGEXP;
 	}
-	const const(char)[] toString() {
+	const_char[] toString() {
 		switch(type) {
 			case TYPE.UNDEFINED:	return TEXT_undefined;
 			case TYPE.NULL:		return TEXT_null;
@@ -294,7 +312,7 @@
 							/// INCOMPLETE: this doesn't include the function's name (should it?)
 							return MESSAGE_native_function;
 			case TYPE.OBJECT:
-				const(char)[] s;
+				const_char[] s;
 				for(int i = 18; i < 34; i++) {
 					if(*this == Global.values[i]) {
 						s = Global.keys[i];
@@ -306,11 +324,13 @@
 				return std.string.format(TEXT_bobject_sb,s);
 			case TYPE.ARRAY:	// return Array_prototype_toSource(this,this);
 			case TYPE.STRING:	return this.s;
-			case TYPE.REGEXP:	return '/'~this.s~'/';
+			case TYPE.REGEXP:	return '/'~this.s~'/';
+			default:
+				return "TOKEN " ~ std.string.toString(type);
 		}
 		assert(0);
 	}
-	const int toInteger() {
+	const_int toInteger() {
 		switch(type) {
 			case TYPE.OBJECT:	return opIndex(TEXT___value__).toInteger();
 			case TYPE.UNDEFINED:
@@ -327,7 +347,7 @@
 		}
 		assert(0);
 	}
-	const double toDouble() {
+	const_double toDouble() {
 		switch(type) {
 			case TYPE.OBJECT:	return opIndex(TEXT___value__).toDouble();
 			case TYPE.UNDEFINED:
@@ -343,7 +363,7 @@
 		}
 		assert(0);
 	}
-	const d_time toDate() {
+	const_d_time toDate() {
 		switch(type) {
 			case TYPE.OBJECT:	return opIndex(TEXT___value__).toDate();
 			case TYPE.UNDEFINED:
