Browse Source

flipped haxe3 switch

Simon Krajewski 12 years ago
parent
commit
f5f72624fa
50 changed files with 87 additions and 1257 deletions
  1. 3 8
      codegen.ml
  2. 0 4
      common.ml
  3. 0 1
      doc/all.hxml
  4. 1 1
      genjs.ml
  5. 1 2
      main.ml
  6. 0 2
      matcher.ml
  7. 2 6
      std/EReg.hx
  8. 15 21
      std/Std.hx
  9. 1 3
      std/cpp/FastIterator.hx
  10. 2 12
      std/cpp/_std/EReg.hx
  11. 0 7
      std/cpp/_std/Std.hx
  12. 0 4
      std/cs/_std/EReg.hx
  13. 0 7
      std/cs/_std/Std.hx
  14. 0 139
      std/cs/_std/haxe/Int32.hx
  15. 0 26
      std/cs/_std/haxe/Int64.hx
  16. 1 26
      std/flash/_std/EReg.hx
  17. 0 7
      std/flash/_std/Std.hx
  18. 0 6
      std/flash8/_std/Std.hx
  19. 0 140
      std/haxe/Int32.hx
  20. 2 206
      std/haxe/Int64.hx
  21. 0 25
      std/haxe/io/BytesInput.hx
  22. 0 22
      std/haxe/io/BytesOutput.hx
  23. 0 47
      std/haxe/io/Input.hx
  24. 0 52
      std/haxe/io/Output.hx
  25. 0 10
      std/haxe/macro/Expr.hx
  26. 20 26
      std/haxe/macro/ExprTools.hx
  27. 17 23
      std/haxe/macro/Printer.hx
  28. 0 4
      std/java/_std/EReg.hx
  29. 0 6
      std/java/_std/Std.hx
  30. 0 139
      std/java/_std/haxe/Int32.hx
  31. 0 25
      std/java/_std/haxe/Int64.hx
  32. 2 12
      std/js/_std/EReg.hx
  33. 0 6
      std/js/_std/Std.hx
  34. 4 14
      std/neko/_std/EReg.hx
  35. 0 6
      std/neko/_std/Std.hx
  36. 2 2
      std/neko/db/Object.hx
  37. 1 1
      std/neko/vm/Module.hx
  38. 3 13
      std/php/_std/EReg.hx
  39. 0 6
      std/php/_std/Std.hx
  40. 1 37
      std/sys/db/SpodMacros.hx
  41. 0 1
      std/tools/haxedoc/haxedoc.hxml
  42. 0 5
      std/tools/haxelib/Data.hx
  43. 0 4
      std/tools/haxelib/Main.hx
  44. 0 2
      std/tools/haxelib/haxelib.hxml
  45. 0 1
      std/tools/hxinst/hxinst.hxml
  46. 0 1
      tests/unit/Test.hx
  47. 0 123
      tests/unit/TestInt32.hx
  48. 0 1
      tests/unit/compile.hxml
  49. 8 11
      typeload.ml
  50. 1 4
      typer.ml

+ 3 - 8
codegen.ml

@@ -554,9 +554,7 @@ let on_inherit ctx c p h =
 		extend_remoting ctx c t p true false;
 		extend_remoting ctx c t p true false;
 		false
 		false
 	| HImplements { tpackage = ["haxe";"rtti"]; tname = "Generic"; tparams = [] } ->
 	| HImplements { tpackage = ["haxe";"rtti"]; tname = "Generic"; tparams = [] } ->
-		if Common.defined ctx.com Define.Haxe3 then error ("Implementing haxe.rtti.Generic is deprecated in haxe 3, please use @:generic instead") c.cl_pos;
-		if c.cl_types <> [] then c.cl_kind <- KGeneric;
-		false
+		error ("Implementing haxe.rtti.Generic is deprecated in haxe 3, please use @:generic instead") c.cl_pos;
 	| HExtends { tpackage = ["haxe";"xml"]; tname = "Proxy"; tparams = [TPExpr(EConst (String file),p);TPType t] } ->
 	| HExtends { tpackage = ["haxe";"xml"]; tname = "Proxy"; tparams = [TPExpr(EConst (String file),p);TPType t] } ->
 		extend_xml_proxy ctx c t file p;
 		extend_xml_proxy ctx c t file p;
 		true
 		true
@@ -645,11 +643,8 @@ let add_rtti ctx t =
 				| _ -> false
 				| _ -> false
 			) c.cl_implements || (match c.cl_super with None -> false | Some (c,_) -> has_rtti_old c)
 			) c.cl_implements || (match c.cl_super with None -> false | Some (c,_) -> has_rtti_old c)
 		in
 		in
-		if Common.defined ctx.com Define.Haxe3 then begin
-			if has_rtti_old c then error ("Implementing haxe.rtti.Infos is deprecated in haxe 3, please use @:rttiInfos instead") c.cl_pos;
-			has_rtti_new c
-		end else
-			has_rtti_old c || has_rtti_new c
+		if has_rtti_old c then error ("Implementing haxe.rtti.Infos is deprecated in haxe 3, please use @:rttiInfos instead") c.cl_pos;
+		has_rtti_new c
 	in
 	in
 	match t with
 	match t with
 	| TClassDecl c when has_rtti c && not (PMap.mem "__rtti" c.cl_statics) ->
 	| TClassDecl c when has_rtti c && not (PMap.mem "__rtti" c.cl_statics) ->

+ 0 - 4
common.ml

@@ -155,7 +155,6 @@ module Define = struct
 		| FlashUseStage
 		| FlashUseStage
 		| FormatWarning
 		| FormatWarning
 		| GencommonDebug
 		| GencommonDebug
-		| Haxe3
 		| HaxeBoot
 		| HaxeBoot
 		| HaxeVer
 		| HaxeVer
 		| Interp
 		| Interp
@@ -163,7 +162,6 @@ module Define = struct
 		| JsModern
 		| JsModern
 		| Macro
 		| Macro
 		| MacroTimes
 		| MacroTimes
-		| MatchDebug
 		| NekoSource
 		| NekoSource
 		| NekoV2
 		| NekoV2
 		| NetworkSandbox
 		| NetworkSandbox
@@ -215,7 +213,6 @@ module Define = struct
 		| FlashUseStage -> ("flash_use_stage","Keep the SWF library initial stage")
 		| FlashUseStage -> ("flash_use_stage","Keep the SWF library initial stage")
 		| FormatWarning -> ("format_warning","Print a warning for each formated string, for 2.x compatibility")
 		| FormatWarning -> ("format_warning","Print a warning for each formated string, for 2.x compatibility")
 		| GencommonDebug -> ("gencommon_debug","GenCommon internal")
 		| GencommonDebug -> ("gencommon_debug","GenCommon internal")
-		| Haxe3 -> ("haxe3","Enable Haxe3 transition mode")
 		| HaxeBoot -> ("haxe_boot","Given the name 'haxe' to the flash boot class instead of a generated name")
 		| HaxeBoot -> ("haxe_boot","Given the name 'haxe' to the flash boot class instead of a generated name")
 		| HaxeVer -> ("haxe_ver","The current Haxe version value")
 		| HaxeVer -> ("haxe_ver","The current Haxe version value")
 		| Interp -> ("interp","The code is compiled to be run with --interp")
 		| Interp -> ("interp","The code is compiled to be run with --interp")
@@ -223,7 +220,6 @@ module Define = struct
 		| JsModern -> ("js_modern","Use function wrapper and strict mode in JS output")
 		| JsModern -> ("js_modern","Use function wrapper and strict mode in JS output")
 		| Macro -> ("macro","Defined when we compile code in the macro context")
 		| Macro -> ("macro","Defined when we compile code in the macro context")
 		| MacroTimes -> ("macro_times","Display per-macro timing when used with --times")
 		| MacroTimes -> ("macro_times","Display per-macro timing when used with --times")
-		| MatchDebug -> ("match_debug","Show Pattern Matcher log")
 		| NekoSource -> ("neko_source","Output neko source instead of bytecode")
 		| NekoSource -> ("neko_source","Output neko source instead of bytecode")
 		| NekoV2 -> ("neko_v2","Activate Neko 2.0 compatibility")
 		| NekoV2 -> ("neko_v2","Activate Neko 2.0 compatibility")
 		| NetworkSandbox -> ("network-sandbox","Use local network sandbox instead of local file access one")
 		| NetworkSandbox -> ("network-sandbox","Use local network sandbox instead of local file access one")

+ 0 - 1
doc/all.hxml

@@ -1,6 +1,5 @@
 --no-output
 --no-output
 --macro ImportAll.run()
 --macro ImportAll.run()
--D haxe3
 -D doc-gen
 -D doc-gen
 --each
 --each
 
 

+ 1 - 1
genjs.ml

@@ -1089,7 +1089,7 @@ let alloc_ctx com =
 			sources_hash = Hashtbl.create 0;
 			sources_hash = Hashtbl.create 0;
 			mappings = Buffer.create 16;
 			mappings = Buffer.create 16;
 		};
 		};
-		js_modern = Common.defined com Define.JsModern || (Common.defined com Define.Haxe3 && not (Common.defined com Define.JsClassic));
+		js_modern = Common.defined com Define.JsModern || (not (Common.defined com Define.JsClassic));
 		statics = [];
 		statics = [];
 		inits = [];
 		inits = [];
 		current = null_class;
 		current = null_class;

+ 1 - 2
main.ml

@@ -39,7 +39,7 @@ type cache = {
 exception Abort
 exception Abort
 exception Completion of string
 exception Completion of string
 
 
-let version = 211
+let version = 300
 
 
 let measure_times = ref false
 let measure_times = ref false
 let prompt = ref false
 let prompt = ref false
@@ -738,7 +738,6 @@ try
 			Common.raw_define com ("haxe_" ^ string_of_int v);
 			Common.raw_define com ("haxe_" ^ string_of_int v);
 		done;
 		done;
 	end else begin
 	end else begin
-		Common.define com Define.Haxe3;
 		Common.define_value com Define.HaxeVer (string_of_float (float_of_int version /. 100.));
 		Common.define_value com Define.HaxeVer (string_of_float (float_of_int version /. 100.));
 	end;
 	end;
 	Common.define_value com Define.Dce "std";
 	Common.define_value com Define.Dce "std";

+ 0 - 2
matcher.ml

@@ -1090,10 +1090,8 @@ let match_expr ctx e cases def with_type p =
 		let out = mk_out mctx i e eg pl (pos ep) in
 		let out = mk_out mctx i e eg pl (pos ep) in
 		Array.of_list pl,out
 		Array.of_list pl,out
 	) cases in
 	) cases in
-	if Common.defined ctx.com Define.MatchDebug then print_endline (s_pat_matrix pl);
 	begin try
 	begin try
 		let dt = compile mctx stl pl in
 		let dt = compile mctx stl pl in
