Kaynağa Gözat

Merge pull request #4989 from Gama11/patch-20

EnumTools: minor doc improvements
Simon Krajewski 9 yıl önce
ebeveyn
işleme
913883b90a
1 değiştirilmiş dosya ile 16 ekleme ve 16 silme
  1. 16 16
      std/haxe/EnumTools.hx

+ 16 - 16
std/haxe/EnumTools.hx

@@ -34,7 +34,7 @@ extern class EnumTools {
 
 
 		If `e` has no package, the enum name is returned.
 		If `e` has no package, the enum name is returned.
 
 
-		If `e` is null, the result is unspecified.
+		If `e` is `null`, the result is unspecified.
 
 
 		The enum name does not include any type parameters.
 		The enum name does not include any type parameters.
 	**/
 	**/
@@ -46,7 +46,7 @@ extern class EnumTools {
 		Creates an instance of enum `e` by calling its constructor `constr` with
 		Creates an instance of enum `e` by calling its constructor `constr` with
 		arguments `params`.
 		arguments `params`.
 
 
-		If `e` or `constr` is null, or if enum `e` has no constructor named
+		If `e` or `constr` is `null`, or if enum `e` has no constructor named
 		`constr`, or if the number of elements in `params` does not match the
 		`constr`, or if the number of elements in `params` does not match the
 		expected number of constructor arguments, or if any argument has an
 		expected number of constructor arguments, or if any argument has an
 		invalid type, the result is unspecified.
 		invalid type, the result is unspecified.
@@ -62,7 +62,7 @@ extern class EnumTools {
 		The constructor indices are preserved from haxe syntax, so the first
 		The constructor indices are preserved from haxe syntax, so the first
 		declared is index 0, the next index 1 etc.
 		declared is index 0, the next index 1 etc.
 
 
-		If `e` or `index` is null, or if enum `e` has no constructor
+		If `e` or `index` is `null`, or if enum `e` has no constructor
 		corresponding to index `index`, or if the number of elements in `params`
 		corresponding to index `index`, or if the number of elements in `params`
 		does not match the expected number of constructor arguments, or if any
 		does not match the expected number of constructor arguments, or if any
 		argument has an invalid type, the result is unspecified.
 		argument has an invalid type, the result is unspecified.
@@ -82,7 +82,7 @@ extern class EnumTools {
 		argument constructors is returned, in the order of the constructor
 		argument constructors is returned, in the order of the constructor
 		declaration.
 		declaration.
 
 
-		If `e` is null, the result is unspecified.
+		If `e` is `null`, the result is unspecified.
 	**/
 	**/
 	static public inline function createAll<T>(e:Enum<T>):Array<T> {
 	static public inline function createAll<T>(e:Enum<T>):Array<T> {
 		return Type.allEnums(e);
 		return Type.allEnums(e);
@@ -94,7 +94,7 @@ extern class EnumTools {
 		The order of the constructor names in the returned Array is preserved
 		The order of the constructor names in the returned Array is preserved
 		from the original syntax.
 		from the original syntax.
 
 
-		If `c` is null, the result is unspecified.
+		If `c` is `null`, the result is unspecified.
 	**/
 	**/
 	static public inline function getConstructors<T>(e:Enum<T>):Array<String> {
 	static public inline function getConstructors<T>(e:Enum<T>):Array<String> {
 		return Type.getEnumConstructs(e);
 		return Type.getEnumConstructs(e);
@@ -107,9 +107,9 @@ extern class EnumValueTools {
 		Recursively compares two enum instances `a` and `b` by value.
 		Recursively compares two enum instances `a` and `b` by value.
 
 
 		Unlike `a == b`, this function performs a deep equality check on the
 		Unlike `a == b`, this function performs a deep equality check on the
-		arguments of the constructors, if exists.
+		arguments of the constructors (if there are any).
 
 
-		If `a` or `b` are null, the result is unspecified.
+		If `a` or `b` are `null`, the result is unspecified.
 	**/
 	**/
 	static public inline function equals<T:EnumValue>(a:T, b:T):Bool {
 	static public inline function equals<T:EnumValue>(a:T, b:T):Bool {
 		return Type.enumEq(a, b);
 		return Type.enumEq(a, b);
@@ -120,7 +120,7 @@ extern class EnumValueTools {
 
 
 		The result String does not contain any constructor arguments.
 		The result String does not contain any constructor arguments.
 
 
-		If `e` is null, the result is unspecified.
+		If `e` is `null`, the result is unspecified.
 	**/
 	**/
 	static public inline function getName(e:EnumValue):String {
 	static public inline function getName(e:EnumValue):String {
 		return Type.enumConstructor(e);
 		return Type.enumConstructor(e);
@@ -129,12 +129,12 @@ extern class EnumValueTools {
 	/**
 	/**
 		Returns a list of the constructor arguments of enum instance `e`.
 		Returns a list of the constructor arguments of enum instance `e`.
 
 
-		If `e` has no arguments, the result is [].
+		If `e` has no arguments, the result is `[]`.
 
 
 		Otherwise the result are the values that were used as arguments to `e`,
 		Otherwise the result are the values that were used as arguments to `e`,
 		in the order of their declaration.
 		in the order of their declaration.
 
 
-		If `e` is null, the result is unspecified.
+		If `e` is `null`, the result is unspecified.
 	**/
 	**/
 	static public inline function getParameters(e:EnumValue):Array<Dynamic> {
 	static public inline function getParameters(e:EnumValue):Array<Dynamic> {
 		return Type.enumParameters(e);
 		return Type.enumParameters(e);
@@ -146,19 +146,19 @@ extern class EnumValueTools {
 		This corresponds to the original syntactic position of `e`. The index of
 		This corresponds to the original syntactic position of `e`. The index of
 		the first declared constructor is 0, the next one is 1 etc.
 		the first declared constructor is 0, the next one is 1 etc.
 
 
-		If `e` is null, the result is unspecified.
+		If `e` is `null`, the result is unspecified.
 	**/
 	**/
 	static public inline function getIndex(e:EnumValue):Int {
 	static public inline function getIndex(e:EnumValue):Int {
 		return Type.enumIndex(e);
 		return Type.enumIndex(e);
 	}
 	}
 
 
 	/**
 	/**
-		Matches enum instance `e` against pattern `pattern`, returning true if
-		matching succeeded and false otherwise.
+		Matches enum instance `e` against pattern `pattern`, returning `true` if
+		matching succeeded and `false` otherwise.
 
 
 		Example usage:
 		Example usage:
 
 
-		```
+		```haxe
 		if (e.match(pattern)) {
 		if (e.match(pattern)) {
 			// codeIfTrue
 			// codeIfTrue
 		} else {
 		} else {
@@ -168,7 +168,7 @@ extern class EnumValueTools {
 
 
 		This is equivalent to the following code:
 		This is equivalent to the following code:
 
 
-		```
+		```haxe
 		switch (e) {
 		switch (e) {
 			case pattern:
 			case pattern:
 				// codeIfTrue
 				// codeIfTrue
@@ -183,4 +183,4 @@ extern class EnumValueTools {
 	static public function match(e:EnumValue, pattern:Dynamic):Bool {
 	static public function match(e:EnumValue, pattern:Dynamic):Bool {
 		return false;
 		return false;
 	}
 	}
-}
+}