瀏覽代碼

pre 2.06 fixes

Nicolas Cannasse 15 年之前
父節點
當前提交
91606d6093
共有 10 個文件被更改,包括 30 次插入43 次删除
  1. 0 4
      std/cpp/_std/IntHash.hx
  2. 9 18
      std/cpp/_std/Xml.hx
  3. 3 1
      std/haxe/rtti/XmlParser.hx
  4. 0 5
      std/php/_std/List.hx
  5. 3 7
      std/php/_std/Reflect.hx
  6. 1 1
      std/php/_std/Std.hx
  7. 5 5
      std/php/_std/StringBuf.hx
  8. 2 1
      std/php/_std/Type.hx
  9. 1 1
      type.ml
  10. 6 0
      typeload.ml

+ 0 - 4
std/cpp/_std/IntHash.hx

@@ -23,10 +23,6 @@
  * DAMAGE.
  */
 
-/**
-	Hashtable over a set of elements, using [Int] as keys.
-	On Flash and Javascript, the underlying structure is an Object.
-**/
 @:core_api class IntHash<T> {
 
 	private var h : Dynamic;

+ 9 - 18
std/cpp/_std/Xml.hx

@@ -24,16 +24,8 @@
  */
 
 enum XmlType {
-   element;
-   pcdata;
-   cdata;
-   comment;
-   doctype;
-   prolog;
-   document;
 }
 
-
 @:core_api class Xml {
 	public static var Element(default,null) : XmlType;
 	public static var PCData(default,null) : XmlType;
@@ -411,16 +403,15 @@ enum XmlType {
 		}
 	}
 
-	// Must call this after XML elements have been constructed
-	static function __do_init() : Void {
-		Element = XmlType.element;
-		PCData = XmlType.pcdata;
-		CData = XmlType.cdata;
-		Comment = XmlType.comment;
-		DocType = XmlType.doctype;
-		Prolog = XmlType.prolog;
-		Document = XmlType.document;
+	static function __init__() : Void untyped {
+		Element = "element";
+		PCData = "pcdata";
+		CData = "cdata";
+		Comment = "comment";
+		DocType = "doctype";
+		Prolog = "prolog";
+		Document = "document";
 	}
-	static var __init_later = __do_init();
+
 }
 

+ 3 - 1
std/haxe/rtti/XmlParser.hx

@@ -88,10 +88,12 @@ class XmlParser {
 
 	function mergeClasses( c : Classdef, c2 : Classdef ) {
 		// todo : compare supers & interfaces
-		if( c.isInterface != c2.isInterface || c.isExtern != c2.isExtern )
+		if( c.isInterface != c2.isInterface )
 			return false;
 		if( curplatform != null )
 			c.platforms.add(curplatform);
+		if( c.isExtern != c2.isExtern )
+			c.isExtern = false;
 
 		for( f2 in c2.fields ) {
 			var found = null;

+ 0 - 5
std/php/_std/List.hx

@@ -23,11 +23,6 @@
  * DAMAGE.
  */
 
-/**
-	A linked-list of elements. The list is composed of two-elements arrays
-	that are chained together. It's optimized so that adding or removing an
-	element doesn't imply to copy the whole array content everytime.
-**/
 @:core_api class List<T> implements php.IteratorAggregate<T> {
 
 	private var h : ArrayAccess<Dynamic>;

+ 3 - 7
std/php/_std/Reflect.hx

@@ -23,11 +23,7 @@
  * DAMAGE.
  */
 
-/**
-	The Reflect API is a way to manipulate values dynamicly through an
-	abstract interface in an untyped manner. Use with care.
-**/
-@:core_type class Reflect {
+@:core_api class Reflect {
 
 	public inline static function hasField( o : Dynamic, field : String ) : Bool {
 		return untyped __call__("_hx_has_field", o, field);
@@ -101,6 +97,6 @@
 	public static function makeVarArgs( f : Array<Dynamic> -> Dynamic ) : Dynamic {
 		untyped __php__("return array(new _hx_lambda(array(&$f), '_hx_make_var_args'), 'execute')");
 	}
-	
-	
+
+
 }

+ 1 - 1
std/php/_std/Std.hx

@@ -23,7 +23,7 @@
  * DAMAGE.
  */
 
-@:core_type class Std {
+@:core_api class Std {
 
 	public static function is( v : Dynamic, t : Dynamic ) : Bool {
 		return untyped untyped __call__("_hx_instanceof", v,t);

+ 5 - 5
std/php/_std/StringBuf.hx

@@ -23,22 +23,22 @@
  * DAMAGE.
  */
 
-@:core_type class StringBuf {
+@:core_api class StringBuf {
 	private var b : String;
 
-	public function new() {
+	public function new() : Void {
 		b = "";
 	}
 
-	public inline function add( ?x : Dynamic ) {
+	public inline function add( ?x : Dynamic ) : Void {
 		b += x;
 	}
 
-	public inline function addSub( s : String, pos : Int, ?len : Int ) {
+	public inline function addSub( s : String, pos : Int, ?len : Int ) : Void {
 		b += s.substr(pos,len);
 	}
 
-	public inline function addChar( c : Int ) {
+	public inline function addChar( c : Int ) : Void {
 		b += String.fromCharCode(c);
 	}
 

+ 2 - 1
std/php/_std/Type.hx

@@ -10,7 +10,8 @@ enum ValueType {
 	TUnknown;
 }
 
-@:core_type class Type {
+@:core_api class Type {
+
 	public static function getClass<T>( o : T ) : Class<T> untyped {
 		if(o == null) return null;
 		untyped if(__call__("is_array",  o)) {

+ 1 - 1
type.ml

@@ -108,7 +108,7 @@ and tclass_field = {
 	cf_name : string;
 	mutable cf_type : t;
 	cf_public : bool;
-	cf_doc : Ast.documentation;
+	mutable cf_doc : Ast.documentation;
 	cf_meta : metadata;
 	cf_get : field_access;
 	cf_set : field_access;

+ 6 - 0
typeload.ml

@@ -581,6 +581,9 @@ let init_core_api ctx c =
 	let t = load_instance ctx2 { tpackage = fst c.cl_path; tname = snd c.cl_path; tparams = []; tsub = None; } c.cl_pos true in
 	match t with
 	| TInst (ccore,_) ->
+		(match c.cl_doc with
+		| None -> c.cl_doc <- ccore.cl_doc
+		| Some _ -> ());
 		let check_fields fcore fl =
 			PMap.iter (fun i f ->
 				if not f.cf_public then () else
@@ -592,6 +595,9 @@ let init_core_api ctx c =
 					display_error ctx ("Field " ^ i ^ " has different type than in core type") p;
 					display_error ctx (error_msg (Unify l)) p);
 				if f2.cf_public <> f.cf_public then error ("Field " ^ i ^ " has different visibility than core type") p;
+				(match f2.cf_doc with
+				| None -> f2.cf_doc <- f.cf_doc
+				| Some _ -> ());
 				if f2.cf_get <> f.cf_get || f2.cf_set <> f.cf_set then begin
 					match f2.cf_get, f.cf_get, f2.cf_set, f.cf_set with
 					| InlineAccess, NormalAccess, NeverAccess, MethodAccess false -> () (* allow to add 'inline' *)