-		if Common.defined ctx.com Define.MatchDebug then print_endline (s_dt "" dt);
 		PMap.iter (fun _ out -> if out.o_num_paths = 0 then begin
 		PMap.iter (fun _ out -> if out.o_num_paths = 0 then begin
 			if out.o_pos == p then display_error ctx "The default pattern is unused" p
 			if out.o_pos == p then display_error ctx "The default pattern is unused" p
 			else display_error ctx "This pattern is unused" out.o_pos;
 			else display_error ctx "This pattern is unused" out.o_pos;

+ 2 - 6
std/EReg.hx

@@ -74,10 +74,10 @@ class EReg {
 	public function matchedPos() : { pos : Int, len : Int } {
 	public function matchedPos() : { pos : Int, len : Int } {
 		return null;
 		return null;
 	}
 	}
-	
+
 	/**
 	/**
 		Tells if the regular expression matches the String between pos and pos + len.
 		Tells if the regular expression matches the String between pos and pos + len.
-		Updates the internal state accordingly.		
+		Updates the internal state accordingly.
 	**/
 	**/
 	public function matchSub( s : String, pos : Int, len : Int = 0):Bool {
 	public function matchSub( s : String, pos : Int, len : Int = 0):Bool {
 		return false;
 		return false;
@@ -117,8 +117,4 @@ class EReg {
 		buf.add(s);
 		buf.add(s);
 		return buf.toString();
 		return buf.toString();
 	}
 	}
-
-	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String return map(s, f)
-	#end	
 }
 }

+ 15 - 21
std/Std.hx

@@ -35,73 +35,67 @@ extern class Std {
 
 
 	/**
 	/**
 		Converts any value to a String.
 		Converts any value to a String.
-		
+
 		If s is of String, Int, Float or Bool, its value is returned.
 		If s is of String, Int, Float or Bool, its value is returned.
-		
+
 		If s is an instance of a class and that class or one of its parent classes has
 		If s is an instance of a class and that class or one of its parent classes has
 		a toString() method, that method is called. If no such method is present, the result
 		a toString() method, that method is called. If no such method is present, the result
 		is unspecified.
 		is unspecified.
-		
+
 		If s is an enum constructor without argument, the constructor's name is returned. If
 		If s is an enum constructor without argument, the constructor's name is returned. If
 		arguments exists, the constructor's name followed by the String representations of
 		arguments exists, the constructor's name followed by the String representations of
 		the arguments is returned.
 		the arguments is returned.
-		
+
 		If s is a structure, the field names along with their values are returned. The field order
 		If s is a structure, the field names along with their values are returned. The field order
 		and the operator separating field names and values are unspecified.
 		and the operator separating field names and values are unspecified.
-		
+
 		If s is null, "null" is returned.
 		If s is null, "null" is returned.
 	**/
 	**/
 	public static function string( s : Dynamic ) : String;
 	public static function string( s : Dynamic ) : String;
 
 
 	/**
 	/**
 		Converts a Float to an Int, rounded down.
 		Converts a Float to an Int, rounded down.
-		
+
 		If x is NaN, NEGATIVE_INFINITY or POSITIVE_INFINITY, the result is unspecified.
 		If x is NaN, NEGATIVE_INFINITY or POSITIVE_INFINITY, the result is unspecified.
 	**/
 	**/
 	public static function int( x : Float ) : Int;
 	public static function int( x : Float ) : Int;
 
 
 	/**
 	/**
 		Converts a String to an Int.
 		Converts a String to an Int.
-		
+
 		Leading whitespaces are ignored.
 		Leading whitespaces are ignored.
-		
+
 		If x starts with 0x or 0X, hexadecimal notation is recognized where the following digits may
 		If x starts with 0x or 0X, hexadecimal notation is recognized where the following digits may
 		contain 0-9 and A-F.
 		contain 0-9 and A-F.
-		
+
 		Otherwise x is read as decimal number with 0-9 being allowed characters. x may also start with
 		Otherwise x is read as decimal number with 0-9 being allowed characters. x may also start with
 		a - to denote a negative value.
 		a - to denote a negative value.
-		
+
 		In decimal mode, parsing continues until an invalid character is detected, in which case the
 		In decimal mode, parsing continues until an invalid character is detected, in which case the
 		result up to that point is returned. For hexadecimal notation, the effect of invalid characters
 		result up to that point is returned. For hexadecimal notation, the effect of invalid characters
 		is unspecified.
 		is unspecified.
-		
+
 		Leading 0s that are not part of the 0x/0X hexadecimal notation are ignored, which means octal
 		Leading 0s that are not part of the 0x/0X hexadecimal notation are ignored, which means octal
 		notation is not supported.
 		notation is not supported.
-		
+
 		If the input cannot be recognized, the result is null.
 		If the input cannot be recognized, the result is null.
 	**/
 	**/
 	public static function parseInt( x : String ) : Null<Int>;
 	public static function parseInt( x : String ) : Null<Int>;
 
 
 	/**
 	/**
 		Converts a String to a Float.
 		Converts a String to a Float.
-		
+
 		The parsing rules for parseInt() apply here as well, with the exception of invalid input
 		The parsing rules for parseInt() apply here as well, with the exception of invalid input
 		resulting in a NaN value instead of null.
 		resulting in a NaN value instead of null.
-		
+
 		Additionally, decimal notation may contain a single . to denote the start of the fractions.
 		Additionally, decimal notation may contain a single . to denote the start of the fractions.
 	**/
 	**/
 	public static function parseFloat( x : String ) : Float;
 	public static function parseFloat( x : String ) : Float;
 
 
 	/**
 	/**
 		Return a random integer between 0 included and x excluded.
 		Return a random integer between 0 included and x excluded.
-		
+
 		If x is <= 1, the result is always 0.
 		If x is <= 1, the result is always 0.
 	**/
 	**/
 	public static function random( x : Int ) : Int;
 	public static function random( x : Int ) : Int;
-
-
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprOf<String>;
-	#end
-
 }
 }

+ 1 - 3
std/cpp/FastIterator.hx

@@ -21,10 +21,8 @@
  */
  */
 package cpp;
 package cpp;
 
 
-#if haxe3
 @:generic
 @:generic
-#end
-extern class FastIterator<T> #if !haxe3 implements haxe.rtti.Generic #end
+extern class FastIterator<T>
 {
 {
 	public function hasNext():Bool;
 	public function hasNext():Bool;
 	public function next():T;
 	public function next():T;

+ 2 - 12
std/cpp/_std/EReg.hx

@@ -70,7 +70,7 @@
 				last = null;
 				last = null;
 			return p;
 			return p;
 	}
 	}
-	
+
 	public function split( s : String ) : Array<String> {
 	public function split( s : String ) : Array<String> {
 			var pos = 0;
 			var pos = 0;
 			var len = s.length;
 			var len = s.length;
@@ -167,7 +167,7 @@
 				offset = p.pos + p.len;
 				offset = p.pos + p.len;
 		} while (global);
 		} while (global);
 		if (!global && offset < s.length)
 		if (!global && offset < s.length)
-			buf.add(s.substr(offset));		
+			buf.add(s.substr(offset));
 		return buf.toString();
 		return buf.toString();
 	}
 	}
 
 
@@ -175,14 +175,4 @@
 	static var regexp_match : Dynamic -> String -> Int -> Int -> Dynamic = cpp.Lib.load("regexp","regexp_match",4);
 	static var regexp_match : Dynamic -> String -> Int -> Int -> Dynamic = cpp.Lib.load("regexp","regexp_match",4);
 	static var regexp_matched : Dynamic -> Int -> Dynamic = cpp.Lib.load("regexp","regexp_matched",2);
 	static var regexp_matched : Dynamic -> Int -> Dynamic = cpp.Lib.load("regexp","regexp_matched",2);
 	static var regexp_matched_pos : Dynamic -> Int -> { pos : Int, len : Int } = cpp.Lib.load("regexp","regexp_matched_pos",2);
 	static var regexp_matched_pos : Dynamic -> Int -> { pos : Int, len : Int } = cpp.Lib.load("regexp","regexp_matched_pos",2);
-
-	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String {
-		var old = global;
-		global = true;
-		var ret = map(s, f);
-		global = old;
-		return ret;
-	}
-	#end
 }
 }

+ 0 - 7
std/cpp/_std/Std.hx

@@ -44,11 +44,4 @@
 		if (x <= 0) return 0;
 		if (x <= 0) return 0;
 		return untyped __global__.__hxcpp_irand(x);
 		return untyped __global__.__hxcpp_irand(x);
 	}
 	}
-
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprOf<String> {
-		return haxe.macro.Format.format(fmt);
-	}
-	#end
-
 }
 }

+ 0 - 4
std/cs/_std/EReg.hx

@@ -119,8 +119,4 @@ import cs.system.text.regularExpressions.Regex;
 			buf.add(s.substr(offset));
 			buf.add(s.substr(offset));
 		return buf.toString();
 		return buf.toString();
 	}
 	}
-
-	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String return map(s, f)
-	#end
 }
 }

+ 0 - 7
std/cs/_std/Std.hx

@@ -238,11 +238,4 @@ import cs.internal.Exceptions;
 		if (x <= 0) return 0;
 		if (x <= 0) return 0;
 		return untyped Math.rand.Next(x);
 		return untyped Math.rand.Next(x);
 	}
 	}
-
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprRequire<String> {
-		return haxe.macro.Format.format(fmt);
-	}
-	#end
-
 }
 }

+ 0 - 139
std/cs/_std/haxe/Int32.hx

@@ -1,139 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package haxe;
-
-#if !haxe3
-
-@:nativeGen class Int32
-{
-	public static inline function make( a : Int, b : Int ) : Int32
-	{
-		return cast ((a << 16) | b);
-	}
-
-	public static inline function ofInt( x : Int ) : Int32
-	{
-		return cast x;
-	}
-
-	public static function toInt( x : Int32 ) : Int
-	{
-		if ( (((cast x) >> 30) & 1) != ((cast x) >>> 31) ) throw "Overflow " + x;
-
-		return cast x;
-	}
-
-	public static inline function add( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) + cast b);
-	}
-
-	public static inline function sub( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) - cast b);
-	}
-
-	public static inline function mul( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) * cast b);
-	}
-
-	public static inline function div( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) / cast b);
-	}
-
-	public static inline function mod( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) % cast b);
-	}
-
-	public static inline function shl( a : Int32, b : Int ) : Int32
-	{
-		return cast ((cast a) << b);
-	}
-
-	public static inline function shr( a : Int32, b : Int ) : Int32
-	{
-		return cast ((cast a) >> b);
-	}
-
-	public static inline function ushr( a : Int32, b : Int ) : Int32
-	{
-		return cast ((cast a) >>> b);
-	}
-
-	public static inline function and( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) & cast b);
-	}
-
-	public static inline function or( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) | cast b);
-	}
-
-	public static inline function xor( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) ^ cast b);
-	}
-
-	public static inline function neg( a : Int32 ) : Int32
-	{
-		return cast -(cast a);
-	}
-
-	public static inline function complement( a : Int32 ) : Int32
-	{
-		return cast ~(cast a);
-	}
-
-	public static inline function compare( a : Int32, b : Int32 ) : Int
-	{
-		return (cast a) - cast b;
-	}
-
-	public static inline function isNeg( a : Int32 ) : Bool
-	{
-		return (cast a) < 0;
-	}
-
-	public static inline function isZero( a : Int32 ) : Bool
-	{
-		return (cast a) == 0;
-	}
-
-	public static inline function ucompare( a : Int32, b : Int32 ) : Int
-	{
-		var ua:UInt = cast a;
-		var ub:UInt = cast b;
-
-		return (ua < ub) ? -1 : ( (ua > ub) ? 1 : 0 );
-	}
-
-	public static inline function toNativeInt(a:Int32) : Int
-	{
-		return cast a;
-	}
-}
-
-#end

+ 0 - 26
std/cs/_std/haxe/Int64.hx

@@ -31,8 +31,6 @@ using haxe.Int64;
 	@:extern private static inline function ofNative(i:NativeInt64):Int64 return untyped i
 	@:extern private static inline function ofNative(i:NativeInt64):Int64 return untyped i
 	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i
 	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i
 
 
-	#if haxe3
-
 	public static inline function make( high : Int, low : Int ) : Int64
 	public static inline function make( high : Int, low : Int ) : Int64
 	{
 	{
 		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
 		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
@@ -47,30 +45,6 @@ using haxe.Int64;
 		return cast(cast(x,NativeUInt64) >> 32, Int);
 		return cast(cast(x,NativeUInt64) >> 32, Int);
 	}
 	}
 
 
-	#else
-
-	public static inline function make( high : Int32, low : Int32 ) : Int64
-	{
-		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
-	}
-
-	public static inline function ofInt32( x : Int32 ) : Int64 {
-		return cast x;
-	}
-
-	public static inline function getLow( x : Int64 ) : Int32
-	{
-		return cast (x.asNative() & 0xFFFFFFFF.mkNative());
-	}
-
-	public static inline function getHigh( x : Int64 ) : Int32
-	{
-		return cast(cast(x,NativeUInt64) >> 32,Int32);
-	}
-
-
-	#end
-
 	public static inline function ofInt( x : Int ) : Int64 {
 	public static inline function ofInt( x : Int ) : Int64 {
 		return cast x;
 		return cast x;
 	}
 	}

+ 1 - 26
std/flash/_std/EReg.hx

@@ -55,7 +55,7 @@
 		if( result == null ) throw "No string matched";
 		if( result == null ) throw "No string matched";
 		return { pos : result.index, len : result[0].length };
 		return { pos : result.index, len : result[0].length };
 	}
 	}
-	
+
 	public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
 	public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
 		return if (r.global) {
 		return if (r.global) {
 			r.lastIndex = pos;
 			r.lastIndex = pos;
@@ -112,29 +112,4 @@
 			buf.add(s.substr(offset));
 			buf.add(s.substr(offset));
 		return buf.toString();
 		return buf.toString();
 	}
 	}
-
-	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String {
-		var offset = 0;
-		var buf = new StringBuf();
-		do {
-			if (offset >= s.length)
-				break;
-			else if (!matchSub(s, offset)) {
-				buf.add(s.substr(offset));
-				break;
-			}
-			var p = matchedPos();
-			buf.add(s.substr(offset, p.pos - offset));
-			buf.add(f(this));
-			if (p.len == 0) {
-				buf.add(s.substr(p.pos, 1));
-				offset = p.pos + 1;
-			}
-			else
-				offset = p.pos + p.len;
-		} while (true);
-		return buf.toString();
-	}
-	#end
 }
 }

+ 0 - 7
std/flash/_std/Std.hx

@@ -49,11 +49,4 @@ import flash.Boot;
 	public static function random( x : Int ) : Int {
 	public static function random( x : Int ) : Int {
 		return untyped x <= 0 ? 0 : Math.floor(Math.random()*x);
 		return untyped x <= 0 ? 0 : Math.floor(Math.random()*x);
 	}
 	}
-
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprOf<String> {
-		return haxe.macro.Format.format(fmt);
-	}
-	#end
-
 }
 }

+ 0 - 6
std/flash8/_std/Std.hx

