Simon Krajewski 12 years ago
parent
commit
a229212773
8 changed files with 67 additions and 48 deletions
  1. 9 7
      std/Date.hx
  2. 1 1
      std/Enum.hx
  3. 1 1
      std/IntIterator.hx
  4. 9 7
      std/Reflect.hx
  5. 14 3
      std/StdTypes.hx
  6. 14 10
      std/StringTools.hx
  7. 2 2
      std/Type.hx
  8. 17 17
      std/haxe/ds/BalancedTree.hx

+ 9 - 7
std/Date.hx

@@ -24,10 +24,10 @@
 	The Date class provides a basic structure for date and time related
 	The Date class provides a basic structure for date and time related
 	information. Date instances can be created by
 	information. Date instances can be created by
 	
 	
-	- new Date() for a specific date,
-	- Date.now() to obtain information about the current time,
-	- Date.fromTime() with a given timestamp or
-	- Date.fromString() by parsing from a String.
+	- `new Date()` for a specific date,
+	- `Date.now()` to obtain information about the current time,
+	- `Date.fromTime()` with a given timestamp or
+	- `Date.fromString()` by parsing from a String.
 	
 	
 	There is some extra functions available in the `DateTools` class.
 	There is some extra functions available in the `DateTools` class.
 	
 	
@@ -111,9 +111,11 @@ extern class Date
 	/**
 	/**
 		Returns a Date from a formated string `s`, with the following accepted
 		Returns a Date from a formated string `s`, with the following accepted
 		formats:
 		formats:
-			- [YYYY-MM-DD hh:mm:ss]
-			- [YYYY-MM-DD]
-			- [hh:mm:ss]
+		
+		- [YYYY-MM-DD hh:mm:ss]
+		- [YYYY-MM-DD]
+		- [hh:mm:ss]
+		
 		The first two formats are expressed in local time, the third in UTC
 		The first two formats are expressed in local time, the third in UTC
 		Epoch.
 		Epoch.
 	**/
 	**/

+ 1 - 1
std/Enum.hx

@@ -23,7 +23,7 @@
 /**
 /**
 	An abstract type that represents an Enum type.
 	An abstract type that represents an Enum type.
 	
 	
-	The corresponding enum instance type is EnumValue.
+	The corresponding enum instance type is `EnumValue`.
 	
 	
 	See `Type` for the Haxe Reflection API.
 	See `Type` for the Haxe Reflection API.
 **/
 **/

+ 1 - 1
std/IntIterator.hx

@@ -24,7 +24,7 @@
 	IntIterator is used for implementing interval iterations.
 	IntIterator is used for implementing interval iterations.
 	
 	
 	It is usually not used explicitly, but through it's special syntax:
 	It is usually not used explicitly, but through it's special syntax:
-		min...max
+	`min...max`
 		
 		
 	While it is possible to assign an instance of IntIterator to a variable or
 	While it is possible to assign an instance of IntIterator to a variable or
 	field, it is worth noting that IntIterator does not reset after being used
 	field, it is worth noting that IntIterator does not reset after being used

+ 9 - 7
std/Reflect.hx

