From d02fa17be2157783ba84c2e01bfbdf6bea70f576 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 14 Apr 2016 18:07:37 -0500 Subject: [PATCH 1/9] small typo and grammar fixes --- doc/source/reference/api/object_creation_and_handling.rst | 2 +- doc/source/reference/api/stack_operations.rst | 2 +- .../embedding/tables_and_arrays_manipulation.rst | 2 +- .../reference/language/constants_and_enumerations.rst | 8 ++++---- doc/source/stdlib/stdbloblib.rst | 2 +- doc/source/stdlib/stdiolib.rst | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/source/reference/api/object_creation_and_handling.rst b/doc/source/reference/api/object_creation_and_handling.rst index 85daf1b..189e404 100644 --- a/doc/source/reference/api/object_creation_and_handling.rst +++ b/doc/source/reference/api/object_creation_and_handling.rst @@ -455,7 +455,7 @@ pushes a null value into the stack :param HSQUIRRELVM v: the target VM :param const SQChar * s: pointer to the string that has to be pushed - :param SQInteger len: lenght of the string pointed by s + :param SQInteger len: length of the string pointed by s :remarks: if the parameter len is less than 0 the VM will calculate the length using strlen(s) pushes a string in the stack diff --git a/doc/source/reference/api/stack_operations.rst b/doc/source/reference/api/stack_operations.rst index 99153cd..608ebed 100644 --- a/doc/source/reference/api/stack_operations.rst +++ b/doc/source/reference/api/stack_operations.rst @@ -91,7 +91,7 @@ removes an element from an arbitrary position in the stack :param SQInteger nsize: required stack size :returns: a SQRESULT -ensure that the stack space left is at least of a specified size.If the stack is smaller it will automatically grow. if there's a memtamethod currently running the function will fail and the stack will not be resized, this situatuation has to be considered a "stack overflow". +ensure that the stack space left is at least of a specified size.If the stack is smaller it will automatically grow. if there's a metamethod currently running the function will fail and the stack will not be resized, this situatuation has to be considered a "stack overflow". diff --git a/doc/source/reference/embedding/tables_and_arrays_manipulation.rst b/doc/source/reference/embedding/tables_and_arrays_manipulation.rst index fed66cf..8378a10 100644 --- a/doc/source/reference/embedding/tables_and_arrays_manipulation.rst +++ b/doc/source/reference/embedding/tables_and_arrays_manipulation.rst @@ -47,7 +47,7 @@ To get a value from an array or table:: SQRESULT sq_get(HSQUIRRELVM v,SQInteger idx); -To get or set a value from a table without employ delegation:: +To get or set a value from a table without employing delegation:: SQRESULT sq_rawget(HSQUIRRELVM v,SQInteger idx); SQRESULT sq_rawset(HSQUIRRELVM v,SQInteger idx); diff --git a/doc/source/reference/language/constants_and_enumerations.rst b/doc/source/reference/language/constants_and_enumerations.rst index 7039b62..136fd16 100644 --- a/doc/source/reference/language/constants_and_enumerations.rst +++ b/doc/source/reference/language/constants_and_enumerations.rst @@ -37,17 +37,17 @@ Constants will shadow any global slot with the same name( the global slot will r local x = foobar * 2; --------------- -Enumrations +Enumerations --------------- .. index:: - single: Enumrations + single: Enumerations -As Constants, Enumerations bind a specific value to a name. Enumerations are also evaluated compile time +As Constants, Enumerations bind a specific value to a name. Enumerations are also evaluated at compile time and their value cannot be changed. An enum declaration introduces a new enumeration into the program. -Enumerations values can only be integers, floats or string literals. No expression are allowed.:: +Enumeration values can only be integers, floats or string literals. No expression are allowed.:: enum Stuff { first, //this will be 0 diff --git a/doc/source/stdlib/stdbloblib.rst b/doc/source/stdlib/stdbloblib.rst index b8c809a..07543f9 100644 --- a/doc/source/stdlib/stdbloblib.rst +++ b/doc/source/stdlib/stdbloblib.rst @@ -60,7 +60,7 @@ A blob can also be accessed byte by byte through the `[]` operator. .. js:function:: blob.len() - returns the lenght of the stream + returns the length of the stream .. js:function:: blob.readblob(size) diff --git a/doc/source/stdlib/stdiolib.rst b/doc/source/stdlib/stdiolib.rst index 26660f7..7d29644 100644 --- a/doc/source/stdlib/stdiolib.rst +++ b/doc/source/stdlib/stdiolib.rst @@ -83,7 +83,7 @@ The file class .. js:function:: file.len() - returns the lenght of the stream + returns the length of the stream .. js:function:: file.readblob(size) From 9218082df1c87f246de909b1e5c66c95409ab3f2 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 14 Apr 2016 18:08:29 -0500 Subject: [PATCH 2/9] defferentieate -> differentiate --- doc/source/reference/language/metamethods.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/reference/language/metamethods.rst b/doc/source/reference/language/metamethods.rst index 3f05738..7c80ea9 100644 --- a/doc/source/reference/language/metamethods.rst +++ b/doc/source/reference/language/metamethods.rst @@ -64,7 +64,7 @@ _set invoked when the index idx is not present in the object or in its delegate chain. ``_set`` must 'throw null' to notify that a key wasn't found but the there were not runtime errors(clean failure). -This allows the program to defferentieate between a runtime error and a 'index not found'. +This allows the program to differentiate between a runtime error and a 'index not found'. ^^^^^ _get @@ -76,7 +76,7 @@ _get invoked when the index idx is not present in the object or in its delegate chain. _get must 'throw null' to notify that a key wasn't found but the there were not runtime errors(clean failure). -This allows the program to defferentieate between a runtime error and a 'index not found'. +This allows the program to differentiate between a runtime error and a 'index not found'. ^^^^^^^^^ _newslot From 2f6419f19b45a5180f988528c302c2b116c98256 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 14 Apr 2016 18:13:13 -0500 Subject: [PATCH 3/9] clarify sq_cmp --- doc/source/reference/api/stack_operations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/reference/api/stack_operations.rst b/doc/source/reference/api/stack_operations.rst index 608ebed..0fdaeb4 100644 --- a/doc/source/reference/api/stack_operations.rst +++ b/doc/source/reference/api/stack_operations.rst @@ -13,7 +13,7 @@ Stack Operations :returns: == 0 if obj1==obj2 :returns: < 0 if obj1 Date: Thu, 14 Apr 2016 18:17:45 -0500 Subject: [PATCH 4/9] fix typo in error messages: "stack overflow, cannot resize stack while in a metamethod" --- squirrel/sqapi.cpp | 2 +- squirrel/sqvm.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/squirrel/sqapi.cpp b/squirrel/sqapi.cpp index 56187b0..5b3862e 100644 --- a/squirrel/sqapi.cpp +++ b/squirrel/sqapi.cpp @@ -1128,7 +1128,7 @@ SQRESULT sq_reservestack(HSQUIRRELVM v,SQInteger nsize) { if (((SQUnsignedInteger)v->_top + nsize) > v->_stack.size()) { if(v->_nmetamethodscall) { - return sq_throwerror(v,_SC("cannot resize stack while in a metamethod")); + return sq_throwerror(v,_SC("cannot resize stack while in a metamethod")); } v->_stack.resize(v->_stack.size() + ((v->_top + nsize) - v->_stack.size())); } diff --git a/squirrel/sqvm.cpp b/squirrel/sqvm.cpp index 455f92b..f1addd1 100644 --- a/squirrel/sqvm.cpp +++ b/squirrel/sqvm.cpp @@ -1632,7 +1632,7 @@ bool SQVM::EnterFrame(SQInteger newbase, SQInteger newtop, bool tailcall) _top = newtop; if(newtop + MIN_STACK_OVERHEAD > (SQInteger)_stack.size()) { if(_nmetamethodscall) { - Raise_Error(_SC("stack overflow, cannot resize stack while in a metamethod")); + Raise_Error(_SC("stack overflow, cannot resize stack while in a metamethod")); return false; } _stack.resize(newtop + (MIN_STACK_OVERHEAD << 2)); From 4305796277c1520e0f9efa8d3e0a7242a3f4796e Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 14 Apr 2016 18:22:20 -0500 Subject: [PATCH 5/9] fix metamethod _get documentation from _get(idx,val) to _get(idx) --- doc/source/reference/language/metamethods.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/reference/language/metamethods.rst b/doc/source/reference/language/metamethods.rst index 7c80ea9..a9b7c6b 100644 --- a/doc/source/reference/language/metamethods.rst +++ b/doc/source/reference/language/metamethods.rst @@ -72,7 +72,7 @@ _get :: - _get(idx,val) + _get(idx) invoked when the index idx is not present in the object or in its delegate chain. _get must 'throw null' to notify that a key wasn't found but the there were not runtime errors(clean failure). From 4fddb87839418125bcbafe1670c786a013f2521c Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 14 Apr 2016 18:23:45 -0500 Subject: [PATCH 6/9] tidy metamethods general docs --- doc/source/reference/language/metamethods.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/reference/language/metamethods.rst b/doc/source/reference/language/metamethods.rst index a9b7c6b..3596842 100644 --- a/doc/source/reference/language/metamethods.rst +++ b/doc/source/reference/language/metamethods.rst @@ -6,11 +6,11 @@ Metamethods Metamethods are a mechanism that allows the customization of certain aspects of the language semantics. Those methods are normal functions placed in a table -parent(delegate) or class declaration; Is possible to change many aspect of a table/class instance behavior by just defining -a metamethod. Class objects(not instances) supports only 2 metamethods ``_newmember, _inherited`` . +parent(delegate) or class declaration; It is possible to change many aspects of a table/class instance behavior by just defining +a metamethod. Class objects (not instances) support only 2 metamethods ``_newmember, _inherited`` . For example when we use relational operators other than '==' on 2 tables, the VM will -check if the table has a method in his parent called '_cmp' if so it will call it to determine +check if the table has a method in his parent called '_cmp'; if so it will call it to determine the relation between the tables.:: local comparable={ From a70a135192e878e2f0a7d0aeb4beba28e7c99a23 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 14 Apr 2016 18:25:00 -0500 Subject: [PATCH 7/9] clarify sq_getmemberhandle - it only works on classes. not sure what vice-versa meant --- doc/source/reference/api/object_creation_and_handling.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/reference/api/object_creation_and_handling.rst b/doc/source/reference/api/object_creation_and_handling.rst index 189e404..fe2654c 100644 --- a/doc/source/reference/api/object_creation_and_handling.rst +++ b/doc/source/reference/api/object_creation_and_handling.rst @@ -177,7 +177,7 @@ gets the value of the integer at the idx position in the stack. :param SQInteger idx: an index in the stack pointing to the class :param HSQMEMBERHANDLE* handle: a pointer to the variable that will store the handle :returns: a SQRESULT - :remarks: This method works only with classes and instances. A handle retrieved through a class can be later used to set or get values from one of the class instances and vice-versa. Handles retrieved from base classes are still valid in derived classes and respect inheritance rules. + :remarks: This method works only with classes. A handle retrieved through a class can be later used to set or get values from one of the class instances. Handles retrieved from base classes are still valid in derived classes and respect inheritance rules. pops a value from the stack and uses it as index to fetch the handle of a class member. The handle can be later used to set or get the member value using sq_getbyhandle(),sq_setbyhandle(). From c44d568a8b8b6af850cbfb5f7601e33f9693d911 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 14 Apr 2016 18:28:41 -0500 Subject: [PATCH 8/9] docs typo fix: ivoked&ecoding --- doc/source/stdlib/stdiolib.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/source/stdlib/stdiolib.rst b/doc/source/stdlib/stdiolib.rst index 7d29644..cc69c7b 100644 --- a/doc/source/stdlib/stdiolib.rst +++ b/doc/source/stdlib/stdiolib.rst @@ -21,20 +21,20 @@ Global Symbols returns the value returned by the script or null if no value is returned. if the optional parameter 'raiseerror' is true, the compiler error handler is invoked in case of a syntax error. If raiseerror is omitted or set to false, the compiler - error handler is not ivoked. - When squirrel is compiled in unicode mode the function can handle different character ecodings, + error handler is not invoked. + When squirrel is compiled in unicode mode the function can handle different character encodings, UTF8 with and without prefix and UCS-2 prefixed(both big endian an little endian). - If the source stream is not prefixed UTF8 ecoding is used as default. + If the source stream is not prefixed UTF8 encoding is used as default. .. js:function:: loadfile(path, [raiseerror]) compiles a squirrel script or loads a precompiled one an returns it as as function. if the optional parameter 'raiseerror' is true, the compiler error handler is invoked in case of a syntax error. If raiseerror is omitted or set to false, the compiler - error handler is not ivoked. - When squirrel is compiled in unicode mode the function can handle different character ecodings, + error handler is not invoked. + When squirrel is compiled in unicode mode the function can handle different character encodings, UTF8 with and without prefix and UCS-2 prefixed(both big endian an little endian). - If the source stream is not prefixed UTF8 ecoding is used as default. + If the source stream is not prefixed UTF8 encoding is used as default. .. js:function:: writeclosuretofile(destpath, closure) @@ -230,9 +230,9 @@ Script loading and serialization :returns: an SQRESULT Compiles a squirrel script or loads a precompiled one an pushes it as closure in the stack. - When squirrel is compiled in unicode mode the function can handle different character ecodings, + When squirrel is compiled in unicode mode the function can handle different character encodings, UTF8 with and without prefix and UCS-2 prefixed(both big endian an little endian). - If the source stream is not prefixed UTF8 ecoding is used as default. + If the source stream is not prefixed UTF8 encoding is used as default. .. c:function:: SQRESULT sqstd_dofile(HSQUIRRELVM v, const SQChar* filename, SQBool retval, SQBool printerror) @@ -245,9 +245,9 @@ Script loading and serialization Compiles a squirrel script or loads a precompiled one and executes it. Optionally pushes the return value of the executed script in the stack. - When squirrel is compiled in unicode mode the function can handle different character ecodings, + When squirrel is compiled in unicode mode the function can handle different character encodings, UTF8 with and without prefix and UCS-2 prefixed(both big endian an little endian). - If the source stream is not prefixed UTF8 ecoding is used as default. :: + If the source stream is not prefixed UTF8 encoding is used as default. :: sq_pushroottable(v); //push the root table(were the globals of the script will are stored) sqstd_dofile(v, _SC("test.nut"), SQFalse, SQTrue);// also prints syntax errors if any From 175139968a9b14c607226c74aadacbcec4844b9b Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 14 Apr 2016 18:28:56 -0500 Subject: [PATCH 9/9] error message fix: Unrecognozed ecoding --- sqstdlib/sqstdio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqstdlib/sqstdio.cpp b/sqstdlib/sqstdio.cpp index 273bb5c..9aaaccb 100644 --- a/sqstdlib/sqstdio.cpp +++ b/sqstdlib/sqstdio.cpp @@ -372,7 +372,7 @@ SQRESULT sqstd_loadfile(HSQUIRRELVM v,const SQChar *filename,SQBool printerror) } if(uc != 0xBF) { sqstd_fclose(file); - return sq_throwerror(v,_SC("Unrecognozed ecoding")); + return sq_throwerror(v,_SC("Unrecognized encoding")); } #ifdef SQUNICODE func = _io_file_lexfeed_UTF8;