@@ -53,12 +53,6 @@
 		return untyped __random__(x);
 		return untyped __random__(x);
 	}
 	}
 
 
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprOf<String> {
-		return haxe.macro.Format.format(fmt);
-	}
-	#end
-
 	static function __init__() : Void untyped {
 	static function __init__() : Void untyped {
 		var g : Dynamic = _global;
 		var g : Dynamic = _global;
 		g["Int"] = { __name__ : ["Int"] };
 		g["Int"] = { __name__ : ["Int"] };

+ 0 - 140
std/haxe/Int32.hx

@@ -1,140 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package haxe;
-
-#if !haxe3
-
-class Int32 {
-
-	public static inline function make( a : Int, b : Int ) : Int32 {
-		return cast ((a << 16) | b);
-	}
-
-	public static inline function ofInt( x : Int ) : Int32 {
-		return clamp(cast x);
-	}
-
-	static inline function clamp( x : Int32 ) : Int32 {
-		#if (js || flash8 || php)
-		return cast ((cast x) | 0); // force to-int convertion
-		#else
-		return x;
-		#end
-	}
-
-	public static inline function toInt( x : Int32 ) : Int {
-		if( (((cast x) >> 30) & 1) != ((cast x) >>> 31) ) throw "Overflow " + x;
-		#if php
-		return (cast x) & 0xFFFFFFFF;
-		#else
-		return cast x;
-		#end
-	}
-
-	public static inline function toNativeInt( x : Int32 ) : Int {
-		return cast x;
-	}
-
-	public static inline function add( a : Int32, b : Int32 ) : Int32 {
-		return clamp(cast ((cast a) + (cast b)));
-	}
-
-	public static inline function sub( a : Int32, b : Int32 ) : Int32 {
-		return clamp(cast ((cast a) - (cast b)));
-	}
-
-	public static inline function mul( a : Int32, b : Int32 ) : Int32 {
-		#if (flash8 || php || js)
-		return add(cast ((cast a) * ((cast b) & 0xFFFF)),clamp(cast ((cast a) * ((cast b) >>> 16) << 16)));
-		#else
-		return clamp(cast ((cast a) * (cast b)));
-		#end
-	}
-
-	public static inline function div( a : Int32, b : Int32 ) : Int32 {
-		return cast Std.int(cast(a) / cast(b));
-	}
-
-	public static inline function mod( a : Int32, b : Int32 ) : Int32 {
-		return cast (cast(a) % cast(b));
-	}
-
-	public static inline function shl( a : Int32, b : Int ) : Int32 {
-		return cast ((cast a) << b);
-	}
-
-	public static inline function shr( a : Int32, b : Int ) : Int32 {
-		return cast ((cast a) >> b);
-	}
-
-	public static inline function ushr( a : Int32, b : Int ) : Int32 {
-		return cast ((cast a) >>> b);
-	}
-
-	public static inline function and( a : Int32, b : Int32 ) : Int32 {
-		return cast ((cast a) & (cast b));
-	}
-
-	public static inline function or( a : Int32, b : Int32 ) : Int32 {
-		return cast ((cast a) | (cast b));
-	}
-
-	public static inline function xor( a : Int32, b : Int32 ) : Int32 {
-		return cast ((cast a) ^ (cast b));
-	}
-
-	public static inline function neg( a : Int32 ) : Int32 {
-		return cast -(cast a);
-	}
-
-	public static inline function isNeg( a : Int32 ) : Bool {
-		return (cast a) < 0;
-	}
-
-	public static inline function isZero( a : Int32 ) : Bool {
-		return (cast a) == 0;
-	}
-
-	public static inline function complement( a : Int32 ) : Int32 {
-		return cast ~(cast a);
-	}
-
-	public static inline function compare( a : Int32, b : Int32 ) : Int {
-		#if neko
-		return untyped __i32__compare(a,b);
-		#else
-		return untyped a - b;
-		#end
-	}
-
-	/**
-		Compare two Int32 in unsigned mode.
-	**/
-	public static function ucompare( a : Int32, b : Int32 ) : Int {
-		if( isNeg(a) )
-			return isNeg(b) ? compare(complement(b),complement(a)) : 1;
-		return isNeg(b) ? -1 : compare(a,b);
-	}
-
-}
-
-#end

+ 2 - 206
std/haxe/Int64.hx

@@ -21,8 +21,6 @@
  */
  */
 package haxe;
 package haxe;
 
 
-#if haxe3
-
 class Int64 {
 class Int64 {
 
 
 	var high : Int;
 	var high : Int;
@@ -32,7 +30,7 @@ class Int64 {
 		this.high = i32(high);
 		this.high = i32(high);
 		this.low = i32(low);
 		this.low = i32(low);
 	}
 	}
-	
+
 	@:extern inline function i32(i) {
 	@:extern inline function i32(i) {
 		#if (php || js || flash8)
 		#if (php || js || flash8)
 		return i | 0;
 		return i | 0;
@@ -223,206 +221,4 @@ class Int64 {
 		return a.toString();
 		return a.toString();
 	}
 	}
 
 
-}
-
-
-#else
-
-using haxe.Int32;
-
-class Int64 {
-
-	var high : Int32;
-	var low : Int32;
-
-	function new(high, low) {
-		this.high = high;
-		this.low = low;
-	}
-
-	#if as3 public #end function toString() {
-		if (high.isZero() && low.isZero())
-			return "0";
-		var str = "";
-		var neg = false;
-		var i = this;
-		if( isNeg(i) ) {
-			neg = true;
-			i = Int64.neg(i);
-		}
-		var ten = ofInt(10);
-		while( !isZero(i) ) {
-			var r = divMod(i, ten);
-			str = r.modulus.low.toInt() + str;
-			i = r.quotient;
-		}
-		if( neg ) str = "-" + str;
-		return str;
-	}
-
-	public static inline function make( high : Int32, low : Int32 ) : Int64 {
-		return new Int64(high, low);
-	}
-
-	public static inline function ofInt( x : Int ) : Int64 {
-		return new Int64((x >> 31).ofInt(),x.ofInt());
-	}
-
-	public static inline function ofInt32( x : Int32 ) : Int64 {
-		return new Int64(x.shr(31),x);
-	}
-
-	public static function toInt( x : Int64 ) : Int {
-		if( x.high.toInt() != 0 ) {
-			if( x.high.isNeg() )
-				return -toInt(neg(x));
-			throw "Overflow";
-		}
-		return x.low.toInt();
-	}
-
-	public static function getLow( x : Int64 ) : Int32 {
-		return x.low;
-	}
-
-	public static function getHigh( x : Int64 ) : Int32 {
-		return x.high;
-	}
-
-	public static function add( a : Int64, b : Int64 ) : Int64 {
-		var high = a.high.add(b.high);
-		var low = a.low.add(b.low);
-		if( low.ucompare(a.low) < 0 )
-			high = high.add(1.ofInt());
-		return new Int64(high, low);
-	}
-
-	public static function sub( a : Int64, b : Int64 ) : Int64 {
-		var high = a.high.sub(b.high);
-		var low = a.low.sub(b.low);
-		if( a.low.ucompare(b.low) < 0 )
-			high = high.sub(1.ofInt());
-		return new Int64(high, low);
-	}
-
-	public static function mul( a : Int64, b : Int64 ) : Int64 {
-		var mask = 0xFFFF.ofInt();
-		var al = a.low.and(mask), ah = a.low.ushr(16);
-		var bl = b.low.and(mask), bh = b.low.ushr(16);
-		var p00 = al.mul(bl);
-		var p10 = ah.mul(bl);
-		var p01 = al.mul(bh);
-		var p11 = ah.mul(bh);
-		var low = p00;
-		var high = p11.add(p01.ushr(16)).add(p10.ushr(16));
-		p01 = p01.shl(16); low = low.add(p01); if( low.ucompare(p01) < 0 ) high = high.add(1.ofInt());
-		p10 = p10.shl(16); low = low.add(p10); if( low.ucompare(p10) < 0 ) high = high.add(1.ofInt());
-		high = high.add(a.low.mul(b.high));
-		high = high.add(a.high.mul(b.low));
-		return new Int64(high, low);
-	}
-
-	static function divMod( modulus : Int64, divisor : Int64 ) {
-		var quotient = new Int64(0.ofInt(), 0.ofInt());
-		var mask = new Int64(0.ofInt(), 1.ofInt());
-		divisor = new Int64(divisor.high, divisor.low);
-		while( !divisor.high.isNeg() ) {
-			var cmp = ucompare(divisor, modulus);
-			divisor.high = divisor.high.shl(1).or(divisor.low.ushr(31));
-			divisor.low = divisor.low.shl(1);
-			mask.high = mask.high.shl(1).or(mask.low.ushr(31));
-			mask.low = mask.low.shl(1);
-			if( cmp >= 0 ) break;
-		}
-		while( !mask.low.or(mask.high).isZero() ) {
-			if( ucompare(modulus, divisor) >= 0 ) {
-				quotient.high = quotient.high.or(mask.high);
-				quotient.low = quotient.low.or(mask.low);
-				modulus = sub(modulus, divisor);
-			}
-			mask.low = mask.low.ushr(1).or(mask.high.shl(31));
-			mask.high = mask.high.ushr(1);
-
-			divisor.low = divisor.low.ushr(1).or(divisor.high.shl(31));
-			divisor.high = divisor.high.ushr(1);
-		}
-		return { quotient : quotient, modulus : modulus };
-	}
-
-	public static inline function div( a : Int64, b : Int64 ) : Int64 {
-		var sign = a.high.or(b.high).isNeg();
-		if( a.high.isNeg() ) a = neg(a);
-		if( b.high.isNeg() ) b = neg(b);
-		var q = divMod(a, b).quotient;
-		return sign ? neg(q) : q;
-	}
-
-	public static inline function mod( a : Int64, b : Int64 ) : Int64 {
-		var sign = a.high.or(b.high).isNeg();
-		if( a.high.isNeg() ) a = neg(a);
-		if( b.high.isNeg() ) b = neg(b);
-		var m = divMod(a, b).modulus;
-		return sign ? neg(m) : m;
-	}
-
-	public static inline function shl( a : Int64, b : Int ) : Int64 {
-		return if( b & 63 == 0 ) a else if( b & 63 < 32 ) new Int64( a.high.shl(b).or(a.low.ushr(32 - (b&63))), a.low.shl(b) ) else new Int64( a.low.shl(b - 32), 0.ofInt() );
-	}
-
-	public static inline function shr( a : Int64, b : Int ) : Int64 {
-		return if( b & 63 == 0 ) a else if( b & 63 < 32 ) new Int64( a.high.shr(b), a.low.ushr(b).or(a.high.shl(32 - (b&63))) ) else new Int64( a.high.shr(31), a.high.shr(b - 32) );
-	}
-
-	public static inline function ushr( a : Int64, b : Int ) : Int64 {
-		return if( b & 63 == 0 ) a else if( b & 63 < 32 ) new Int64( a.high.ushr(b), a.low.ushr(b).or(a.high.shl(32 - (b&63))) ) else new Int64( 0.ofInt(), a.high.ushr(b - 32) );
-	}
-
-	public static inline function and( a : Int64, b : Int64 ) : Int64 {
-		return new Int64( a.high.and(b.high), a.low.and(b.low) );
-	}
-
-	public static inline function or( a : Int64, b : Int64 ) : Int64 {
-		return new Int64( a.high.or(b.high), a.low.or(b.low) );
-	}
-
-	public static inline function xor( a : Int64, b : Int64 ) : Int64 {
-		return new Int64( a.high.xor(b.high), a.low.xor(b.low) );
-	}
-
-	public static inline function neg( a : Int64 ) : Int64 {
-		var high = Int32.complement(a.high);
-		var low = Int32.neg(a.low);
-		if( low.isZero() )
-			high = high.add(1.ofInt());
-		return new Int64(high,low);
-	}
-
-	public static inline function isNeg( a : Int64 ) : Bool {
-		return a.high.isNeg();
-	}
-
-	public static inline function isZero( a : Int64 ) : Bool {
-		return a.high.or(a.low).isZero();
-	}
-
-	public static inline function compare( a : Int64, b : Int64 ) : Int {
-		var v = Int32.compare(a.high,b.high);
-		return if( v != 0 ) v else Int32.ucompare(a.low, b.low);
-	}
-
-	/**
-		Compare two Int64 in unsigned mode.
-	**/
-	public static inline function ucompare( a : Int64, b : Int64 ) : Int {
-		var v = Int32.ucompare(a.high,b.high);
-		return if( v != 0 ) v else Int32.ucompare(a.low, b.low);
-	}
-
-	public static inline function toStr( a : Int64 ) : String {
-		return a.toString();
-	}
-
-}
-
-
-#end
+}

+ 0 - 25
std/haxe/io/BytesInput.hx

@@ -143,35 +143,10 @@ class BytesInput extends Input {
 		return try b.readUnsignedShort() catch( e : Dynamic ) throw new Eof();
 		return try b.readUnsignedShort() catch( e : Dynamic ) throw new Eof();
 	}
 	}
 
 
