From 09c4e7a8c1e0c952110e2032d9304b0e1b8183d6 Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 12 May 2016 11:22:41 -0500 Subject: [PATCH 1/4] fix docs for 'unsigned right shift operator' to reference >>> instead of <<< ! also minor tidying in same file --- doc/source/reference/language/expressions.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/reference/language/expressions.rst b/doc/source/reference/language/expressions.rst index d84367a..7b9683d 100644 --- a/doc/source/reference/language/expressions.rst +++ b/doc/source/reference/language/expressions.rst @@ -221,10 +221,10 @@ Bitwise Operators exp:= 'exp' op 'exp' exp := '~' exp -Squirrel supports the standard c-like bit wise operators ``&, |, ^, ~, <<, >>`` plus the unsigned -right shift operator ``<<<``. The unsigned right shift works exactly like the normal right shift operator(``<<``) +Squirrel supports the standard C-like bitwise operators ``&, |, ^, ~, <<, >>`` plus the unsigned +right shift operator ``>>>``. The unsigned right shift works exactly like the normal right shift operator(``>>``) except for treating the left operand as an unsigned integer, so is not affected by the sign. Those operators -only work on integers values, passing of any other operand type to these operators will +only work on integer values; passing of any other operand type to these operators will cause an exception. ^^^^^^^^^^^^^^^^^^^^^ @@ -255,7 +255,7 @@ Operators precedence +---------------------------------------+-----------+ | ``+=, =, -=`` | ... | +---------------------------------------+-----------+ -| ``,(comma operator)`` | lowest | +| ``, (comma operator)`` | lowest | +---------------------------------------+-----------+ .. _table_contructor: @@ -293,7 +293,7 @@ A new slot with exp1 as key and exp2 as value is created:: [1]="I'm the value" } -both syntaxes can be mixed:: +Both syntaxes can be mixed:: local table= { @@ -369,6 +369,6 @@ Creates a new array.:: a <- [] //creates an empty array -arrays can be initialized with values during the construction:: +Arrays can be initialized with values during the construction:: a <- [1,"string!",[],{}] //creates an array with 4 elements \ No newline at end of file From 997c7aefd24e674848ebad7a9f99503e385a5552 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 11 Jun 2016 16:48:22 -0500 Subject: [PATCH 2/4] Update sqapi.cpp change comment "pop closure and args" to "pop args" in sq_call(). the code clearly pops only args. the docs say: "the function pops all the parameters and leave the closure in the stack" --- squirrel/sqapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/squirrel/sqapi.cpp b/squirrel/sqapi.cpp index c5a70d6..4dc2a82 100644 --- a/squirrel/sqapi.cpp +++ b/squirrel/sqapi.cpp @@ -1164,7 +1164,7 @@ SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror) if(v->Call(v->GetUp(-(params+1)),params,v->_top-params,res,raiseerror?true:false)){ if(!v->_suspended) { - v->Pop(params);//pop closure and args + v->Pop(params);//pop args } if(retval){ v->Push(res); return SQ_OK; From 3c4098da84e4cbdb6591fd8d48b0f16bc1ccba3b Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 13 Jun 2016 17:20:11 -0500 Subject: [PATCH 3/4] small docs fixes. small typo fixes in sqapi.cpp error messages --- doc/source/reference/api/object_manipulation.rst | 6 +++--- doc/source/reference/language/classes.rst | 4 ++-- squirrel/sqapi.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/source/reference/api/object_manipulation.rst b/doc/source/reference/api/object_manipulation.rst index 4d5288d..099fc59 100644 --- a/doc/source/reference/api/object_manipulation.rst +++ b/doc/source/reference/api/object_manipulation.rst @@ -91,7 +91,7 @@ resizes the array at the position idx in the stack. :returns: a SQRESULT :remarks: Only works on arrays. -reverse an array in place. +reverses an array in place. @@ -106,7 +106,7 @@ reverse an array in place. :returns: a SQRESULT :remarks: Only works on tables and arrays. -clears all the element of the table/array at position idx in the stack. +clears all the elements of the table/array at position idx in the stack. @@ -120,7 +120,7 @@ clears all the element of the table/array at position idx in the stack. :param SQInteger idx: index of the target object in the stack :returns: a SQRESULT -Clones the table, array or class instance at the position idx, clones it and pushes the new object in the stack. +pushes a clone of the table, array, or class instance at the position idx. diff --git a/doc/source/reference/language/classes.rst b/doc/source/reference/language/classes.rst index 7637f5b..81ee4c4 100644 --- a/doc/source/reference/language/classes.rst +++ b/doc/source/reference/language/classes.rst @@ -46,7 +46,7 @@ For instance: :: } -the previous code examples is a syntactic sugar for: :: +the previous code example is a syntactic sugar for: :: Foo <- class { //constructor @@ -67,7 +67,7 @@ the previous code examples is a syntactic sugar for: :: } -in order to emulate namespaces, is also possible to declare something like this:: +in order to emulate namespaces, it is also possible to declare something like this:: //just 2 regular nested tables FakeNamespace <- { diff --git a/squirrel/sqapi.cpp b/squirrel/sqapi.cpp index 4dc2a82..034e7be 100644 --- a/squirrel/sqapi.cpp +++ b/squirrel/sqapi.cpp @@ -510,7 +510,7 @@ SQRESULT sq_setclosureroot(HSQUIRRELVM v,SQInteger idx) v->Pop(); return SQ_OK; } - return sq_throwerror(v, _SC("ivalid type")); + return sq_throwerror(v, _SC("invalid type")); } SQRESULT sq_getclosureroot(HSQUIRRELVM v,SQInteger idx) @@ -558,7 +558,7 @@ SQRESULT sq_setroottable(HSQUIRRELVM v) v->Pop(); return SQ_OK; } - return sq_throwerror(v, _SC("ivalid type")); + return sq_throwerror(v, _SC("invalid type")); } SQRESULT sq_setconsttable(HSQUIRRELVM v) @@ -569,7 +569,7 @@ SQRESULT sq_setconsttable(HSQUIRRELVM v) v->Pop(); return SQ_OK; } - return sq_throwerror(v, _SC("ivalid type, expected table")); + return sq_throwerror(v, _SC("invalid type, expected table")); } void sq_setforeignptr(HSQUIRRELVM v,SQUserPointer p) From 3b217e7e428eedf5b019bfab21362e7a99b0fabf Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 14 Jun 2016 13:09:53 -0500 Subject: [PATCH 4/4] fix getstackinfos docs --- doc/source/reference/language/builtin_functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/reference/language/builtin_functions.rst b/doc/source/reference/language/builtin_functions.rst index 2c344e5..57ec785 100644 --- a/doc/source/reference/language/builtin_functions.rst +++ b/doc/source/reference/language/builtin_functions.rst @@ -105,7 +105,7 @@ returns the stack informations of a given call stack level. returns a table form } } -level = 0 is the current function, level = 1 is the caller and so on. If the stack level doesn't exist the function returns null. +level = 0 is getstackinfos() itself! level = 1 is the current function, level = 2 is the caller of the current function, and so on. If the stack level doesn't exist the function returns null. .. js:function:: newthread(threadfunc)