@@ -121,9 +121,10 @@ extern class Reflect {
 		
 		
 		For all other types, the result is 0 if `a` and `b` are equal. If they
 		For all other types, the result is 0 if `a` and `b` are equal. If they
 		are not equal, the result depends on the type and is negative if:
 		are not equal, the result depends on the type and is negative if:
-			Numeric types: a is less than b
-			String: a is lexicographically less than b
-			Other: unspecified
+		
+		- Numeric types: a is less than b
+		- String: a is lexicographically less than b
+		- Other: unspecified
 		
 		
 		If `a` and `b` are null, the result is 0. If only one of them is null,
 		If `a` and `b` are null, the result is 0. If only one of them is null,
 		the result is unspecified.
 		the result is unspecified.
@@ -144,10 +145,11 @@ extern class Reflect {
 		Tells if `v` is an object.
 		Tells if `v` is an object.
 		
 		
 		The result is true if `v` is one of the following:
 		The result is true if `v` is one of the following:
-			- class instance
-			- structure
-			- Class<T>
-			- Enum<T>
+			
+		- class instance
+		- structure
+		- Class<T>
+		- Enum<T>
 			
 			
 		Otherwise, including if `v` is null, the result is false.
 		Otherwise, including if `v` is null, the result is false.
 	**/
 	**/

+ 14 - 3
std/StdTypes.hx

@@ -28,11 +28,17 @@
 
 
 /**
 /**
 	The standard Float type, this is a double-precision IEEE 64bit float.
 	The standard Float type, this is a double-precision IEEE 64bit float.
+	
+	On static targets, null cannot be assigned to Float. If this is necessary,
+	`Null<Float>` can be used instead.	
 **/
 **/
 @:coreType @:notNull @:runtimeValue abstract Float { }
 @:coreType @:notNull @:runtimeValue abstract Float { }
 
 
 /**
 /**
 	The standard Int type. Its precision depends on the platform.
 	The standard Int type. Its precision depends on the platform.
+	
+	On static targets, null cannot be assigned to Int. If this is necessary,
+	`Null<Int>` can be used instead.
 **/
 **/
 @:coreType @:notNull @:runtimeValue abstract Int to Float { }
 @:coreType @:notNull @:runtimeValue abstract Int to Float { }
 
 
@@ -57,14 +63,19 @@
 typedef Null<T> = T
 typedef Null<T> = T
 
 
 /**
 /**
-	The standard Boolean type is represented as an enum with two choices.
+	The standard Boolean type, which can either be true or false.
+	
+	On static targets, null cannot be assigned to Bool. If this is necessary,
+	`Null<Bool>` can be used instead.
 **/
 **/
 @:coreType @:notNull @:runtimeValue abstract Bool {
 @:coreType @:notNull @:runtimeValue abstract Bool {
 }
 }
 
 
 /**
 /**
-	Dynamic is an internal compiler type which has special behavior.
-	See the Haxe language reference for more informations.
+	Dynamic is a special type which is compatible with all other types.
+	
+	Use of Dynamic should be minimized as it prevents several compiler
+	checks and optimizations.
 **/
 **/
 @:coreType @:runtimeValue abstract Dynamic<T> {
 @:coreType @:runtimeValue abstract Dynamic<T> {
 }
 }

+ 14 - 10
std/StringTools.hx

@@ -85,12 +85,15 @@ class StringTools {
 		Escapes HTML special characters of the string `s`.
 		Escapes HTML special characters of the string `s`.
 
 
 		The following replacements are made:
 		The following replacements are made:
-			- & becomes &amp;
-			- < becomes &lt;
-			- > becomes &gt;
+			
+		- & becomes &amp;
+		- < becomes &lt;
+		- > becomes &gt;
+		
 		If `quotes` is true, the following characters are also replaced:
 		If `quotes` is true, the following characters are also replaced:
-			- " becomes &quot;
-			- ' becomes &#039;
+		
+		- " becomes &quot;
+		- ' becomes &#039;
 	**/
 	**/
 	public static function htmlEscape( s : String, ?quotes : Bool ) : String {
 	public static function htmlEscape( s : String, ?quotes : Bool ) : String {
 		s = s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
 		s = s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
@@ -104,11 +107,12 @@ class StringTools {
 		holds: htmlUnescape(htmlEscape(s)) == s
 		holds: htmlUnescape(htmlEscape(s)) == s
 
 
 		The replacements follow:
 		The replacements follow:
-			- &amp; becomes &
-			- &lt; becomes <
-			- &gt; becomes >
-			- &quot; becomes "
-			- &#039; becomes '
+			
+		- &amp; becomes &
+		- &lt; becomes <
+		- &gt; becomes >
+		- &quot; becomes "
+		- &#039; becomes '
 	**/
 	**/
 	public static function htmlUnescape( s : String ) : String {
 	public static function htmlUnescape( s : String ) : String {
 		return s.split("&gt;").join(">").split("&lt;").join("<").split("&quot;").join('"').split("&#039;").join("'").split("&amp;").join("&");
 		return s.split("&gt;").join(">").split("&lt;").join("<").split("&quot;").join('"').split("&#039;").join("'").split("&amp;").join("&");

+ 2 - 2
std/Type.hx

@@ -81,7 +81,7 @@ extern class Type {
 		
 		
 		If `c` is inside a package, the package structure is returned dot-
 		If `c` is inside a package, the package structure is returned dot-
 		separated, with another dot separating the class name:
 		separated, with another dot separating the class name:
-			pack1.pack2.(...).packN.ClassName
+		`pack1.pack2.(...).packN.ClassName`
 		If `c` is a sub-type of a haxe module, that module is not part of the
 		If `c` is a sub-type of a haxe module, that module is not part of the
 		package structure.
 		package structure.
 			
 			
@@ -98,7 +98,7 @@ extern class Type {
 		
 		
 		If `e` is inside a package, the package structure is returned dot-
 		If `e` is inside a package, the package structure is returned dot-
 		separated, with another dot separating the enum name:
 		separated, with another dot separating the enum name:
-			pack1.pack2.(...).packN.EnumName
+		`pack1.pack2.(...).packN.EnumName`
 		If `e` is a sub-type of a haxe module, that module is not part of the
 		If `e` is a sub-type of a haxe module, that module is not part of the
 		package structure.
 		package structure.
 			
 			

+ 17 - 17
std/haxe/ds/BalancedTree.hx

@@ -24,12 +24,12 @@ package haxe.ds;
 
 
 /**
 /**
 	BalancedTree allows key-value mapping with arbitrary keys, as long as they
 	BalancedTree allows key-value mapping with arbitrary keys, as long as they
-	can be ordered. By default, [Reflect.compare] is used in the [compare]
+	can be ordered. By default, `Reflect.compare` is used in the `compare`
 	method, which can be overridden in subclasses.
 	method, which can be overridden in subclasses.
 	
 	
 	Operations have a logarithmic average and worst-case cost.
 	Operations have a logarithmic average and worst-case cost.
 	
 	
-	Iteration over keys and values, using [keys] and [iterator] respectively,
+	Iteration over keys and values, using `keys` and `iterator` respectively,
 	are in-order.
 	are in-order.
 **/
 **/
 class BalancedTree<K,V> {
 class BalancedTree<K,V> {
@@ -41,22 +41,22 @@ class BalancedTree<K,V> {
 	public function new() { }
 	public function new() { }
 	
 	
 	/**
 	/**
-		Binds [key] to [value].
+		Binds `key` to `value`.
 		
 		
-		If [key] is already bound to a value, that binding disappears.
+		If `key` is already bound to a value, that binding disappears.
 		
 		
-		If [key] is null, the result is unspecified.
+		If `key` is null, the result is unspecified.
 	**/
 	**/
 	public function set(key:K, value:V) {
 	public function set(key:K, value:V) {
 		root = setLoop(key, value, root);
 		root = setLoop(key, value, root);
 	}
 	}
 	
 	
 	/**
 	/**
-		Returns the value [key] is bound to.
+		Returns the value `key` is bound to.
 		
 		
-		If [key] is not bound to any value, [null] is returned.
+		If `key` is not bound to any value, `null` is returned.
 		
 		
-		If [key] is null, the result is unspecified.
+		If `key` is null, the result is unspecified.
 	**/
 	**/
 	public function get(key:K):Null<V> {
 	public function get(key:K):Null<V> {
 		var node = root;
 		var node = root;
@@ -70,14 +70,14 @@ class BalancedTree<K,V> {
 	}
 	}
 	
 	
 	/**
 	/**
-		Removes the current binding of [key].
+		Removes the current binding of `key`.
 		
 		
-		If [key] has no binding, [this] BalancedTree is unchanged and false is
+		If `key` has no binding, `this` BalancedTree is unchanged and false is
 		returned.
 		returned.
 		
 		
-		Otherwise the binding of [key] is removed and true is returned.
+		Otherwise the binding of `key` is removed and true is returned.
 		
 		
-		If [key] is null, the result is unspecified.
+		If `key` is null, the result is unspecified.
 	**/
 	**/
 	public function remove(key:K) {
 	public function remove(key:K) {
 		try {
 		try {
@@ -90,11 +90,11 @@ class BalancedTree<K,V> {
 	}
 	}
 	
 	
 	/**
 	/**
-		Tells if [key] is bound to a value.
+		Tells if `key` is bound to a value.
 		
 		
-		This method returns true even if [key] is bound to null.
+		This method returns true even if `key` is bound to null.
 		
 		
-		If [key] is null, the result is unspecified.
+		If `key` is null, the result is unspecified.
 	**/
 	**/
 	public function exists(key:K) {
 	public function exists(key:K) {
 		var node = root;
 		var node = root;
@@ -108,7 +108,7 @@ class BalancedTree<K,V> {
 	}
 	}
 	
 	
 	/**
 	/**
-		Iterates over the bound values of [this] BalancedTree.
+		Iterates over the bound values of `this` BalancedTree.
 		
 		
 		This operation is performed in-order.
 		This operation is performed in-order.
 	**/
 	**/
@@ -119,7 +119,7 @@ class BalancedTree<K,V> {
 	}
 	}
 	
 	
 	/**
 	/**
-		Iterates over the keys of [this] BalancedTree.
+		Iterates over the keys of `this` BalancedTree.
 		
 		
 		This operation is performed in-order.
 		This operation is performed in-order.
 	**/
 	**/