-	#if haxe3
-
 	override function readInt32() : Int {
 	override function readInt32() : Int {
 		return try b.readInt() catch( e : Dynamic ) throw new Eof();
 		return try b.readInt() catch( e : Dynamic ) throw new Eof();
 	}
 	}
 
 
-	#else
-
-	override function readInt31() {
-		var n;
-		try n = b.readInt() catch( e : Dynamic ) throw new Eof();
-		if( (n >>> 30) & 1 != (n >>> 31) ) throw Error.Overflow;
-		return n;
-	}
-
-	override function readUInt30() {
-		var n;
-		try n = b.readInt() catch( e : Dynamic ) throw new Eof();
-		if( (n >>> 30) != 0 ) throw Error.Overflow;
-		return n;
-	}
-
-
-	override function readInt32() : haxe.Int32 {
-		return try cast b.readInt() catch( e : Dynamic ) throw new Eof();
-	}
-
-	#end
-
 	override function readString( len : Int ) {
 	override function readString( len : Int ) {
 		return try b.readUTFBytes(len) catch( e : Dynamic ) throw new Eof();
 		return try b.readUTFBytes(len) catch( e : Dynamic ) throw new Eof();
 	}
 	}

+ 0 - 22
std/haxe/io/BytesOutput.hx

@@ -89,32 +89,10 @@ class BytesOutput extends Output {
 		b.writeShort(x);
 		b.writeShort(x);
 	}
 	}
 
 
-	#if haxe3
-
 	override function writeInt32( x : Int ) {
 	override function writeInt32( x : Int ) {
 		b.writeInt(x);
 		b.writeInt(x);
 	}
 	}
 
 
