瀏覽代碼

Fix some spelling errors in docs (#5991)

Gama11 8 年之前
父節點
當前提交
6574ed212b

+ 4 - 4
std/Array.hx

@@ -210,12 +210,12 @@ extern class Array<T> {
 	function insert( pos : Int, x : T ) : Void;
 
 	/**
-		Removes the first occurence of `x` in `this` Array.
+		Removes the first occurrence of `x` in `this` Array.
 
 		This operation modifies `this` Array in place.
 
 		If `x` is found by checking standard equality, it is removed from `this`
-		Array and all following elements are reindexed acoordingly. The function
+		Array and all following elements are reindexed accordingly. The function
 		then returns true.
 
 		If `x` is not found, `this` Array is not changed and the function
@@ -224,7 +224,7 @@ extern class Array<T> {
 	function remove( x : T ) : Bool;
 
 	/**
-		Returns position of the first occurense of `x` in `this` Array, searching front to back.
+		Returns position of the first occurrence of `x` in `this` Array, searching front to back.
 
 		If `x` is found by checking standard equality, the function returns its index.
 
@@ -239,7 +239,7 @@ extern class Array<T> {
 	function indexOf( x : T, ?fromIndex:Int ) : Int;
 
 	/**
-		Returns position of the last occurense of `x` in `this` Array, searching back to front.
+		Returns position of the last occurrence of `x` in `this` Array, searching back to front.
 
 		If `x` is found by checking standard equality, the function returns its index.
 

+ 1 - 1
std/List.hx

@@ -127,7 +127,7 @@ class List<T> {
 	}
 
 	/**
-		Removes the first occurence of `v` in `this` List.
+		Removes the first occurrence of `v` in `this` List.
 
 		If `v` is found by checking standard equality, it is removed from `this`
 		List and the function returns true.

+ 4 - 4
std/String.hx

@@ -78,7 +78,7 @@ extern class String {
 	function charCodeAt( index : Int) : Null<Int>;
 
 	/**
-		Returns the position of the leftmost occurence of `str` within `this`
+		Returns the position of the leftmost occurrence of `str` within `this`
 		String.
 
 		If `startIndex` is given, the search is performed within the substring
@@ -91,7 +91,7 @@ extern class String {
 	function indexOf( str : String, ?startIndex : Int ) : Int;
 
 	/**
-		Returns the position of the rightmost occurence of `str` within `this`
+		Returns the position of the rightmost occurrence of `str` within `this`
 		String.
 
 		If `startIndex` is given, the search is performed within the substring
@@ -104,7 +104,7 @@ extern class String {
 	function lastIndexOf( str : String, ?startIndex : Int ) : Int;
 
 	/**
-		Splits `this` String at each occurence of `delimiter`.
+		Splits `this` String at each occurrence of `delimiter`.
 
 		If `this` String is the empty String `""`, the result is not consistent
 		across targets and may either be `[]` (on Js, Cpp) or `[""]`.
@@ -118,7 +118,7 @@ extern class String {
 
 		If `delimiter` is null, the result is unspecified.
 
-		Otherwise, `this` String is split into parts at each occurence of
+		Otherwise, `this` String is split into parts at each occurrence of
 		`delimiter`. If `this` String starts (or ends) with `delimiter`, the
 		result `Array` contains a leading (or trailing) empty String `""` element.
 		Two subsequent delimiters also result in an empty String `""` element.

+ 1 - 1
std/StringTools.hx

@@ -361,7 +361,7 @@ class StringTools {
 	}
 
 	/**
-		Replace all occurences of the String `sub` in the String `s` by the
+		Replace all occurrences of the String `sub` in the String `s` by the
 		String `by`.
 
 		If `sub` is the empty String `""`, `by` is inserted after each character

+ 2 - 2
std/Sys.hx

@@ -36,7 +36,7 @@ extern class Sys {
 	static function println( v : Dynamic ) : Void;
 
 	/**
-		Returns all the arguments that were passed by the commandline.
+		Returns all the arguments that were passed by the command line.
 	**/
 	static function args() : Array<String>;
 
@@ -51,7 +51,7 @@ extern class Sys {
 	static function putEnv( s : String, v : String ) : Void;
 
 	/**
-		Returns the whole environement variables.
+		Returns the whole environment variables.
 	**/
 	static function environment() : Map<String,String>;
 

+ 1 - 1
std/Xml.hx

@@ -57,7 +57,7 @@
 }
 
 /**
-	Crossplatform Xml API.
+	Cross-platform Xml API.
 
 	@see https://haxe.org/manual/std-Xml.html
 **/

+ 1 - 1
std/cpp/vm/Debugger.hx

@@ -136,7 +136,7 @@ class Debugger
      *        thread events.  Note that this function is called directly from
      *        the thread experiencing the event and the handler should return
      *        quickly to avoid blocking the calling thread unnecessarily.
-     *        The paramaters to handler are:
+     *        The parameters to handler are:
      *          - threadNumber, the thread number of the event
      *          - event, one of THREAD_CREATED, THREAD_TERMINATED,
      *            THREAD_STARTED, or THREAD_STOPPED

+ 6 - 6
std/cs/_std/sys/net/Socket.hx

@@ -54,7 +54,7 @@ class Socket {
 	public var output(default,null) : haxe.io.Output;
 
 	/**
-		A custom value that can be associated with the socket. Can be used to retreive your custom infos after a `select`.
+		A custom value that can be associated with the socket. Can be used to retrieve your custom infos after a `select`.
 	***/
 	public var custom : Dynamic;
 
@@ -90,7 +90,7 @@ class Socket {
 	}
 
 	/**
-		Connect to the given server host/port. Throw an exception in case we couldn't sucessfully connect.
+		Connect to the given server host/port. Throw an exception in case we couldn't successfully connect.
 	**/
 	public function connect( host : Host, port : Int ) : Void {
 		sock.Connect( host.ipAddress, port );
@@ -146,7 +146,7 @@ class Socket {
 	}
 
 	/**
-		Return the informations about the other side of a connected socket.
+		Return the information about the other side of a connected socket.
 	**/
 	public function peer() : { host : Host, port : Int } {
 		var remoteIP = cast(sock.RemoteEndPoint, IPEndPoint);
@@ -154,7 +154,7 @@ class Socket {
 	}
 
 	/**
-		Return the informations about our side of a connected socket.
+		Return the information about our side of a connected socket.
 	**/
 	public function host() : { host : Host, port : Int } {
 		var localIP = cast(sock.LocalEndPoint, IPEndPoint);
@@ -179,14 +179,14 @@ class Socket {
 	}
 
 	/**
-		Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediatly by throwing a haxe.io.Error.Blocking value.
+		Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediately by throwing a haxe.io.Error.Blocking value.
 	**/
 	public function setBlocking( b : Bool ) : Void {
 		sock.Blocking = b;
 	}
 
 	/**
-		Allows the socket to immediatly send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.
+		Allows the socket to immediately send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.
 	**/
 	public function setFastSend( b : Bool ) : Void {
 		sock.NoDelay = b;

+ 1 - 1
std/haxe/CallStack.hx

@@ -33,7 +33,7 @@ enum StackItem {
 }
 
 /**
-	Get informations about the call stack.
+	Get information about the call stack.
 **/
 class CallStack {
 	#if js

+ 1 - 1
std/haxe/Json.hx

@@ -22,7 +22,7 @@
 package haxe;
 
 /**
-	Crossplatform JSON API: it will automatically use the optimized native API if available.
+	Cross-platform JSON API: it will automatically use the optimized native API if available.
 	Use `-D haxeJSON` to force usage of the Haxe implementation even if a native API is found:
 	This will provide extra encoding features such as enums (replaced by their index) and StringMaps.
 

+ 4 - 4
std/haxe/Ucs2.hx

@@ -83,7 +83,7 @@ abstract Ucs2(String) {
 	}
 
 	/**
-		Returns the position of the leftmost occurence of `str` within `this`
+		Returns the position of the leftmost occurrence of `str` within `this`
 		Ucs2.
 
 		If `startIndex` is given, the search is performed within the substring
@@ -98,7 +98,7 @@ abstract Ucs2(String) {
 	}
 
 	/**
-		Returns the position of the rightmost occurence of `str` within `this`
+		Returns the position of the rightmost occurrence of `str` within `this`
 		Ucs2.
 
 		If `startIndex` is given, the search is performed within the substring
@@ -113,7 +113,7 @@ abstract Ucs2(String) {
 	}
 
 	/**
-		Splits `this` Ucs2 at each occurence of `delimiter`.
+		Splits `this` Ucs2 at each occurrence of `delimiter`.
 
 		If `this` Ucs2 is the empty Ucs2 "", the result is not consistent
 		across targets and may either be `[]` (on Js, Cpp) or `[""]`.
@@ -127,7 +127,7 @@ abstract Ucs2(String) {
 
 		If `delimiter` is null, the result is unspecified.
 
-		Otherwise, `this` Ucs2 is split into parts at each occurence of
+		Otherwise, `this` Ucs2 is split into parts at each occurrence of
 		`delimiter`. If `this` Ucs2 starts (or ends) with `delimiter`, the
 		result Array contains a leading (or trailing) empty Ucs2 "" element.
 		Two subsequent delimiters also result in an empty Ucs2 "" element.

+ 1 - 1
std/haxe/Utf8.hx

@@ -23,7 +23,7 @@ package haxe;
 
 /**
 	Since not all platforms guarantee that `String` always uses UTF-8 encoding, you
-	can use this crossplatform API to perform operations on such strings.
+	can use this cross-platform API to perform operations on such strings.
 **/
 class Utf8 {
 

+ 3 - 3
std/haxe/macro/Context.hx

@@ -475,7 +475,7 @@ class Context {
 		Defines a new module as `modulePath` with several `TypeDefinition`
 		`types`. This is analogous to defining a .hx file.
 
-		The individial `types` can reference each other and any identifier
+		The individual `types` can reference each other and any identifier
 		respects the `imports` and `usings` as usual, expect that imports are
 		not allowed to have `.*` wildcards or `in s` shorthands.
 	**/
@@ -554,7 +554,7 @@ class Context {
 	}
 
 	/**
-		Register a macro call to be performed everytime the module `modulePath` is reused by the compilation cache,
+		Register a macro call to be performed every time the module `modulePath` is reused by the compilation cache,
 		meaning that neither the module itself nor its dependencies was changed since last compilation.
 
 		The `macroCall` should be a String containing valid Haxe expression, similar to `--init` macros (see https://haxe.org/manual/macro-initialization.html).
@@ -571,7 +571,7 @@ class Context {
 	}
 
 	/**
-		Register a callback function that will be called everytime the macro context cached is reused with a new
+		Register a callback function that will be called every time the macro context cached is reused with a new
 		compilation. This enable to reset some static vars since the code might have been changed. If the callback
 		returns false, the macro context is discarded and another one is created.
 	**/

+ 2 - 2
std/haxe/macro/Expr.hx

@@ -67,7 +67,7 @@ enum Constant {
 	CString( s : String );
 
 	/**
-		Represents an indentifier.
+		Represents an identifier.
 	**/
 	CIdent( s : String );
 
@@ -819,7 +819,7 @@ typedef TypeDefinition = {
 	@:optional var meta : Metadata;
 
 	/**
-		The paramater type declarations of the type definition.
+		The parameter type declarations of the type definition.
 	**/
 	@:optional var params : Array<TypeParamDecl>;
 

+ 1 - 1
std/haxe/macro/TypeTools.hx

@@ -230,7 +230,7 @@ class TypeTools {
 		Applies the type parameters `typeParameters` to type `t` with the given
 		types `concreteTypes`.
 
-		This function replaces occurences of type parameters in `t` if they are
+		This function replaces occurrences of type parameters in `t` if they are
 		part of `typeParameters`. The array index of such a type parameter is
 		then used to lookup the concrete type in `concreteTypes`.
 

+ 1 - 1
std/haxe/remoting/SocketProtocol.hx

@@ -48,7 +48,7 @@ typedef Socket =
 	 - the boolean false for a response
 	 - a serialized value representing the result
 
-	Exceptions are serialized with `serializeException` so they will be thrown immediatly
+	Exceptions are serialized with `serializeException` so they will be thrown immediately
 	when they are unserialized.
 **/
 class SocketProtocol {

+ 3 - 3
std/haxe/xml/Parser.hx

@@ -54,17 +54,17 @@ class XmlParserException
 	public var message:String;
 
 	/**
-	 * the line number at which the XML parsing error occured
+	 * the line number at which the XML parsing error occurred
 	 */
 	public var lineNumber:Int;
 
 	/**
-	 * the character position in the reported line at which the parsing error occured
+	 * the character position in the reported line at which the parsing error occurred
 	 */
 	public var positionAtLine:Int;
 
 	/**
-	 * the character position in the XML string at which the parsing error occured
+	 * the character position in the XML string at which the parsing error occurred
 	 */
 	public var position:Int;
 

+ 1 - 1
std/js/html/SpeechSynthesisEvent.hx

@@ -51,7 +51,7 @@ extern class SpeechSynthesisEvent extends Event
 	var elapsedTime(default,null) : Float;
 	
 	/**
-		Returns the name associated with certain types of events occuring as the `SpeechSynthesisUtterance.text` is being spoken: the name of the SSML marker reached in the case of a `mark` event, or the type of boundary reached in the case of a `boundary` event.
+		Returns the name associated with certain types of events occurring as the `SpeechSynthesisUtterance.text` is being spoken: the name of the SSML marker reached in the case of a `mark` event, or the type of boundary reached in the case of a `boundary` event.
 	**/
 	var name(default,null) : String;
 	

+ 1 - 1
std/lua/HaxeIterator.hx

@@ -23,7 +23,7 @@
 package lua;
 
 /**
-  An implementation of the Haxe iterator datastructure needed for identical 
+  An implementation of the Haxe iterator data structure needed for identical 
   lua iterator behavior. 
  **/
 class HaxeIterator<T> {

+ 1 - 1
std/neko/Web.hx

@@ -23,7 +23,7 @@ package neko;
 
 /**
 	This class is used for accessing the local Web server and the current
-	client request and informations.
+	client request and information.
 **/
 class Web {
 

+ 1 - 1
std/neko/net/ServerLoop.hx

@@ -137,7 +137,7 @@ class ServerLoop<ClientData> {
 	}
 
 	/**
-		Called when an error occured. This enable you to log the error somewhere.
+		Called when an error occurred. This enable you to log the error somewhere.
 		By default the error is displayed using `trace`.
 	**/
 	public function onError( e : Dynamic ) {

+ 3 - 3
std/neko/vm/Loader.hx

@@ -40,7 +40,7 @@ enum LoaderHandle {
 	Loaders can be used for sandbox security. When a Module is loaded with a given
 	Loader, this loader can manager the module security by filtering which
 	primitives can be loaded by this module or by rewrapping them at loading-time
-	with custom securized versions. Loaders are inherited in loaded submodules.
+	with custom secured versions. Loaders are inherited in loaded submodules.
 **/
 class Loader {
 
@@ -78,8 +78,8 @@ class Loader {
 	/**
 		The default loader contains a cache of already loaded modules. It's
 		ensuring that the same module does not get loaded twice when circular
-		references are occuring. The same module can eventually be loaded twice
-		but with different names, for example with two relative paths reprensenting
+		references are occurring. The same module can eventually be loaded twice
+		but with different names, for example with two relative paths representing
 		the same file, since the cache is done on a by-name basic.
 	**/
 	public function getCache() : Map<String,Module> {

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

@@ -80,7 +80,7 @@ class Thread {
 
 	/**
 		The function [f] will be called by this thread if it's in [osLoop].
-		[sync] returns immediatly. See [osInitialize] remarks.
+		[sync] returns immediately. See [osInitialize] remarks.
 	**
 	public function sync( f : Void -> Void ) {
 		os_sync(handle,f);

+ 1 - 1
std/php/Web.hx

@@ -25,7 +25,7 @@ import haxe.io.Bytes;
 
 /**
 	This class is used for accessing the local Web server and the current
-	client request and informations.
+	client request and information.
 **/
 class Web {
 

+ 1 - 1
std/php7/Web.hx

@@ -28,7 +28,7 @@ import php.SuperGlobal.*;
 
 /**
 	This class is used for accessing the local Web server and the current
-	client request and informations.
+	client request and information.
 **/
 class Web {
 

+ 6 - 6
std/python/_std/sys/net/Socket.hx

@@ -126,7 +126,7 @@ private class SocketOutput extends haxe.io.Output {
     public var output(default,null) : haxe.io.Output;
 
     /**
-        A custom value that can be associated with the socket. Can be used to retreive your custom infos after a `select`.
+        A custom value that can be associated with the socket. Can be used to retrieve your custom infos after a `select`.
     ***/
     public var custom : Dynamic;
 
@@ -164,7 +164,7 @@ private class SocketOutput extends haxe.io.Output {
     }
 
     /**
-        Connect to the given server host/port. Throw an exception in case we couldn't sucessfully connect.
+        Connect to the given server host/port. Throw an exception in case we couldn't successfully connect.
     **/
     public function connect( host : Host, port : Int ) : Void {
         __init();
@@ -207,7 +207,7 @@ private class SocketOutput extends haxe.io.Output {
     }
 
     /**
-        Return the informations about the other side of a connected socket.
+        Return the information about the other side of a connected socket.
     **/
     public function peer() : { host : Host, port : Int } {
         var pn = __s.getpeername();
@@ -215,7 +215,7 @@ private class SocketOutput extends haxe.io.Output {
     }
 
     /**
-        Return the informations about our side of a connected socket.
+        Return the information about our side of a connected socket.
     **/
     public function host() : { host : Host, port : Int } {
         var pn = __s.getsockname();
@@ -237,14 +237,14 @@ private class SocketOutput extends haxe.io.Output {
     }
 
     /**
-        Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediatly by throwing a haxe.io.Error.Blocking value.
+        Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediately by throwing a haxe.io.Error.Blocking value.
     **/
     public function setBlocking( b : Bool ) : Void {
         __s.setblocking(b);
     }
 
     /**
-        Allows the socket to immediatly send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.
+        Allows the socket to immediately send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.
     **/
     public function setFastSend( b : Bool ) : Void {}
 

+ 4 - 4
std/python/lib/net/Socket.hx

@@ -44,7 +44,7 @@ extern class Socket {
     function close() : Void;
 
     /**
-        Connect to the given server host/port. Throw an exception in case we couldn't sucessfully connect.
+        Connect to the given server host/port. Throw an exception in case we couldn't successfully connect.
     **/
     function connect( addr : python.lib.net.Address ) : Void;
 
@@ -71,12 +71,12 @@ extern class Socket {
     function accept() : Tuple2<Socket,Address>;
 
     /**
-        Return the informations about the other side of a connected socket.
+        Return the information about the other side of a connected socket.
     **/
     function getpeername() : python.lib.net.Address;
 
     /**
-        Return the informations about our side of a connected socket.
+        Return the information about our side of a connected socket.
     **/
     function getsockname() : python.lib.net.Address;
 
@@ -91,7 +91,7 @@ extern class Socket {
     function waitForRead() : Void;
 
     /**
-        Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediatly by throwing a haxe.io.Error.Blocking value.
+        Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediately by throwing a haxe.io.Error.Blocking value.
     **/
     function setblocking( b : Bool ) : Void;
 

+ 2 - 2
std/sys/FileStat.hx

@@ -22,7 +22,7 @@
 package sys;
 
 /**
-	File informations, as given by `sys.FileSystem.stat`.
+	File information, as given by `sys.FileSystem.stat`.
 **/
 typedef FileStat = {
 
@@ -47,7 +47,7 @@ typedef FileStat = {
 	var mtime : Date;
 
 	/**
-		The creation time for the file (not all filesystems support this).
+		The creation time for the file (not all file systems support this).
 	**/
 	var ctime : Date;
 

+ 6 - 6
std/sys/net/Socket.hx

@@ -38,7 +38,7 @@ extern class Socket {
 	var output(default,null) : haxe.io.Output;
 
 	/**
-		A custom value that can be associated with the socket. Can be used to retreive your custom infos after a `select`.
+		A custom value that can be associated with the socket. Can be used to retrieve your custom infos after a `select`.
 	***/
 	var custom : Dynamic;
 
@@ -63,7 +63,7 @@ extern class Socket {
 	function write( content : String ) : Void;
 
 	/**
-		Connect to the given server host/port. Throw an exception in case we couldn't sucessfully connect.
+		Connect to the given server host/port. Throw an exception in case we couldn't successfully connect.
 	**/
 	function connect( host : Host, port : Int ) : Void;
 
@@ -88,12 +88,12 @@ extern class Socket {
 	function accept() : Socket;
 
 	/**
-		Return the informations about the other side of a connected socket.
+		Return the information about the other side of a connected socket.
 	**/
 	function peer() : { host : Host, port : Int };
 
 	/**
-		Return the informations about our side of a connected socket.
+		Return the information about our side of a connected socket.
 	**/
 	function host() : { host : Host, port : Int };
 
@@ -108,12 +108,12 @@ extern class Socket {
 	function waitForRead() : Void;
 
 	/**
-		Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediatly by throwing a haxe.io.Error.Blocking value.
+		Change the blocking mode of the socket. A blocking socket is the default behavior. A non-blocking socket will abort blocking operations immediately by throwing a haxe.io.Error.Blocking value.
 	**/
 	function setBlocking( b : Bool ) : Void;
 
 	/**
-		Allows the socket to immediatly send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.
+		Allows the socket to immediately send the data when written to its output : this will cause less ping but might increase the number of packets / data size, especially when doing a lot of small writes.
 	**/
 	function setFastSend( b : Bool ) : Void;
 

+ 1 - 1
tests/misc/src/Main.hx

@@ -84,7 +84,7 @@ class Main {
 			case [true, false]:
 				true;
 			case [true, true]:
-				Sys.println("Expected failure, but no failure occured");
+				Sys.println("Expected failure, but no failure occurred");
 				false;
 			case [false, true]:
 				true;

+ 2 - 2
tests/unit/src/unit/Test.hx

@@ -71,7 +71,7 @@ class Test {
 		incrCount(pos);
 		try {
 			f();
-			report("No exception occured",pos);
+			report("No exception occurred",pos);
 			success = false;
 		} catch( e : Dynamic ) {
 		}
@@ -169,7 +169,7 @@ class Test {
 		f(args,function(v) {
 			incrCount(pos);
 			if( asyncWaits.remove(pos) ) {
-				report("No exception occured",pos);
+				report("No exception occurred",pos);
 				success = false;
 				checkDone();
 			} else {

+ 1 - 1
tests/unit/src/unit/issues/Issue5572.hx

@@ -12,7 +12,7 @@ class Issue5572 extends unit.Test {
 		Reflect.setField(o, field2, 2); // second, added to object's "conflicts"
 		Reflect.setField(o, field2, 3); // should find one from "conflicts" and change the value
 		eq(Reflect.field(o, field1), 1); // retrieved from the hashes array
-		eq(Reflect.field(o, field2), 3); // retreived from "conflicts"
+		eq(Reflect.field(o, field2), 3); // retrieved from "conflicts"
 		var expectedFields = [field1, field2];
 		for (field in Reflect.fields(o)) {
 			if (!expectedFields.remove(field))