Explorar o código

Move List to haxe.ds.List (#6610)

* Move List to haxe.ds.List

* Fix serializer
Kevin Leung %!s(int64=8) %!d(string=hai) anos
pai
achega
f0ef8c493a

+ 3 - 0
std/Lambda.hx

@@ -1,3 +1,4 @@
+import haxe.ds.List;
 /*
  * Copyright (C)2005-2017 Haxe Foundation
  *
@@ -34,7 +35,9 @@
 
 	@see https://haxe.org/manual/std-Lambda.html
 **/
+
 class Lambda {
+	
 
 	/**
 		Creates an Array from Iterable `it`.

+ 2 - 0
std/haxe/Http.hx

@@ -21,6 +21,8 @@
  */
 package haxe;
 
+import haxe.ds.List;
+
 #if sys
 
 import sys.net.Host;

+ 2 - 1
std/haxe/Serializer.hx

@@ -21,6 +21,7 @@
  */
 package haxe;
 
+import haxe.ds.List;
 /**
 	The Serializer class can be used to encode values and objects into a `String`,
 	from which the `Unserializer` class can recreate the original representation.
@@ -288,7 +289,7 @@ class Serializer {
 					}
 				}
 				buf.add("h");
-			case #if (neko || cs || python) "List" #else cast List #end:
+			case #if (neko || cs || python) "haxe.ds.List" #else cast List #end:
 				buf.add("l");
 				var v : List<Dynamic> = v;
 				for( i in v )

+ 2 - 0
std/haxe/Unserializer.hx

@@ -21,6 +21,8 @@
  */
 package haxe;
 
+import haxe.ds.List;
+
 @:noDoc
 typedef TypeResolver = {
 	function resolveClass( name : String ) : Class<Dynamic>;

+ 1 - 0
std/List.hx → std/haxe/ds/List.hx

@@ -19,6 +19,7 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
+package haxe.ds;
 
 /**
 	A linked-list of elements. The list is composed of element container objects

+ 2 - 0
std/haxe/rtti/CType.hx

@@ -21,6 +21,8 @@
  */
 package haxe.rtti;
 
+import haxe.ds.List;
+
 /**
 	The (dot-)path of the runtime type.
 **/

+ 2 - 0
std/haxe/zip/Entry.hx

@@ -21,6 +21,8 @@
  */
 package haxe.zip;
 
+import haxe.ds.List;
+
 enum ExtraField {
 	FUnknown( tag : Int, bytes : haxe.io.Bytes );
 	FInfoZipUnicodePath( name : String, crc : Int );

+ 1 - 0
std/haxe/zip/Reader.hx

@@ -21,6 +21,7 @@
  */
 package haxe.zip;
 import haxe.zip.Entry;
+import haxe.ds.List;
 
 // see http://www.pkware.com/documents/casestudies/APPNOTE.TXT
 

+ 2 - 0
std/haxe/zip/Writer.hx

@@ -21,6 +21,8 @@
  */
 package haxe.zip;
 
+import haxe.ds.List;
+
 class Writer {
 
 	/*

+ 2 - 0
std/neko/Web.hx

@@ -21,6 +21,8 @@
  */
 package neko;
 
+import haxe.ds.List;
+
 /**
 	This class is used for accessing the local Web server and the current
 	client request and information.

+ 3 - 1
tests/optimization/src/TestJs.hx

@@ -1,3 +1,5 @@
+import haxe.ds.List;
+
 private enum Tree<T> {
 	Node(l:Tree<T>, r:Tree<T>);
 	Leaf(v:T);
@@ -38,7 +40,7 @@ class TestJs {
 	//Std.string(x);
 	//}
 
-	@:js("var a = new List();var _g_head = a.h;while(_g_head != null) _g_head = _g_head.next;")
+	@:js("var a = new haxe_ds_List();var _g_head = a.h;while(_g_head != null) _g_head = _g_head.next;")
 	static function testListIteratorInline() {
 		var a = new List();
 		for (v in a) { }

+ 1 - 1
tests/unit/compile-each.hxml

@@ -1,7 +1,7 @@
 -D source-header=''
 -debug
 -cp src
--cp "C:\Program Files\The Haxe Effect\src/dev/null"
+# -cp "C:\Program Files\The Haxe Effect\src/dev/null"
 -resource res1.txt@re/s?!%[]))("'1.txt
 -resource res2.bin@re/s?!%[]))("'1.bin
 -dce full

+ 1 - 0
tests/unit/src/unit/MyClass.hx

@@ -1,5 +1,6 @@
 package unit;
 
+import haxe.ds.List;
 using MyClass.UsingBase;
 using MyClass.UsingChild1;
 using MyClass.UsingChild2;

+ 1 - 0
tests/unit/src/unit/TestMain.hx

@@ -1,6 +1,7 @@
 package unit;
 
 import unit.Test.*;
+import haxe.ds.List;
 
 @:access(unit.Test)
 @:expose("unit.TestMain")

+ 3 - 1
tests/unit/src/unit/TestReflect.hx

@@ -1,4 +1,6 @@
 package unit;
+
+import haxe.ds.List;
 import Type;
 
 interface InterfWithProp {
@@ -85,7 +87,7 @@ class TestReflect extends Test {
 
 	static var TNAMES = [
 		"null","Int","String","Bool","Float",
-		"Array",u("haxe.ds.StringMap"),u("List"),"Date","Xml","Math",
+		"Array",u("haxe.ds.StringMap"),u("haxe.ds.List"),"Date","Xml","Math",
 		u2("unit","MyEnum"),u2("unit","MyClass"),u2("unit","MySubClass"),
 		#if !flash u #end("Class"), u("Enum"), u("Dynamic"),
 		u2("unit","MyInterface")

+ 2 - 0
tests/unit/src/unit/TestSerialize.hx

@@ -1,5 +1,7 @@
 package unit;
 
+import haxe.ds.List;
+
 class TestSerialize extends Test {
 
 	function id<T>( v : T ) : T {

+ 1 - 0
tests/unit/src/unit/TestSpecification.hx

@@ -1,5 +1,6 @@
 package unit;
 
+import haxe.ds.List;
 import haxe.macro.Expr;
 
 typedef T = {

+ 2 - 0
tests/unit/src/unit/TestType.hx

@@ -1,4 +1,6 @@
 package unit;
+
+import haxe.ds.List;
 import unit.MyEnum;
 import unit.MyClass;
 import unit.HelperMacros.*;

+ 2 - 0
tests/unit/src/unit/issues/Issue3110.hx

@@ -1,5 +1,7 @@
 package unit.issues;
 
+import haxe.ds.List;
+
 private abstract MyOpaciteInt(Int) {}
 
 class Issue3110 extends Test {

+ 2 - 0
tests/unit/src/unit/issues/Issue3486.hx

@@ -1,5 +1,7 @@
 package unit.issues;
 
+import haxe.ds.List;
+
 class Issue3486 extends Test {
 	function test() {
 		var l = new List();

+ 2 - 0
tests/unit/src/unit/issues/Issue6177.hx

@@ -1,5 +1,7 @@
 package unit.issues;
 
+import haxe.ds.List;
+
 class Issue6177 extends unit.Test {
     function test() {
         var list = new List();

+ 2 - 2
tests/unit/src/unitstd/Lambda.unit.hx

@@ -16,11 +16,11 @@ e2.length == 0;
 var a = [1];
 var l = Lambda.list(a);
 name(a) == "Array";
-name(l) == "List";
+name(l) == "haxe.ds.List";
 l.length == 1;
 l.first() == 1;
 var l2 = Lambda.list(l);
-name(l2) == "List";
+name(l2) == "haxe.ds.List";
 l != l2;
 var e = new List();
 var e2 = Lambda.list(e);