-	#else
-
-	override function writeInt31( x : Int ) {
-		#if !neko
-		if( x < -0x40000000 || x >= 0x40000000 ) throw Error.Overflow;
-		#end
-		b.writeInt(x);
-	}
-
-	override function writeUInt30( x : Int ) {
-		if( x < 0 || x >= 0x40000000 ) throw Error.Overflow;
-		b.writeInt(x);
-	}
-
-	override function writeInt32( x : haxe.Int32 ) {
-		b.writeInt(cast x);
-	}
-
-	#end
-
 	override function prepare( size : Int ) {
 	override function prepare( size : Int ) {
 		if( size > 0 )
 		if( size > 0 )
 	#if cpp
 	#if cpp

+ 0 - 47
std/haxe/io/Input.hx

@@ -307,8 +307,6 @@ class Input {
 		return bigEndian ? ch3 | (ch2 << 8) | (ch1 << 16) : ch1 | (ch2 << 8) | (ch3 << 16);
 		return bigEndian ? ch3 | (ch2 << 8) | (ch1 << 16) : ch1 | (ch2 << 8) | (ch3 << 16);
 	}
 	}
 
 
-	#if haxe3
-
 	public function readInt32() {
 	public function readInt32() {
 		var ch1 = readByte();
 		var ch1 = readByte();
 		var ch2 = readByte();
 		var ch2 = readByte();
@@ -317,51 +315,6 @@ class Input {
 		return bigEndian ? ch4 | (ch3 << 8) | (ch2 << 16) | (ch1 << 24) : ch1 | (ch2 << 8) | (ch3 << 16) | (ch4 << 24);
 		return bigEndian ? ch4 | (ch3 << 8) | (ch2 << 16) | (ch1 << 24) : ch1 | (ch2 << 8) | (ch3 << 16) | (ch4 << 24);
 	}
 	}
 
 
-	#else
-
-	public function readInt31() {
-		var ch1,ch2,ch3,ch4;
-		if( bigEndian ) {
-			ch4 = readByte();
-			ch3 = readByte();
-			ch2 = readByte();
-			ch1 = readByte();
-		} else {
-			ch1 = readByte();
-			ch2 = readByte();
-			ch3 = readByte();
-			ch4 = readByte();
-		}
-		if( ((ch4 & 128) == 0) != ((ch4 & 64) == 0) ) throw Error.Overflow;
-		return ch1 | (ch2 << 8) | (ch3 << 16) | (ch4 << 24);
-	}
-
-	public function readUInt30() {
-		var ch1 = readByte();
-		var ch2 = readByte();
-		var ch3 = readByte();
-		var ch4 = readByte();
-		if( (bigEndian?ch1:ch4) >= 64 ) throw Error.Overflow;
-		return bigEndian ? ch4 | (ch3 << 8) | (ch2 << 16) | (ch1 << 24) : ch1 | (ch2 << 8) | (ch3 << 16) | (ch4 << 24);
-	}
-
-	public function readInt32() {
-		var ch1 = readByte();
-		var ch2 = readByte();
-		var ch3 = readByte();
-		var ch4 = readByte();
-#if php
-		var i = bigEndian ? ((ch1 << 8 | ch2) << 16 | (ch3 << 8 | ch4)) : ((ch4 << 8 | ch3) << 16 | (ch2 << 8 | ch1));
-		if (i > 0x7FFFFFFF)
-			untyped __php__("$i -= 0x100000000");
-		return haxe.Int32.ofInt(i);
-#else
-		return bigEndian ? haxe.Int32.make((ch1 << 8) | ch2, (ch3 << 8) | ch4) : haxe.Int32.make((ch4 << 8) | ch3, (ch2 << 8) | ch1);
-#end
-	}
-
-	#end
-
 	public function readString( len : Int ) : String {
 	public function readString( len : Int ) : String {
 		var b = Bytes.alloc(len);
 		var b = Bytes.alloc(len);
 		readFullBytes(b,0,len);
 		readFullBytes(b,0,len);

+ 0 - 52
std/haxe/io/Output.hx

@@ -265,8 +265,6 @@ class Output {
 		}
 		}
 	}
 	}
 
 
-	#if haxe3
-
 	public function writeInt32( x : Int ) {
 	public function writeInt32( x : Int ) {
 		if( bigEndian ) {
 		if( bigEndian ) {
 			writeByte( x >>> 24 );
 			writeByte( x >>> 24 );
@@ -281,56 +279,6 @@ class Output {
 		}
 		}
 	}
 	}
 
 
-	#else
-
-	public function writeInt31( x : Int ) {
-		#if !neko
-		if( x < -0x40000000 || x >= 0x40000000 ) throw Error.Overflow;
-		#end
-		if( bigEndian ) {
-			writeByte(x >>> 24);
-			writeByte((x >> 16) & 0xFF);
-			writeByte((x >> 8) & 0xFF);
-			writeByte(x & 0xFF);
-		} else {
-			writeByte(x & 0xFF);
-			writeByte((x >> 8) & 0xFF);
-			writeByte((x >> 16) & 0xFF);
-			writeByte(x >>> 24);
-		}
-	}
-
-	public function writeUInt30( x : Int ) {
-		if( x < 0 #if !neko || x >= 0x40000000 #end ) throw Error.Overflow;
-		if( bigEndian ) {
-			writeByte(x >>> 24);
-			writeByte((x >> 16) & 0xFF);
-			writeByte((x >> 8) & 0xFF);
-			writeByte(x & 0xFF);
-		} else {
-			writeByte(x & 0xFF);
-			writeByte((x >> 8) & 0xFF);
-			writeByte((x >> 16) & 0xFF);
-			writeByte(x >>> 24);
-		}
-	}
-
-	public function writeInt32( x : haxe.Int32 ) {
-		if( bigEndian ) {
-			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,24)) );
-			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,16)) & 0xFF );
-			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,8)) & 0xFF );
-			writeByte( haxe.Int32.toInt(haxe.Int32.and(x,haxe.Int32.ofInt(0xFF))) );
-		} else {
-			writeByte( haxe.Int32.toInt(haxe.Int32.and(x,haxe.Int32.ofInt(0xFF))) );
-			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,8)) & 0xFF );
-			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,16)) & 0xFF );
-			writeByte( haxe.Int32.toInt(haxe.Int32.ushr(x,24)) );
-		}
-	}
-
-	#end
-
 	/**
 	/**
 		Inform that we are about to write at least a specified number of bytes.
 		Inform that we are about to write at least a specified number of bytes.
 		The underlying implementation can allocate proper working space depending
 		The underlying implementation can allocate proper working space depending

+ 0 - 10
std/haxe/macro/Expr.hx

@@ -38,9 +38,6 @@ enum Constant {
 	CString( s : String );
 	CString( s : String );
 	CIdent( s : String );
 	CIdent( s : String );
 	CRegexp( r : String, opt : String );
 	CRegexp( r : String, opt : String );
-	#if !haxe3
-	CType( s : String );
-	#end
 }
 }
 
 
 enum Binop {
 enum Binop {
@@ -83,10 +80,6 @@ typedef Expr = {
 	var pos : Position;
 	var pos : Position;
 }
 }
 
 
-#if !haxe3
-typedef ExprRequire<T> = Expr;
-#end
-
 typedef ExprOf<T> = Expr;
 typedef ExprOf<T> = Expr;
 
 
 typedef Case = {
 typedef Case = {
@@ -138,9 +131,6 @@ enum ExprDef {
 	ETernary( econd : Expr, eif : Expr, eelse : Expr );
 	ETernary( econd : Expr, eif : Expr, eelse : Expr );
 	ECheckType( e : Expr, t : ComplexType );
 	ECheckType( e : Expr, t : ComplexType );
 	EMeta( s : MetadataEntry, e : Expr );
 	EMeta( s : MetadataEntry, e : Expr );
-	#if !haxe3
-	EType( e : Expr, field : String );
-	#end
 }
 }
 
 
 enum ComplexType {
 enum ComplexType {

+ 20 - 26
std/haxe/macro/ExprTools.hx

@@ -29,41 +29,41 @@ using Lambda;
 	This class provides some utility methods to work with expressions. It is
 	This class provides some utility methods to work with expressions. It is
 	best used through 'using haxe.macro.ExprTools' syntax and then provides
 	best used through 'using haxe.macro.ExprTools' syntax and then provides
 	additional methods on haxe.macro.Expr instances.
 	additional methods on haxe.macro.Expr instances.
-	
+
 	While mainly intended to be used in macros, it works in non-macro code as
 	While mainly intended to be used in macros, it works in non-macro code as
 	well.
 	well.
 **/
 **/
 class ExprTools {
 class ExprTools {
-	
+
 	static public function asIdent( s : String, p:Position ) : Expr
 	static public function asIdent( s : String, p:Position ) : Expr
 		return { expr : EConst(CIdent(s)), pos : p }
 		return { expr : EConst(CIdent(s)), pos : p }
-		
+
 	static public function toFieldExpr ( sl : Array<String> ) : Expr
 	static public function toFieldExpr ( sl : Array<String> ) : Expr
 		return sl.fold(function(s, e) return e == null ? (macro $i{s}) : (macro $e.$s), null)
 		return sl.fold(function(s, e) return e == null ? (macro $i{s}) : (macro $e.$s), null)
-	
+
 	/**
 	/**
 		Converts expression [e] to a human-readable String representation.
 		Converts expression [e] to a human-readable String representation.
-		
+
 		The result is guaranteed to be valid haxe code, but there may be
 		The result is guaranteed to be valid haxe code, but there may be
 		differences from the original lexical syntax.
 		differences from the original lexical syntax.
 	**/
 	**/
 	static public function toString( e : Expr ) : String
 	static public function toString( e : Expr ) : String
 		return new Printer().printExpr(e)
 		return new Printer().printExpr(e)
-		
+
 	/**
 	/**
 		Calls function [f] on each sub-expression of [e].
 		Calls function [f] on each sub-expression of [e].
-		
+
 		If [e] has no sub-expressions, this operation has no effect.
 		If [e] has no sub-expressions, this operation has no effect.
-	
+
 		Otherwise [f] is called once per sub-expression of [e], with the
 		Otherwise [f] is called once per sub-expression of [e], with the
 		sub-expression as argument. These calls are done in order of the
 		sub-expression as argument. These calls are done in order of the
 		sub-expression declarations.
 		sub-expression declarations.
-		
+
 		This method does not call itself recursively. It should instead be used
 		This method does not call itself recursively. It should instead be used
 		in a recursive function which handles the expression nodes of interest.
 		in a recursive function which handles the expression nodes of interest.
-		
+
 		Usage example:
 		Usage example:
-			
+
 		function findStrings(e:Expr) {
 		function findStrings(e:Expr) {
 			switch(e.expr) {
 			switch(e.expr) {
 				case EConst(CString(s)):
 				case EConst(CString(s)):
@@ -87,9 +87,6 @@ class ExprTools {
 				ECheckType(e, _),
 				ECheckType(e, _),
 				EUnop(_, _, e),
 				EUnop(_, _, e),
 				ECast(e, _),
 				ECast(e, _),
-				#if !haxe3
-				EType(e, _),
-				#end
 				EMeta(_, e):
 				EMeta(_, e):
 					f(e);
 					f(e);
 			case EArray(e1, e2),
 			case EArray(e1, e2),
@@ -138,21 +135,21 @@ class ExprTools {
 					f(edef);
 					f(edef);
 		}
 		}
 	}
 	}
-	
+
 	/**
 	/**
 		Transforms the sub-expressions of [e] by calling [f] on each of them.
 		Transforms the sub-expressions of [e] by calling [f] on each of them.
-		
+
 		If [e] has no sub-expressions, this operation returns [e] unchanged.
 		If [e] has no sub-expressions, this operation returns [e] unchanged.
-	
+
 		Otherwise [f] is called once per sub-expression of [e], with the
 		Otherwise [f] is called once per sub-expression of [e], with the
 		sub-expression as argument. These calls are done in order of the
 		sub-expression as argument. These calls are done in order of the
 		sub-expression declarations.
 		sub-expression declarations.
-		
+
 		This method does not call itself recursively. It should instead be used
 		This method does not call itself recursively. It should instead be used
 		in a recursive function which handles the expression nodes of interest.
 		in a recursive function which handles the expression nodes of interest.
-		
+
 		Usage example:
 		Usage example:
-		
+
 		function capitalizeStrings(e:Expr) {
 		function capitalizeStrings(e:Expr) {
 			return switch(e.expr) {
 			return switch(e.expr) {
 				case EConst(CString(s)):
 				case EConst(CString(s)):
@@ -214,16 +211,13 @@ class ExprTools {
 				for (arg in func.args)
 				for (arg in func.args)
 					ret.push( { name: arg.name, opt: arg.opt, type: arg.type, value: opt(arg.value, f) } );
 					ret.push( { name: arg.name, opt: arg.opt, type: arg.type, value: opt(arg.value, f) } );
 				EFunction(name, { args: ret, ret: func.ret, params: func.params, expr: f(func.expr) } );
 				EFunction(name, { args: ret, ret: func.ret, params: func.params, expr: f(func.expr) } );
-			#if !haxe3
-			case EType(e, field): EType(f(e), field);
-			#end
 			case EMeta(m, e): EMeta(m, f(e));
 			case EMeta(m, e): EMeta(m, f(e));
 		}};
 		}};
 	}
 	}
-	
+
 	static inline function opt(e:Null<Expr>, f : Expr -> Expr):Expr
 	static inline function opt(e:Null<Expr>, f : Expr -> Expr):Expr
 		return e == null ? null : f(e)
 		return e == null ? null : f(e)
-		
+
 	static inline function opt2(e:Null<Expr>, f : Expr -> Void):Void
 	static inline function opt2(e:Null<Expr>, f : Expr -> Void):Void
 		if (e != null) f(e)
 		if (e != null) f(e)
 }
 }
@@ -239,7 +233,7 @@ class ExprArrayTools {
 			ret.push(f(e));
 			ret.push(f(e));
 		return ret;
 		return ret;
 	}
 	}
-	
+
 	static public function iter( el : Array<Expr>, f : Expr -> Void):Void {
 	static public function iter( el : Array<Expr>, f : Expr -> Void):Void {
 		for (e in el)
 		for (e in el)
 			f(e);
 			f(e);

+ 17 - 23
std/haxe/macro/Printer.hx

@@ -28,12 +28,12 @@ using Lambda;
 class Printer {
 class Printer {
 	var tabs:String;
 	var tabs:String;
 	var tabString:String;
 	var tabString:String;
-	
+
 	public function new(?tabString = "\t") {
 	public function new(?tabString = "\t") {
 		tabs = "";
 		tabs = "";
 		this.tabString = tabString;
 		this.tabString = tabString;
 	}
 	}
-	
+
 	public function printUnop(op:Unop) return switch(op) {
 	public function printUnop(op:Unop) return switch(op) {
 		case OpIncrement: "++";
 		case OpIncrement: "++";
 		case OpDecrement: "--";
 		case OpDecrement: "--";
@@ -41,7 +41,7 @@ class Printer {
 		case OpNeg: "-";
 		case OpNeg: "-";
 		case OpNegBits: "~";
 		case OpNegBits: "~";
 	}
 	}
-	
+
 	public function printBinop(op:Binop) return switch(op) {
 	public function printBinop(op:Binop) return switch(op) {
 		case OpAdd: "+";
 		case OpAdd: "+";
 		case OpMult: "*";
 		case OpMult: "*";
@@ -69,30 +69,27 @@ class Printer {
 			printBinop(op)
 			printBinop(op)
 			+ "=";
 			+ "=";
 	}
 	}
-		
+
 	public function printConstant(c:Constant) return switch(c) {
 	public function printConstant(c:Constant) return switch(c) {
 		case CString(s): '"$s"';
 		case CString(s): '"$s"';
 		case CIdent(s),
 		case CIdent(s),
-			#if !haxe3
-			CType(s),
-			#end
 			CInt(s),
 			CInt(s),
 			CFloat(s):
 			CFloat(s):
 				s;
 				s;
 		case CRegexp(s,opt): '~/$s/$opt';
 		case CRegexp(s,opt): '~/$s/$opt';
 	}
 	}
-	
+
 	public function printTypeParam(param:TypeParam) return switch(param) {
 	public function printTypeParam(param:TypeParam) return switch(param) {
 		case TPType(ct): printComplexType(ct);
 		case TPType(ct): printComplexType(ct);
 		case TPExpr(e): printExpr(e);
 		case TPExpr(e): printExpr(e);
 	}
 	}
-	
+
 	public function printTypePath(tp:TypePath) return
 	public function printTypePath(tp:TypePath) return
 		(tp.pack.length > 0 ? tp.pack.join(".") + "." : "")
 		(tp.pack.length > 0 ? tp.pack.join(".") + "." : "")
 		+ tp.name
 		+ tp.name
 		+ (tp.sub != null ? '.$tp.sub' : "")
 		+ (tp.sub != null ? '.$tp.sub' : "")
 		+ (tp.params.length > 0 ? "<" + tp.params.map(printTypeParam).join(",") + ">" : "")
 		+ (tp.params.length > 0 ? "<" + tp.params.map(printTypeParam).join(",") + ">" : "")
-	
+
 	// TODO: check if this can cause loops
 	// TODO: check if this can cause loops
 	public function printComplexType(ct:ComplexType) return switch(ct) {
 	public function printComplexType(ct:ComplexType) return switch(ct) {
 		case TPath(tp): printTypePath(tp);
 		case TPath(tp): printTypePath(tp);
@@ -102,7 +99,7 @@ class Printer {
 		case TOptional(ct): "?" + printComplexType(ct);
 		case TOptional(ct): "?" + printComplexType(ct);
 		case TExtend(tp, fields): '{${printTypePath(tp)} >, ${fields.map(printField).join(",")}}';
 		case TExtend(tp, fields): '{${printTypePath(tp)} >, ${fields.map(printField).join(",")}}';
 	}
 	}
-	
+
 	public function printMetadata(meta:MetadataEntry) return
 	public function printMetadata(meta:MetadataEntry) return
 		'@${meta.name}'
 		'@${meta.name}'
 		+ (meta.params.length > 0 ? '(${printExprs(meta.params,",")})' : "")
 		+ (meta.params.length > 0 ? '(${printExprs(meta.params,",")})' : "")
@@ -125,38 +122,35 @@ class Printer {
 		  case FProp(get, set, t, eo): 'var ${field.name}($get,$set)' + opt(t, printComplexType, ":") + opt(eo, printExpr, "=");
 		  case FProp(get, set, t, eo): 'var ${field.name}($get,$set)' + opt(t, printComplexType, ":") + opt(eo, printExpr, "=");
 		  case FFun(func): 'function ${field.name}' + printFunction(func);
 		  case FFun(func): 'function ${field.name}' + printFunction(func);
 		}
 		}
-	
+
 	public function printTypeParamDecl(tpd:TypeParamDecl) return
 	public function printTypeParamDecl(tpd:TypeParamDecl) return
 		tpd.name
 		tpd.name
 		+ (tpd.params.length > 0 ? "<" + tpd.params.map(printTypeParamDecl).join(",") + ">" : "")
 		+ (tpd.params.length > 0 ? "<" + tpd.params.map(printTypeParamDecl).join(",") + ">" : "")
 		+ (tpd.constraints.length > 0 ? ":(" + tpd.constraints.map(printComplexType).join(",") + ")" : "")
 		+ (tpd.constraints.length > 0 ? ":(" + tpd.constraints.map(printComplexType).join(",") + ")" : "")
-	
+
 	public function printFunctionArg(arg:FunctionArg) return
 	public function printFunctionArg(arg:FunctionArg) return
 		(arg.opt ? "?" : "")
 		(arg.opt ? "?" : "")
 		+ arg.name
 		+ arg.name
 		+ opt(arg.type, printComplexType, ":")
 		+ opt(arg.type, printComplexType, ":")
 		+ opt(arg.value, printExpr, "=")
 		+ opt(arg.value, printExpr, "=")
-	
+
 	public function printFunction(func:Function) return
 	public function printFunction(func:Function) return
 		(func.params.length > 0 ? "<" + func.params.map(printTypeParamDecl).join(",") + ">" : "")
 		(func.params.length > 0 ? "<" + func.params.map(printTypeParamDecl).join(",") + ">" : "")
 		+ "(" + func.args.map(printFunctionArg).join(",") + ")"
 		+ "(" + func.args.map(printFunctionArg).join(",") + ")"
 		+ opt(func.ret, printComplexType, ":")
 		+ opt(func.ret, printComplexType, ":")
 		+ opt(func.expr, printExpr, " ")
 		+ opt(func.expr, printExpr, " ")
-	
+
 	public function printVar(v:Var) return
 	public function printVar(v:Var) return
 		v.name
 		v.name
 		+ opt(v.type, printComplexType, ":")
 		+ opt(v.type, printComplexType, ":")
 		+ opt(v.expr, printExpr, "=")
 		+ opt(v.expr, printExpr, "=")
-	
-	
+
+
 	public function printExpr(e:Expr) return e == null ? "#NULL" : switch(e.expr) {
 	public function printExpr(e:Expr) return e == null ? "#NULL" : switch(e.expr) {
 		case EConst(c): printConstant(c);
 		case EConst(c): printConstant(c);
 		case EArray(e1, e2): '${printExpr(e1)}[${printExpr(e2)}]';
 		case EArray(e1, e2): '${printExpr(e1)}[${printExpr(e2)}]';
 		case EBinop(op, e1, e2): '${printExpr(e1)}${printBinop(op)}${printExpr(e2)}';
 		case EBinop(op, e1, e2): '${printExpr(e1)}${printBinop(op)}${printExpr(e2)}';
-		case EField(e1, n)
-			#if !haxe3
-			,EType(e1, n)
-			#end : '${printExpr(e1)}.$n';
+		case EField(e1, n): '${printExpr(e1)}.$n';
 		case EParenthesis(e1): '(${printExpr(e1)})';
 		case EParenthesis(e1): '(${printExpr(e1)})';
 		case EObjectDecl(fl):
 		case EObjectDecl(fl):
 			"{" + fl.map(function(fld) return '${fld.field}:${printExpr(fld.expr)}').join(",") + "}";
 			"{" + fl.map(function(fld) return '${fld.field}:${printExpr(fld.expr)}').join(",") + "}";
@@ -209,10 +203,10 @@ class Printer {
 		case ECheckType(e1, ct): '#CHECK_TYPE(${printExpr(e1)}, ${printComplexType(ct)})';
 		case ECheckType(e1, ct): '#CHECK_TYPE(${printExpr(e1)}, ${printComplexType(ct)})';
 		case EMeta(meta, e1): printMetadata(meta) + " " +printExpr(e1);
 		case EMeta(meta, e1): printMetadata(meta) + " " +printExpr(e1);
 	}
 	}
-	
+
 	public function printExprs(el:Array<Expr>, sep:String) {
 	public function printExprs(el:Array<Expr>, sep:String) {
 		return el.map(printExpr).join(sep);
 		return el.map(printExpr).join(sep);
 	}
 	}
-	
+
 	function opt<T>(v:T, f:T->String, prefix = "") return v == null ? "" : (prefix + f(v))
 	function opt<T>(v:T, f:T->String, prefix = "") return v == null ? "" : (prefix + f(v))
 }
 }

+ 0 - 4
std/java/_std/EReg.hx

@@ -241,8 +241,4 @@ class EReg {
 			buf.add(s.substr(offset));
 			buf.add(s.substr(offset));
 		return buf.toString();
 		return buf.toString();
 	}
 	}
-
-	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String return map(s, f)
-	#end
 }
 }

+ 0 - 6
std/java/_std/Std.hx

@@ -242,10 +242,4 @@ import java.internal.Exceptions;
 		return Std.int(Math.random() * x);
 		return Std.int(Math.random() * x);
 	}
 	}
 
 
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprRequire<String> {
-		return haxe.macro.Format.format(fmt);
-	}
-	#end
-
 }
 }

+ 0 - 139
std/java/_std/haxe/Int32.hx

@@ -1,139 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package haxe;
-
-#if !haxe3
-
-@:nativeGen
-class Int32
-{
-	public static inline function make( a : Int, b : Int ) : Int32
-	{
-		return cast ((a << 16) | b);
-	}
-
-	public static inline function ofInt( x : Int ) : Int32
-	{
-		return cast x;
-	}
-
-	public static function toInt( x : Int32 ) : Int
-	{
-		if ( (((cast x) >> 30) & 1) != ((cast x) >>> 31) ) throw "Overflow " + x;
-
-		return cast x;
-	}
-
-	public static inline function add( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) + cast b);
-	}
-
-	public static inline function sub( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) - cast b);
-	}
-
-	public static inline function mul( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) * cast b);
-	}
-
-	public static inline function div( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) / cast b);
-	}
-
-	public static inline function mod( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) % cast b);
-	}
-
-	public static inline function shl( a : Int32, b : Int ) : Int32
-	{
-		return cast ((cast a) << b);
-	}
-
-	public static inline function shr( a : Int32, b : Int ) : Int32
-	{
-		return cast ((cast a) >> b);
-	}
-
-	public static inline function ushr( a : Int32, b : Int ) : Int32
-	{
-		return cast ((cast a) >>> b);
-	}
-
-	public static inline function and( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) & cast b);
-	}
-
-	public static inline function or( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) | cast b);
-	}
-
-	public static inline function xor( a : Int32, b : Int32 ) : Int32
-	{
-		return cast ((cast a) ^ cast b);
-	}
-
-	public static inline function neg( a : Int32 ) : Int32
-	{
-		return cast -(cast a);
-	}
-
-	public static inline function complement( a : Int32 ) : Int32
-	{
-		return cast ~(cast a);
-	}
-
-	public static inline function compare( a : Int32, b : Int32 ) : Int
-	{
-		return (cast a) - cast b;
-	}
-
-	public static inline function isNeg( a : Int32 ) : Bool
-	{
-		return (cast a) < 0;
-	}
-
-	public static inline function isZero( a : Int32 ) : Bool
-	{
-		return (cast a) == 0;
-	}
-
-	public static function ucompare( a : Int32, b : Int32 ) : Int
-	{
-		if( isNeg(a) )
-			return isNeg(b) ? compare(complement(b),complement(a)) : 1;
-		return isNeg(b) ? -1 : compare(a,b);
-	}
-
-	public static inline function toNativeInt(a:Int32) : Int
-	{
-		return cast a;
-	}
-}
-
-#end

+ 0 - 25
std/java/_std/haxe/Int64.hx

@@ -30,8 +30,6 @@ private typedef NativeInt64 = Int;
 	@:extern private static inline function ofNative(i:NativeInt64):Int64 return untyped i
 	@:extern private static inline function ofNative(i:NativeInt64):Int64 return untyped i
 	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i
 	@:extern private static inline function mkNative(i:Dynamic):NativeInt64 return i
 
 
-	#if haxe3
-
 	public static inline function make( high : Int, low : Int ) : Int64
 	public static inline function make( high : Int, low : Int ) : Int64
 	{
 	{
 		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
 		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
@@ -47,29 +45,6 @@ private typedef NativeInt64 = Int;
 		return cast(x,NativeInt64) >>> 32;
 		return cast(x,NativeInt64) >>> 32;
 	}
 	}
 
 
-	#else
-
-	public static inline function make( high : Int32, low : Int32 ) : Int64
-	{
-		return ((cast(high, NativeInt64) << 32 ) | (cast(low, NativeInt64))).ofNative();
-	}
-
-	public static inline function ofInt32( x : Int32 ) : Int64 {
-		return cast x;
-	}
-
-	public static inline function getLow( x : Int64 ) : Int32
-	{
-		return cast (x.asNative() & 0xFFFFFFFF.mkNative());
-	}
-
-	public static inline function getHigh( x : Int64 ) : Int32
-	{
-		return cast(cast(x,NativeInt64) >>> 32, Int32);
-	}
-
-	#end
-
 	public static inline function ofInt( x : Int ) : Int64 {
 	public static inline function ofInt( x : Int ) : Int64 {
 		return cast x;
 		return cast x;
 	}
 	}

+ 2 - 12
std/js/_std/EReg.hx

@@ -73,8 +73,8 @@
 			}
 			}
 			b;
 			b;
 		}
 		}
-	}	
-	
+	}
+
 	public function split( s : String ) : Array<String> {
 	public function split( s : String ) : Array<String> {
 		// we can't use directly s.split because it's ignoring the 'g' flag
 		// we can't use directly s.split because it's ignoring the 'g' flag
 		var d = "#__delim__#";
 		var d = "#__delim__#";
@@ -109,14 +109,4 @@
 			buf.add(s.substr(offset));
 			buf.add(s.substr(offset));
 		return buf.toString();
 		return buf.toString();
 	}
 	}
-
-	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String {
-		var old = r.global;
-		r.global = true;
-		var ret = map(s, f);
-		r.global = old;
-		return ret;
-	}
-	#end
 }
 }

+ 0 - 6
std/js/_std/Std.hx

@@ -54,12 +54,6 @@ import js.Boot;
 		return untyped x <= 0 ? 0 : Math.floor(Math.random()*x);
 		return untyped x <= 0 ? 0 : Math.floor(Math.random()*x);
 	}
 	}
 
 
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprOf<String> {
-		return haxe.macro.Context.format(fmt);
-	}
-	#end
-
 	static function __init__() : Void untyped {
 	static function __init__() : Void untyped {
 		__feature__("js.Boot.getClass",String.prototype.__class__ = __feature__("Type.resolveClass",$hxClasses["String"] = String,String));
 		__feature__("js.Boot.getClass",String.prototype.__class__ = __feature__("Type.resolveClass",$hxClasses["String"] = String,String));
 		__feature__("js.Boot.isClass",String.__name__ = __feature__("Type.getClassName",["String"],true));
 		__feature__("js.Boot.isClass",String.__name__ = __feature__("Type.getClassName",["String"],true));

+ 4 - 14
std/neko/_std/EReg.hx

@@ -61,7 +61,7 @@
 	public function matchedPos() : { pos : Int, len : Int } {
 	public function matchedPos() : { pos : Int, len : Int } {
 		return regexp_matched_pos(r,0);
 		return regexp_matched_pos(r,0);
 	}
 	}
-	
+
 	public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
 	public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
 		var p = regexp_match(r, untyped s.__s, pos, len < 0 ? s.length - pos : len);
 		var p = regexp_match(r, untyped s.__s, pos, len < 0 ? s.length - pos : len);
 		if( p )
 		if( p )
@@ -69,7 +69,7 @@
 		else
 		else
 			last = null;
 			last = null;
 		return p;
 		return p;
-	}		
+	}
 
 
 	public function split( s : String ) : Array<String> {
 	public function split( s : String ) : Array<String> {
 		var pos = 0;
 		var pos = 0;
@@ -171,7 +171,7 @@
 		//b.addSub(s,pos,len);
 		//b.addSub(s,pos,len);
 		//return b.toString();
 		//return b.toString();
 	//}
 	//}
-	
+
 	public function map( s : String, f : EReg -> String ) : String {
 	public function map( s : String, f : EReg -> String ) : String {
 		var offset = 0;
 		var offset = 0;
 		var buf = new StringBuf();
 		var buf = new StringBuf();
@@ -193,7 +193,7 @@
 				offset = p.pos + p.len;
 				offset = p.pos + p.len;
 		} while (global);
 		} while (global);
 		if (!global && offset < s.length)
 		if (!global && offset < s.length)
-			buf.add(s.substr(offset));		
+			buf.add(s.substr(offset));
 		return buf.toString();
 		return buf.toString();
 	}
 	}
 
 
@@ -201,14 +201,4 @@
 	static var regexp_match = neko.Lib.load("regexp","regexp_match",4);
 	static var regexp_match = neko.Lib.load("regexp","regexp_match",4);
 	static var regexp_matched = neko.Lib.load("regexp","regexp_matched",2);
 	static var regexp_matched = neko.Lib.load("regexp","regexp_matched",2);
 	static var regexp_matched_pos : Dynamic -> Int -> { pos : Int, len : Int } = neko.Lib.load("regexp","regexp_matched_pos",2);
 	static var regexp_matched_pos : Dynamic -> Int -> { pos : Int, len : Int } = neko.Lib.load("regexp","regexp_matched_pos",2);
-
-	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String {
-		var old = global;
-		global = true;
-		var ret = map(s, f);
-		global = old;
-		return ret;
-	}
-	#end
 }
 }

+ 0 - 6
std/neko/_std/Std.hx

@@ -57,12 +57,6 @@
 		return untyped Math._rand_int(Math.__rnd,x);
 		return untyped Math._rand_int(Math.__rnd,x);
 	}
 	}
 
 
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprOf<String> {
-		return haxe.macro.Format.format(fmt);
-	}
-	#end
-
 	static function __init__() : Void untyped {
 	static function __init__() : Void untyped {
 		Int = { __name__ : ["Int"] };
 		Int = { __name__ : ["Int"] };
 		Float = { __name__ : ["Float"] };
 		Float = { __name__ : ["Float"] };

+ 2 - 2
std/neko/db/Object.hx

@@ -27,10 +27,10 @@ package neko.db;
 **/
 **/
 #if !spod_macro
 #if !spod_macro
 
 
-#if( spod_rtti && haxe3 )
+#if spod_rtti
 @:rttiInfos
 @:rttiInfos
 #end
 #end
-class Object #if (spod_rtti && !haxe3) implements haxe.rtti.Infos #end {
+class Object {
 
 
 /*
 /*
 	(optional)
 	(optional)

+ 1 - 1
std/neko/vm/Module.hx

@@ -175,7 +175,7 @@ class Module {
 		if( i.readByte() != 0x4E || i.readByte() != 0x45 || i.readByte() != 0x4B || i.readByte() != 0x4F )
 		if( i.readByte() != 0x4E || i.readByte() != 0x45 || i.readByte() != 0x4B || i.readByte() != 0x4F )
 			throw "Not a neko file";
 			throw "Not a neko file";
 		function readInt() {
 		function readInt() {
-			return #if haxe3 i.readInt32() #else i.readUInt30() #end;
+			return i.readInt32();
 		}
 		}
 		var nglobals = readInt();
 		var nglobals = readInt();
 		var nfields = readInt();
 		var nfields = readInt();

+ 3 - 13
std/php/_std/EReg.hx

@@ -72,7 +72,7 @@
 	public function matchedPos() : { pos : Int, len : Int } {
 	public function matchedPos() : { pos : Int, len : Int } {
 		return untyped { pos : __php__("$this->matches[0][1]"), len : __call__("strlen",__php__("$this->matches[0][0]")) };
 		return untyped { pos : __php__("$this->matches[0][1]"), len : __call__("strlen",__php__("$this->matches[0][0]")) };
 	}
 	}
-	
+
 	public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
 	public function matchSub( s : String, pos : Int, len : Int = -1):Bool {
 		var p : Int = untyped __call__("preg_match", re, len < 0 ? s : s.substr(0,pos + len), matches, __php__("PREG_OFFSET_CAPTURE"), pos);
 		var p : Int = untyped __call__("preg_match", re, len < 0 ? s : s.substr(0,pos + len), matches, __php__("PREG_OFFSET_CAPTURE"), pos);
 		if(p > 0) {
 		if(p > 0) {
@@ -81,7 +81,7 @@
 		else
 		else
 			last = null;
 			last = null;
 		return p > 0;
 		return p > 0;
-	}	
+	}
 
 
 	public function split( s : String ) : Array<String> {
 	public function split( s : String ) : Array<String> {
 		return untyped __php__("new _hx_array(preg_split($this->re, $s, $this->hglobal ? -1 : 2))");
 		return untyped __php__("new _hx_array(preg_split($this->re, $s, $this->hglobal ? -1 : 2))");
@@ -115,17 +115,7 @@
 				offset = p.pos + p.len;
 				offset = p.pos + p.len;
 		} while (global);
 		} while (global);
 		if (!global && offset < s.length)
 		if (!global && offset < s.length)
-			buf.add(s.substr(offset));		
+			buf.add(s.substr(offset));
 		return buf.toString();
 		return buf.toString();
 	}
 	}
-	
-	#if !haxe3
-	public inline function customReplace( s : String, f : EReg -> String ) : String {
-		var old = global;
-		global = true;
-		var ret = map(s, f);
-		global = old;
-		return ret;
-	}
-	#end
 }
 }

+ 0 - 6
std/php/_std/Std.hx

@@ -56,10 +56,4 @@
 		return untyped x <= 0 ? 0 : __call__("mt_rand", 0, x-1);
 		return untyped x <= 0 ? 0 : __call__("mt_rand", 0, x-1);
 	}
 	}
 
 
-	#if !haxe3
-	@:macro public static function format( fmt : haxe.macro.Expr.ExprOf<String> ) : haxe.macro.Expr.ExprOf<String> {
-		return haxe.macro.Context.format(fmt);
-	}
-	#end
-	
 }
 }

+ 1 - 37
std/sys/db/SpodMacros.hx

@@ -255,11 +255,7 @@ class SpodMacros {
 		return switch( e.expr ) {
 		return switch( e.expr ) {
 		case EConst(c):
 		case EConst(c):
 			switch( c ) {
 			switch( c ) {
-			#if haxe3
 			case CIdent(s): s;
 			case CIdent(s): s;
-			#else
-			case CIdent(s), CType(s): s;
-			#end
 			default: error("Identifier expected", e.pos);
 			default: error("Identifier expected", e.pos);
 			}
 			}
 		default: error("Identifier expected", e.pos);
 		default: error("Identifier expected", e.pos);
@@ -414,7 +410,7 @@ class SpodMacros {
 	}
 	}
 
 
 	function initManager( pos : Position ) {
 	function initManager( pos : Position ) {
-		manager = { expr : #if haxe3 EField #else EType #end({ expr : EField({ expr : EConst(CIdent("sys")), pos : pos },"db"), pos : pos }, "Manager"), pos : pos };
+		manager = { expr : EField({ expr : EField({ expr : EConst(CIdent("sys")), pos : pos },"db"), pos : pos }, "Manager"), pos : pos };
 	}
 	}
 
 
 	inline function makeString( s : String, pos ) {
 	inline function makeString( s : String, pos ) {
@@ -625,17 +621,9 @@ class SpodMacros {
 					var p = f.expr.pos;
 					var p = f.expr.pos;
 					path.push("manager");
 					path.push("manager");
 					var first = path.shift();
 					var first = path.shift();
-					#if haxe3
 					var mpath = { expr : EConst(CIdent(first)), pos : p };
 					var mpath = { expr : EConst(CIdent(first)), pos : p };
-					#else
-					var mpath = { expr : EConst(first.charCodeAt(0) <= 'Z'.code ? CType(first) : CIdent(first)), pos : p };
-					#end
 					for ( e in path )
 					for ( e in path )
-						#if haxe3
 						mpath = { expr : EField(mpath, e), pos : p };
 						mpath = { expr : EField(mpath, e), pos : p };
-						#else
-						mpath = { expr : e.charCodeAt(0) <= 'Z'.code ? EType(mpath, e) : EField(mpath, e), pos : p };
-						#end
 					var m = getManager(typeof(mpath),p);
 					var m = getManager(typeof(mpath),p);
 					var getid = { expr : ECall( { expr : EField(mpath, "unsafeGetId"), pos : p }, [f.expr]), pos : p };
 					var getid = { expr : ECall( { expr : EField(mpath, "unsafeGetId"), pos : p }, [f.expr]), pos : p };
 					f.field = r.key;
 					f.field = r.key;
@@ -757,11 +745,7 @@ class SpodMacros {
 			case CFloat(s): return { sql : makeString(s, p), t : DFloat, n : false };
 			case CFloat(s): return { sql : makeString(s, p), t : DFloat, n : false };
 			case CString(s): return { sql : sqlQuoteValue(cond, DText), t : DString(s.length), n : false };
 			case CString(s): return { sql : sqlQuoteValue(cond, DText), t : DString(s.length), n : false };
 			case CRegexp(_): error("Unsupported", p);
 			case CRegexp(_): error("Unsupported", p);
-			#if haxe3
 			case CIdent(n):
 			case CIdent(n):
-			#else
-			case CIdent(n), CType(n):
-			#end
 				if( n.charCodeAt(0) == "$".code ) {
 				if( n.charCodeAt(0) == "$".code ) {
 					n = n.substr(1);
 					n = n.substr(1);
 					var f = inf.hfields.get(n);
 					var f = inf.hfields.get(n);
@@ -782,11 +766,7 @@ class SpodMacros {
 			switch( c.expr ) {
 			switch( c.expr ) {
 			case EConst(co):
 			case EConst(co):
 				switch(co) {
 				switch(co) {
-				#if haxe3
 				case CIdent(t):
 				case CIdent(t):
-				#else
-				case CIdent(t), CType(t):
-				#end
 					if( t.charCodeAt(0) == '$'.code ) {
 					if( t.charCodeAt(0) == '$'.code ) {
 						var f = g.functions.get(t.substr(1));
 						var f = g.functions.get(t.substr(1));
 						if( f == null ) error("Unknown method " + t, c.pos);
 						if( f == null ) error("Unknown method " + t, c.pos);
@@ -811,11 +791,7 @@ class SpodMacros {
 					}
 					}
 				default:
 				default:
 				}
 				}
-			#if haxe3
 			case EField(e, f):
 			case EField(e, f):
-			#else
-			case EField(e, f), EType(e, f):
-			#end
 				switch( f ) {
 				switch( f ) {
 				case "like":
 				case "like":
 					if( pl.length == 1 ) {
 					if( pl.length == 1 ) {
@@ -846,11 +822,7 @@ class SpodMacros {
 			default:
 			default:
 			}
 			}
 			return buildDefault(cond);
 			return buildDefault(cond);
-		#if haxe3
 		case EField(_, _), EDisplay(_):
 		case EField(_, _), EDisplay(_):
-		#else
-		case EField(_, _), EType(_, _), EDisplay(_):
-		#end
 			return buildDefault(cond);
 			return buildDefault(cond);
 		case EIf(e, e1, e2), ETernary(e, e1, e2):
 		case EIf(e, e1, e2), ETernary(e, e1, e2):
 			if( e2 == null ) error("If must have an else statement", p);
 			if( e2 == null ) error("If must have an else statement", p);
@@ -907,11 +879,7 @@ class SpodMacros {
 		switch( e.expr ) {
 		switch( e.expr ) {
 		case EConst(c):
 		case EConst(c):
 			switch( c ) {
 			switch( c ) {
-			#if haxe3
 			case CIdent(t):
 			case CIdent(t):
-			#else
-			case CIdent(t), CType(t):
-			#end
 				if( !inf.hfields.exists(t) )
 				if( !inf.hfields.exists(t) )
 					error("Unknown database field", e.pos);
 					error("Unknown database field", e.pos);
 				return quoteField(t);
 				return quoteField(t);
@@ -1272,11 +1240,7 @@ class SpodMacros {
 							switch( p.expr ) {
 							switch( p.expr ) {
 							case EConst(c):
 							case EConst(c):
 								switch( c ) {
 								switch( c ) {
-								#if haxe3
 								case CIdent(i):
 								case CIdent(i):
-								#else
-								case CIdent(i), CType(i):
-								#end
 									relParams.push(i);
 									relParams.push(i);
 								default:
 								default:
 								}
 								}

+ 0 - 1
std/tools/haxedoc/haxedoc.hxml

@@ -1,4 +1,3 @@
 -neko haxedoc.n
 -neko haxedoc.n
 -main tools.haxedoc.Main
 -main tools.haxedoc.Main
--D haxe3
 -cmd "nekotools boot haxedoc.n"
 -cmd "nekotools boot haxedoc.n"

+ 0 - 5
std/tools/haxelib/Data.hx

@@ -20,13 +20,8 @@
  * DEALINGS IN THE SOFTWARE.
  * DEALINGS IN THE SOFTWARE.
  */
  */
 package tools.haxelib;
 package tools.haxelib;
-#if haxe3
 import haxe.zip.Reader;
 import haxe.zip.Reader;
 import haxe.zip.Entry;
 import haxe.zip.Entry;
-#else
-import neko.zip.Reader;
-private typedef Entry = ZipEntry;
-#end
 
 
 import haxe.xml.Check;
 import haxe.xml.Check;
 
 

+ 0 - 4
std/tools/haxelib/Main.hx

@@ -20,11 +20,7 @@
  * DEALINGS IN THE SOFTWARE.
  * DEALINGS IN THE SOFTWARE.
  */
  */
 package tools.haxelib;
 package tools.haxelib;
-#if haxe3
 import haxe.zip.Reader;
 import haxe.zip.Reader;
-#else
-import neko.zip.Reader;
-#end
 
 
 enum Answer {
 enum Answer {
 	Yes;
 	Yes;

+ 0 - 2
std/tools/haxelib/haxelib.hxml

@@ -1,9 +1,7 @@
 -neko index.n
 -neko index.n
 -main tools.haxelib.Site
 -main tools.haxelib.Site
--D haxe3
 -dce no
 -dce no
 --next
 --next
 -neko haxelib.n
 -neko haxelib.n
 -main tools.haxelib.Main
 -main tools.haxelib.Main
 -cmd "nekotools boot haxelib.n"
 -cmd "nekotools boot haxelib.n"
--D haxe3

+ 0 - 1
std/tools/hxinst/hxinst.hxml

@@ -1,5 +1,4 @@
 # Neko
 # Neko
--D haxe3
 -lib format
 -lib format
 -neko hxinst.n
 -neko hxinst.n
 -main tools.hxinst.Main
 -main tools.hxinst.Main

+ 0 - 1
tests/unit/Test.hx

@@ -216,7 +216,6 @@ package unit;
 			new TestOps(),
 			new TestOps(),
 			new TestBasetypes(),
 			new TestBasetypes(),
 			new TestBytes(),
 			new TestBytes(),
-			#if !haxe3 new TestInt32(), #end
 			new TestIO(),
 			new TestIO(),
 			new TestLocals(),
 			new TestLocals(),
 			new TestEReg(),
 			new TestEReg(),

+ 0 - 123
tests/unit/TestInt32.hx

@@ -1,123 +0,0 @@
-package unit;
-import haxe.Int32;
-using haxe.Int32;
-
-class TestInt32 extends Test {
-
-	static inline function i( x ) {
-		return Int32.toInt(x);
-	}
-
-	static inline function i32( x ) {
-		return Int32.ofInt(x);
-	}
-
-	public function test() {
-		// constants
-		eq( 0xFE08BE39, -32981447 );
-
-		var one = i32(1);
-		var minone = i32(-1);
-		var zero = i32(0);
-
-		// ofInt / make
-		eq( i(zero), 0 );
-		eq( i(one), 1 );
-		eq( i(minone), -1 );
-		eq( i(i32(0x01020304)), 0x01020304 );
-		eq( i(Int32.make(0x0102, 0x0304)), 0x01020304 );
-		eq( i(Int32.make(0x10102, 0x0304)), 0x01020304 );
-
-		// 31 bits overflow
-		exc( function() i(Int32.shl(one,30)) );
-		exc( function() i(Int32.shl(i32(2),30)) );
-		exc( function() i(Int32.neg(Int32.add(Int32.shl(one,30),one))) );
-
-		// check correct closure creation (not inlined)
-		var f = Int32.make;
-		eq( i(f(0x0102,0x0304)), 0x01020304 );
-
-		eq( Int32.compare(one,one), 0 );
-		eq( Int32.compare(one,zero), 1 );
-		eq( Int32.compare(zero,one), -1 );
-		eq( Int32.compare(minone,minone), 0 );
-		eq( Int32.compare(minone,zero), -1 );
-		eq( Int32.compare(zero,minone), 1 );
-
-		eq( Int32.ucompare(one,one), 0 );
-		eq( Int32.ucompare(one,zero), 1 );
-		eq( Int32.ucompare(zero,one), -1 );
-		eq( Int32.ucompare(minone,minone), 0 );
-		eq( Int32.ucompare(minone,zero), 1 );
-		eq( Int32.ucompare(zero,minone), -1 );
-		eq( Int32.ucompare((-1).ofInt(),(-2).ofInt()), 1 );
-		eq( Int32.ucompare((-2).ofInt(),(-1).ofInt()), -1 );
-
-
-		eq( i(Int32.add(one,one)), 2 );
-		eq( i(Int32.sub(minone,one)), -2 );
-		eq( i(Int32.mul(i32(5),i32(100))), 500 );
-
-		// overflow
-		eq( i(Int32.mul(i32(160427), i32(160427))), 0xFE08BE39 );
-		
-		// float overflow
-		eq( i(Int32.mul(f(0x811C,0x9DAE), i32(16777619))), -301188886 );
-
-		// signed divide and modulo
-		eq( i(Int32.div(i32(0x3E08BE39),i32(16))), 0x03E08BE3 );
-		eq( i(Int32.div(i32(0xFE08BE39),i32(16))), 0xFFE08BE4 );
-		eq( i(Int32.mod(i32(0xFE08BE39),i32(0xFFFF))), -17342 );
-		eq( i(Int32.mod(i32(0xE08BE39),i32(0x10000))), 0xBE39 );
-
-		// logical
-		eq( i(Int32.shl(i32(5),16)), 0x50000 );
-		eq( i(Int32.shl(i32(3),30)), 0xC0000000 );
-		eq( i(Int32.shr(i32(-1),16)), -1 );
-		eq( i(Int32.ushr(i32(-1),16)), 0xFFFF );
-
-		eq( i(Int32.and(i32(0xFE08BE39),i32(0xFFFF))), 0xBE39 );
-		eq( i(Int32.and(i32(0xFE08BE39),i32(0xFFFF0000))), 0xFE080000 );
-		eq( i(Int32.and(i32(0xFE08BE39),i32(0xFFF0000))), 0x0E080000 );
-
-		eq( i(Int32.or(i32(0xFE08BE39),i32(0xFFFF))), 0xFE08FFFF );
-		eq( i(Int32.or(i32(0xFE08BE39),i32(0xFFFF0000))), 0xFFFFBE39 );
-		eq( i(Int32.or(i32(0xBE39),i32(0xFE080000))), 0xFE08BE39 );
-
-		eq( i(Int32.xor(i32(0xFE08BE39),i32(0xCBCDEF99))), 0x35C551A0 );
-		eq( i(Int32.neg(one)), -1 );
-		eq( i(Int32.complement(i32(55))), -56 );
-		eq( i(Int32.complement(i32( -0x10000))), 0xFFFF );
-
-		// check overflows
-		eq( i(i32((1 << 29) * 255)), 0xE0000000 );
-
-		eq( 0x050BCDEF.ofInt().shl(8).ushr(8).toInt(), 0x0BCDEF );
-
-		eq( 0x050BCDEF.ofInt().shl(8).div(256.ofInt()).toInt(), 0x0BCDEF );
-
-		eq( 7.ofInt().div(3.ofInt()).mul(3.ofInt()).toInt(), 6 );
-
-		eq( 0x050BCDEF.ofInt().mul(256.ofInt()).mod(0xFF.ofInt()).toInt(), 200 );
-
-		// bit shifts are % 32
-		
-		eq( i(i32(5).shl(0)), 5 );
-		eq( i(i32(5).shr(0)), 5 );
-		eq( i(i32(5).ushr(0)), 5 );
-
-		eq( i(i32(5).shl(32)), 5 );
-		eq( i(i32(5).shr(32)), 5 );
-		eq( i(i32(5).ushr(32)), 5 );
-
-		eq( i(i32(5).shl(33)), 10 );
-		eq( i(i32(5).shr(33)), 2 );
-		eq( i(i32(5).ushr(33)), 2 );
-		
-		eq( i(i32(5).shl(-5)), 671088640 );
-		eq( i(i32(5).shr(-31)), 2 );
-		eq( i(i32(5).ushr(-31)), 2 );
-		
-	}
-
-}

+ 0 - 1
tests/unit/compile.hxml

@@ -16,7 +16,6 @@
 #each
 #each
 --next
 --next
 -D macro-times
 -D macro-times
--D haxe3
 -debug
 -debug
 -cp ..
 -cp ..
 -resource res1.txt
 -resource res1.txt

+ 8 - 11
typeload.ml

@@ -40,13 +40,12 @@ let make_module ctx mpath file tdecls loadp =
 	let rec make_decl acc decl =
 	let rec make_decl acc decl =
 		let p = snd decl in
 		let p = snd decl in
 		let acc = (match fst decl with
 		let acc = (match fst decl with
-		| EImport _ | EUsing _ when Common.defined ctx.com Define.Haxe3 ->
+		| EImport _ | EUsing _ ->
 			(match !pt with
 			(match !pt with
 			| None -> acc
 			| None -> acc
 			| Some pt ->
 			| Some pt ->
 				display_error ctx "import and using may not appear after a type declaration" p;
 				display_error ctx "import and using may not appear after a type declaration" p;
 				error "Previous type declaration found here" pt)
 				error "Previous type declaration found here" pt)
-		| EImport _ | EUsing _ -> acc
 		| EClass d ->
 		| EClass d ->
 			pt := Some p;
 			pt := Some p;
 			let priv = List.mem HPrivate d.d_flags in
 			let priv = List.mem HPrivate d.d_flags in
@@ -457,8 +456,7 @@ and load_complex_type ctx p t =
 						| x when get && x = "get_" ^ n -> AccCall x
 						| x when get && x = "get_" ^ n -> AccCall x
 						| x when not get && x = "set_" ^ n -> AccCall x
 						| x when not get && x = "set_" ^ n -> AccCall x
 						| _ ->
 						| _ ->
-							(if Common.defined ctx.com Define.Haxe3 then error else ctx.com.warning) "Property custom access is no longer supported in Haxe3+" f.cff_pos;
-							AccCall m
+							error "Custom property access is no longer supported in Haxe 3" f.cff_pos;
 					in
 					in
 					let t = (match t with None -> error "Type required for structure property" p | Some t -> t) in
 					let t = (match t with None -> error "Type required for structure property" p | Some t -> t) in
 					load_complex_type ctx p t, Var { v_read = access i1 true; v_write = access i2 false }
 					load_complex_type ctx p t, Var { v_read = access i1 true; v_write = access i2 false }
@@ -926,7 +924,6 @@ let init_core_api ctx c =
 			Common.define com2 Define.CoreApi;
 			Common.define com2 Define.CoreApi;
 			Common.define com2 Define.Sys;
 			Common.define com2 Define.Sys;
 			if ctx.in_macro then Common.define com2 Define.Macro;
 			if ctx.in_macro then Common.define com2 Define.Macro;
-			if Common.defined ctx.com Define.Haxe3 then Common.define com2 Define.Haxe3;
 			com2.class_path <- ctx.com.std_path;
 			com2.class_path <- ctx.com.std_path;
 			let ctx2 = ctx.g.do_create com2 in
 			let ctx2 = ctx.g.do_create com2 in
 			ctx.g.core_api <- Some ctx2;
 			ctx.g.core_api <- Some ctx2;
@@ -1096,7 +1093,7 @@ let init_class ctx c p context_init herits fields =
 	let fields = !fields in
 	let fields = !fields in
 	let core_api = Meta.has Meta.CoreApi c.cl_meta in
 	let core_api = Meta.has Meta.CoreApi c.cl_meta in
 	let is_class_macro = Meta.has Meta.Macro c.cl_meta in
 	let is_class_macro = Meta.has Meta.Macro c.cl_meta in
-	if is_class_macro && Common.defined ctx.com Define.Haxe3 then display_error ctx "Macro-class is no longer allowed in haxe3" p;
+	if is_class_macro then display_error ctx "Macro classes are no longer allowed in haxe 3" p;
 	let fields, herits = if is_class_macro && not ctx.in_macro then begin
 	let fields, herits = if is_class_macro && not ctx.in_macro then begin
 		c.cl_extern <- true;
 		c.cl_extern <- true;
 		List.filter (fun f -> List.mem AStatic f.cff_access) fields, []
 		List.filter (fun f -> List.mem AStatic f.cff_access) fields, []
@@ -1209,7 +1206,7 @@ let init_class ctx c p context_init herits fields =
 							| Some e -> e
 							| Some e -> e
 							| None -> display_error ctx "Extern variable initialization must be a constant value" p; e
 							| None -> display_error ctx "Extern variable initialization must be a constant value" p; e
 						end
 						end
-					| Var v when not stat || (v.v_read = AccInline && Common.defined ctx.com Define.Haxe3) ->
+					| Var v when not stat || (v.v_read = AccInline) ->
 						let e = match Optimizer.make_constant_expression ctx e with Some e -> e | None -> display_error ctx "Variable initialization must be a constant value" p; e in
 						let e = match Optimizer.make_constant_expression ctx e with Some e -> e | None -> display_error ctx "Variable initialization must be a constant value" p; e in
 						e
 						e
 					| _ ->
 					| _ ->
@@ -1240,7 +1237,7 @@ let init_class ctx c p context_init herits fields =
 		let inline = List.mem AInline f.cff_access && allow_inline() in
 		let inline = List.mem AInline f.cff_access && allow_inline() in
 		let override = List.mem AOverride f.cff_access in
 		let override = List.mem AOverride f.cff_access in
 		let is_macro = Meta.has Meta.Macro f.cff_meta in
 		let is_macro = Meta.has Meta.Macro f.cff_meta in
-		if is_macro && Common.defined ctx.com Define.Haxe3 then ctx.com.warning "@:macro should now be 'macro' accessor'" p;
+		if is_macro then ctx.com.warning "@:macro should now be 'macro' accessor'" p;
 		let is_macro = is_macro || List.mem AMacro f.cff_access in
 		let is_macro = is_macro || List.mem AMacro f.cff_access in
 		List.iter (fun acc ->
 		List.iter (fun acc ->
 			match (acc, f.cff_kind) with
 			match (acc, f.cff_kind) with
@@ -1446,7 +1443,7 @@ let init_class ctx c p context_init herits fields =
 				| "default" -> AccNormal
 				| "default" -> AccNormal
 				| _ ->
 				| _ ->
 					let get = if get = "get" then "get_" ^ name else get in
 					let get = if get = "get" then "get_" ^ name else get in
-					delay ctx PForce (fun() -> check_method get (TFun ([],ret)) (if get <> "get" && get <> "get_" ^ name && Common.defined ctx.com Define.Haxe3 then Some ("get_" ^ name) else None));
+					delay ctx PForce (fun() -> check_method get (TFun ([],ret)) (if get <> "get" && get <> "get_" ^ name then Some ("get_" ^ name) else None));
 					AccCall get
 					AccCall get
 			) in
 			) in
 			let set = (match set with
 			let set = (match set with
@@ -1461,7 +1458,7 @@ let init_class ctx c p context_init herits fields =
 				| "default" -> AccNormal
 				| "default" -> AccNormal
 				| _ ->
 				| _ ->
 					let set = if set = "set" then "set_" ^ name else set in
 					let set = if set = "set" then "set_" ^ name else set in
-					delay ctx PForce (fun() -> check_method set (TFun (["",false,ret],ret)) (if set <> "set" && set <> "set_" ^ name && Common.defined ctx.com Define.Haxe3 then Some ("set_" ^ name) else None));
+					delay ctx PForce (fun() -> check_method set (TFun (["",false,ret],ret)) (if set <> "set" && set <> "set_" ^ name then Some ("set_" ^ name) else None));
 					AccCall set
 					AccCall set
 			) in
 			) in
 			if set = AccNormal && (match get with AccCall _ -> true | _ -> false) then error "Unsupported property combination" p;
 			if set = AccNormal && (match get with AccCall _ -> true | _ -> false) then error "Unsupported property combination" p;
@@ -1790,7 +1787,7 @@ let rec init_module_type ctx context_init do_init (decl,p) =
 				| HImplements { tpackage = []; tname = "Generic" } -> List.exists (fun t -> t_path t = (["haxe";"rtti"],"Generic")) ctx.m.module_types
 				| HImplements { tpackage = []; tname = "Generic" } -> List.exists (fun t -> t_path t = (["haxe";"rtti"],"Generic")) ctx.m.module_types
 				| _ -> false
 				| _ -> false
 			) herits in
 			) herits in
-			if rtti && Common.defined ctx.com Define.Haxe3 then error ("Implementing haxe.rtti.Generic is deprecated in haxe 3, please use @:generic instead") c.cl_pos;
+			if rtti then error ("Implementing haxe.rtti.Generic is deprecated in haxe 3, please use @:generic instead") c.cl_pos;
 			Meta.has Meta.Generic c.cl_meta || rtti
 			Meta.has Meta.Generic c.cl_meta || rtti
 		in
 		in
 		if implements_rtti() && c.cl_types <> [] then c.cl_kind <- KGeneric;
 		if implements_rtti() && c.cl_types <> [] then c.cl_kind <- KGeneric;

+ 1 - 4
typer.ml

@@ -2238,7 +2238,7 @@ and type_expr ctx (e,p) (with_type:with_type) =
 		(match tp with
 		(match tp with
 		| None ->
 		| None ->
 			let el = List.map (fun e -> type_expr ctx e Value) el in
 			let el = List.map (fun e -> type_expr ctx e Value) el in
-			let t = try unify_min_raise ctx el with Error (Unify l,p) -> if Common.defined ctx.com Define.Haxe3 then raise (Error (Unify l, p)) else t_dynamic in
+			let t = try unify_min_raise ctx el with Error (Unify l,p) -> raise (Error (Unify l, p))  in
 			mk (TArrayDecl el) (ctx.t.tarray t) p
 			mk (TArrayDecl el) (ctx.t.tarray t) p
 		| Some t ->
 		| Some t ->
 			let el = List.map (fun e ->
 			let el = List.map (fun e ->
@@ -2761,9 +2761,6 @@ and type_call ctx e el (with_type:with_type) p =
 			mk (TCall (mk (TLocal (alloc_var "`trace" t_dynamic)) t_dynamic p,[e;infos])) ctx.t.tvoid p
 			mk (TCall (mk (TLocal (alloc_var "`trace" t_dynamic)) t_dynamic p,[e;infos])) ctx.t.tvoid p
 		else
 		else
 			type_expr ctx (ECall ((EField ((EField ((EConst (Ident "haxe"),p),"Log"),p),"trace"),p),[e;EUntyped infos,p]),p) NoValue
 			type_expr ctx (ECall ((EField ((EField ((EConst (Ident "haxe"),p),"Log"),p),"trace"),p),[e;EUntyped infos,p]),p) NoValue
-	| (EConst (Ident "callback"),p) , e :: args when not (Common.defined ctx.com Define.Haxe3) ->
-		let e = type_expr ctx e Value in
-		type_bind ctx e args p
 	| (EConst(Ident "callback"),p1),args ->
 	| (EConst(Ident "callback"),p1),args ->
 		let ecb = try Some (type_ident_raise ctx "callback" p1 MCall) with Not_found -> None in
 		let ecb = try Some (type_ident_raise ctx "callback" p1 MCall) with Not_found -> None in
 		(match ecb with
 		(match ecb with