commit
2d509d385b
@ -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.
|
||||
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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 <- {
|
||||
|
@ -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
|
@ -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)
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user