Florian Dormont vor 9 Jahren
Ursprung
Commit
d418f98809

+ 1 - 1
README

@@ -13,7 +13,7 @@ The following compilers have been confirmed to be working:
                    7.1   v
                    8.0
                    9.0
-                  10.0 
+                  10.0
                   12.0  ---
     MinGW gcc 3.2 (mingw special 20020817-1)
     Cygnus gcc 3.2

+ 263 - 263
doc/make.bat

@@ -1,263 +1,263 @@
-@ECHO OFF
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
-	set SPHINXBUILD=sphinx-build
-)
-set BUILDDIR=build
-set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
-set I18NSPHINXOPTS=%SPHINXOPTS% source
-if NOT "%PAPER%" == "" (
-	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
-	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
-)
-
-if "%1" == "" goto help
-
-if "%1" == "help" (
-	:help
-	echo.Please use `make ^<target^>` where ^<target^> is one of
-	echo.  html       to make standalone HTML files
-	echo.  dirhtml    to make HTML files named index.html in directories
-	echo.  singlehtml to make a single large HTML file
-	echo.  pickle     to make pickle files
-	echo.  json       to make JSON files
-	echo.  htmlhelp   to make HTML files and a HTML help project
-	echo.  qthelp     to make HTML files and a qthelp project
-	echo.  devhelp    to make HTML files and a Devhelp project
-	echo.  epub       to make an epub
-	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
-	echo.  text       to make text files
-	echo.  man        to make manual pages
-	echo.  texinfo    to make Texinfo files
-	echo.  gettext    to make PO message catalogs
-	echo.  changes    to make an overview over all changed/added/deprecated items
-	echo.  xml        to make Docutils-native XML files
-	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
-	echo.  linkcheck  to check all external links for integrity
-	echo.  doctest    to run all doctests embedded in the documentation if enabled
-	echo.  coverage   to run coverage check of the documentation if enabled
-	goto end
-)
-
-if "%1" == "clean" (
-	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
-	del /q /s %BUILDDIR%\*
-	goto end
-)
-
-
-REM Check if sphinx-build is available and fallback to Python version if any
-%SPHINXBUILD% 1>NUL 2>NUL
-if errorlevel 9009 goto sphinx_python
-goto sphinx_ok
-
-:sphinx_python
-
-set SPHINXBUILD=python -m sphinx.__init__
-%SPHINXBUILD% 2> nul
-if errorlevel 9009 (
-	echo.
-	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
-	echo.installed, then set the SPHINXBUILD environment variable to point
-	echo.to the full path of the 'sphinx-build' executable. Alternatively you
-	echo.may add the Sphinx directory to PATH.
-	echo.
-	echo.If you don't have Sphinx installed, grab it from
-	echo.http://sphinx-doc.org/
-	exit /b 1
-)
-
-:sphinx_ok
-
-
-if "%1" == "html" (
-	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
-	goto end
-)
-
-if "%1" == "dirhtml" (
-	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
-	goto end
-)
-
-if "%1" == "singlehtml" (
-	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
-	goto end
-)
-
-if "%1" == "pickle" (
-	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; now you can process the pickle files.
-	goto end
-)
-
-if "%1" == "json" (
-	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; now you can process the JSON files.
-	goto end
-)
-
-if "%1" == "htmlhelp" (
-	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; now you can run HTML Help Workshop with the ^
-.hhp project file in %BUILDDIR%/htmlhelp.
-	goto end
-)
-
-if "%1" == "qthelp" (
-	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; now you can run "qcollectiongenerator" with the ^
-.qhcp project file in %BUILDDIR%/qthelp, like this:
-	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\testy_sphinxy.qhcp
-	echo.To view the help file:
-	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\testy_sphinxy.ghc
-	goto end
-)
-
-if "%1" == "devhelp" (
-	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished.
-	goto end
-)
-
-if "%1" == "epub" (
-	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The epub file is in %BUILDDIR%/epub.
-	goto end
-)
-
-if "%1" == "latex" (
-	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
-	goto end
-)
-
-if "%1" == "latexpdf" (
-	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
-	cd %BUILDDIR%/latex
-	make all-pdf
-	cd %~dp0
-	echo.
-	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
-	goto end
-)
-
-if "%1" == "latexpdfja" (
-	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
-	cd %BUILDDIR%/latex
-	make all-pdf-ja
-	cd %~dp0
-	echo.
-	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
-	goto end
-)
-
-if "%1" == "text" (
-	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The text files are in %BUILDDIR%/text.
-	goto end
-)
-
-if "%1" == "man" (
-	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The manual pages are in %BUILDDIR%/man.
-	goto end
-)
-
-if "%1" == "texinfo" (
-	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
-	goto end
-)
-
-if "%1" == "gettext" (
-	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
-	goto end
-)
-
-if "%1" == "changes" (
-	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.The overview file is in %BUILDDIR%/changes.
-	goto end
-)
-
-if "%1" == "linkcheck" (
-	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Link check complete; look for any errors in the above output ^
-or in %BUILDDIR%/linkcheck/output.txt.
-	goto end
-)
-
-if "%1" == "doctest" (
-	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Testing of doctests in the sources finished, look at the ^
-results in %BUILDDIR%/doctest/output.txt.
-	goto end
-)
-
-if "%1" == "coverage" (
-	%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Testing of coverage in the sources finished, look at the ^
-results in %BUILDDIR%/coverage/python.txt.
-	goto end
-)
-
-if "%1" == "xml" (
-	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The XML files are in %BUILDDIR%/xml.
-	goto end
-)
-
-if "%1" == "pseudoxml" (
-	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
-	goto end
-)
-
-:end
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+    set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
+set I18NSPHINXOPTS=%SPHINXOPTS% source
+if NOT "%PAPER%" == "" (
+    set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+    set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+    :help
+    echo.Please use `make ^<target^>` where ^<target^> is one of
+    echo.  html       to make standalone HTML files
+    echo.  dirhtml    to make HTML files named index.html in directories
+    echo.  singlehtml to make a single large HTML file
+    echo.  pickle     to make pickle files
+    echo.  json       to make JSON files
+    echo.  htmlhelp   to make HTML files and a HTML help project
+    echo.  qthelp     to make HTML files and a qthelp project
+    echo.  devhelp    to make HTML files and a Devhelp project
+    echo.  epub       to make an epub
+    echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+    echo.  text       to make text files
+    echo.  man        to make manual pages
+    echo.  texinfo    to make Texinfo files
+    echo.  gettext    to make PO message catalogs
+    echo.  changes    to make an overview over all changed/added/deprecated items
+    echo.  xml        to make Docutils-native XML files
+    echo.  pseudoxml  to make pseudoxml-XML files for display purposes
+    echo.  linkcheck  to check all external links for integrity
+    echo.  doctest    to run all doctests embedded in the documentation if enabled
+    echo.  coverage   to run coverage check of the documentation if enabled
+    goto end
+)
+
+if "%1" == "clean" (
+    for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+    del /q /s %BUILDDIR%\*
+    goto end
+)
+
+
+REM Check if sphinx-build is available and fallback to Python version if any
+%SPHINXBUILD% 1>NUL 2>NUL
+if errorlevel 9009 goto sphinx_python
+goto sphinx_ok
+
+:sphinx_python
+
+set SPHINXBUILD=python -m sphinx.__init__
+%SPHINXBUILD% 2> nul
+if errorlevel 9009 (
+    echo.
+    echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+    echo.installed, then set the SPHINXBUILD environment variable to point
+    echo.to the full path of the 'sphinx-build' executable. Alternatively you
+    echo.may add the Sphinx directory to PATH.
+    echo.
+    echo.If you don't have Sphinx installed, grab it from
+    echo.http://sphinx-doc.org/
+    exit /b 1
+)
+
+:sphinx_ok
+
+
+if "%1" == "html" (
+    %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+    goto end
+)
+
+if "%1" == "dirhtml" (
+    %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+    goto end
+)
+
+if "%1" == "singlehtml" (
+    %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+    goto end
+)
+
+if "%1" == "pickle" (
+    %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished; now you can process the pickle files.
+    goto end
+)
+
+if "%1" == "json" (
+    %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished; now you can process the JSON files.
+    goto end
+)
+
+if "%1" == "htmlhelp" (
+    %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+    goto end
+)
+
+if "%1" == "qthelp" (
+    %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+    echo.^> qcollectiongenerator %BUILDDIR%\qthelp\testy_sphinxy.qhcp
+    echo.To view the help file:
+    echo.^> assistant -collectionFile %BUILDDIR%\qthelp\testy_sphinxy.ghc
+    goto end
+)
+
+if "%1" == "devhelp" (
+    %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished.
+    goto end
+)
+
+if "%1" == "epub" (
+    %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The epub file is in %BUILDDIR%/epub.
+    goto end
+)
+
+if "%1" == "latex" (
+    %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+    goto end
+)
+
+if "%1" == "latexpdf" (
+    %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+    cd %BUILDDIR%/latex
+    make all-pdf
+    cd %~dp0
+    echo.
+    echo.Build finished; the PDF files are in %BUILDDIR%/latex.
+    goto end
+)
+
+if "%1" == "latexpdfja" (
+    %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+    cd %BUILDDIR%/latex
+    make all-pdf-ja
+    cd %~dp0
+    echo.
+    echo.Build finished; the PDF files are in %BUILDDIR%/latex.
+    goto end
+)
+
+if "%1" == "text" (
+    %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The text files are in %BUILDDIR%/text.
+    goto end
+)
+
+if "%1" == "man" (
+    %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The manual pages are in %BUILDDIR%/man.
+    goto end
+)
+
+if "%1" == "texinfo" (
+    %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
+    goto end
+)
+
+if "%1" == "gettext" (
+    %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
+    goto end
+)
+
+if "%1" == "changes" (
+    %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.The overview file is in %BUILDDIR%/changes.
+    goto end
+)
+
+if "%1" == "linkcheck" (
+    %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+    goto end
+)
+
+if "%1" == "doctest" (
+    %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+    goto end
+)
+
+if "%1" == "coverage" (
+    %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Testing of coverage in the sources finished, look at the ^
+results in %BUILDDIR%/coverage/python.txt.
+    goto end
+)
+
+if "%1" == "xml" (
+    %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The XML files are in %BUILDDIR%/xml.
+    goto end
+)
+
+if "%1" == "pseudoxml" (
+    %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
+    if errorlevel 1 exit /b 1
+    echo.
+    echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
+    goto end
+)
+
+:end

+ 1 - 1
doc/source/reference/api/object_manipulation.rst

@@ -446,6 +446,6 @@ pops a value from the stack and sets it as a free variable of the closure at the
     :param HSQUIRRELVM v: the target VM
     :param SQInteger idx: index to the target object in the stack
     :returns: a SQRESULT
-    :remarks: if the object at idx position is an integer,float,bool or null the object itself is pushed instead of a weak ref.
+    :remarks: if the object at idx position is one of (integer, float, bool, null), the object itself is pushed instead of a weak ref.
 
 pushes a weak reference to the object at position idx in the stack.

+ 5 - 5
doc/source/reference/introduction.rst

@@ -7,10 +7,10 @@ Introduction
 .. index::
     single: introduction
 
-Squirrel is a high level imperative-OO programming language, designed to be a powerful
-scripting tool that fits in the size, memory bandwidth, and real-time requirements of
+Squirrel is a high-level, imperative-OO programming language, designed to be a powerful
+scripting tool that fits within the size, memory bandwidth, and real-time requirements of
 applications like games.
-Although Squirrel offers a wide range of features like dynamic typing, delegation, higher
+Squirrel offers a wide range of features like dynamic typing, delegation, higher
 order functions, generators, tail recursion, exception handling, automatic memory
-management, both compiler and virtual machine fit together in about 6k lines of C++
-code.
+management while fitting both compiler and virtual machine into about 6k lines of C++
+code.

+ 31 - 32
doc/source/reference/language/builtin_functions.rst

@@ -16,8 +16,7 @@ Global Symbols
 
 .. js:function:: array(size,[fill])
 
-create and returns array of a specified size.if the optional parameter fill is specified its
-value will be used to fill the new array's slots. If the fill parameter is omitted null is used instead.
+creates and returns array of a specified size. If the optional parameter fill is specified its value will be used to fill the new array's slots. If the fill parameter is omitted, null is used instead.
 
 .. js:function:: seterrorhandler(func)
 
@@ -76,11 +75,11 @@ compiles a string containing a squirrel script into a function and returns it::
 
 .. js:function:: collectgarbage()
 
-    runs the garbage collector and returns the number of reference cycles found(and deleted) This function only works on garbage collector builds.
+    Runs the garbage collector and returns the number of reference cycles found (and deleted). This function only works on garbage collector builds.
 
 .. js:function:: resurrectunreachable()
 
-runs the garbage collector and returns an array containing all unreachable object found. If no unreachable object is found, null is returned instead. This function is meant to help debugging reference cycles. This function only works on garbage collector builds.
+Runs the garbage collector and returns an array containing all unreachable object found. If no unreachable object is found, null is returned instead. This function is meant to help debugging reference cycles. This function only works on garbage collector builds.
 
 .. js:function:: type(obj)
 
@@ -113,7 +112,7 @@ creates a new cooperative thread object(coroutine) and returns it
 
 .. js:data:: _versionnumber_
 
-integer values describing the version of VM and compiler. eg. for Squirrel 3.0.1 this value will be 301
+integer values describing the version of VM and compiler. e.g. for Squirrel 3.0.1 this value will be 301
 
 .. js:data:: _version_
 
@@ -153,7 +152,7 @@ converts the number to string and returns it
 
 .. js:function:: integer.tointeger()
 
-returns the value of the integer(dummy function)
+dummy function; returns the value of the integer.
 
 
 .. js:function:: integer.tochar()
@@ -163,7 +162,7 @@ returns a string containing a single character represented by the integer.
 
 .. js:function:: integer.weakref()
 
-dummy function, returns the integer itself.
+dummy function; returns the integer itself.
 
 ^^^^^
 Float
@@ -191,7 +190,7 @@ returns a string containing a single character represented by the integer part o
 
 .. js:function:: float.weakref()
 
-dummy function, returns the float itself.
+dummy function; returns the float itself.
 
 ^^^^
 Bool
@@ -209,12 +208,12 @@ returns 1 for true 0 for false
 
 .. js:function:: bool.tostring()
 
-returns "true" for true "false" for false
+returns "true" for true and "false" for false
 
 
 .. js:function:: bool.weakref()
 
-dummy function, returns the bool itself.
+dummy function; returns the bool itself.
 
 ^^^^^^
 String
@@ -227,7 +226,7 @@ returns the string length
 
 .. js:function:: string.tointeger([base])
 
-converts the string to integer and returns it.An optional parameter base can be specified, if a base is not specified it defaults to base 10
+Converts the string to integer and returns it. An optional parameter base can be specified--if a base is not specified, it defaults to base 10.
 
 
 .. js:function:: string.tofloat()
@@ -237,7 +236,7 @@ converts the string to float and returns it
 
 .. js:function:: string.tostring()
 
-returns the string(dummy function)
+returns the string (really, a dummy function)
 
 
 .. js:function:: string.slice(start,[end])
@@ -247,7 +246,7 @@ returns a section of the string as new string. Copies from start to the end (not
 
 .. js:function:: string.find(substr,[startidx])
 
-search a sub string(substr) starting from the index startidx and returns the index of its first occurrence. If startidx is omitted the search operation starts from the beginning of the string. The function returns null if substr is not found.
+Searches a sub string (substr) starting from the index startidx and returns the index of its first occurrence. If startidx is omitted the search operation starts from the beginning of the string. The function returns null if substr is not found.
 
 
 .. js:function:: string.tolower()
@@ -280,12 +279,12 @@ tries to get a value from the slot 'key' without employing delegation
 
 .. js:function:: table.rawset(key,val)
 
-sets the slot 'key' with the value 'val' without employing delegation. If the slot does not exists , it will be created.
+Sets the slot 'key' with the value 'val' without employing delegation. If the slot does not exists, it will be created.
 
 
 .. js:function:: table.rawdelete()
 
-deletes the slot key without employing delegation and returns his value. if the slo does not exists returns always null.
+Deletes the slot key without employing delegation and returns its value. If the slot does not exists, returns null.
 
 
 .. js:function:: table.rawin(key)
@@ -300,17 +299,17 @@ returns a weak reference to the object.
 
 .. js:function:: table.tostring()
 
-tries to invoke the _tostring metamethod, if failed. returns "(table : pointer)".
+Tries to invoke the _tostring metamethod. If that fails, it returns "(table : pointer)".
 
 
 .. js:function:: table.clear()
 
-removes all the slot from the table
+removes all the slots from the table
 
 
 .. js:function:: table.setdelegate(table)
 
-sets the delegate of the table, to remove a delegate 'null' must be passed to the function. The function returns the table itself (eg. a.setdelegate(b) in this case 'a' is the return value).
+Sets the delegate of the table. To remove a delegate, 'null' must be passed to the function. The function returns the table itself (e.g. a.setdelegate(b) -- in this case 'a' is the return value).
 
 
 .. js:function:: table.getdelegate()
@@ -363,12 +362,12 @@ removes the value at the position 'idx' in the array
 
 .. js:function:: array.resize(size,[fill])
 
-resizes the array, if the optional parameter fill is specified its value will be used to fill the new array's slots (if the size specified is bigger than the previous size). If the fill parameter is omitted null is used instead.
+Resizes the array. If the optional parameter 'fill' is specified, its value will be used to fill the new array's slots when the size specified is bigger than the previous size. If the fill parameter is omitted, null is used instead.
 
 
 .. js:function:: array.sort([compare_func])
 
-sorts the array. A custom compare function can be optionally passed. The function prototype as to be the following.::
+Sorts the array. A custom compare function can be optionally passed. The function prototype as to be the following.::
 
     function custom_compare(a,b)
     {
@@ -390,7 +389,7 @@ reverse the elements of the array in place
 
 .. js:function:: array.slice(start,[end])
 
-returns a section of the array as new array. Copies from start to the end (not included). If start is negative the index is calculated as length + start, if end is negative the index is calculated as length + end. If end is omitted end is equal to the array length.
+Returns a section of the array as new array. Copies from start to the end (not included). If start is negative the index is calculated as length + start, if end is negative the index is calculated as length + end. If end is omitted end is equal to the array length.
 
 
 .. js:function:: array.weakref()
@@ -410,7 +409,7 @@ removes all the items from the array
 
 .. js:function:: array.map(func(a))
 
-creates a new array of the same size. for each element in the original array invokes the function 'func' and assigns the return value of the function to the corresponding element of the newly created array.
+Creates a new array of the same size. For each element in the original array invokes the function 'func' and assigns the return value of the function to the corresponding element of the newly created array.
 
 
 .. js:function:: array.apply(func(a))
@@ -436,52 +435,52 @@ Performs a linear search for the value in the array. Returns the index of the va
 Function
 ^^^^^^^^
 
-.. js:function:: array.call(_this,args...)
+.. js:function:: function.call(_this,args...)
 
 calls the function with the specified environment object('this') and parameters
 
 
-.. js:function:: array.pcall(_this,args...)
+.. js:function:: function.pcall(_this,args...)
 
 calls the function with the specified environment object('this') and parameters, this function will not invoke the error callback in case of failure(pcall stays for 'protected call')
 
 
-.. js:function:: array.acall(array_args)
+.. js:function:: function.acall(array_args)
 
 calls the function with the specified environment object('this') and parameters. The function accepts an array containing the parameters that will be passed to the called function.Where array_args has to contain the required 'this' object at the [0] position.
 
 
-.. js:function:: array.pacall(array_args)
+.. js:function:: function.pacall(array_args)
 
 calls the function with the specified environment object('this') and parameters. The function accepts an array containing the parameters that will be passed to the called function.Where array_args has to contain the required 'this' object at the [0] position. This function will not invoke the error callback in case of failure(pacall stays for 'protected array call')
 
 
-.. js:function:: array.weakref()
+.. js:function:: function.weakref()
 
 returns a weak reference to the object.
 
 
-.. js:function:: array.tostring()
+.. js:function:: function.tostring()
 
 returns the string "(closure : pointer)".
 
 
-.. js:function:: array.setroot(table)
+.. js:function:: function.setroot(table)
 
 sets the root table of a closure
 
 
-.. js:function:: array.getroot()
+.. js:function:: function.getroot()
 
 returns the root table of the closure
 
 
-.. js:function:: array.bindenv(env)
+.. js:function:: function.bindenv(env)
 
 clones the function(aka closure) and bind the environment object to it(table,class or instance). the this parameter of the newly create function will always be set to env. Note that the created function holds a weak reference to its environment object so cannot be used to control its lifetime.
 
 
-.. js:function:: array.getinfos()
+.. js:function:: function.getinfos()
 
 returns a table containing informations about the function, like parameters, name and source name; ::
 

+ 42 - 37
doc/source/reference/language/datatypes.rst

@@ -4,10 +4,11 @@
 Values and Data types
 =====================
 
-Squirrel is a dynamically typed language so variables do not have a type, although they
-refer to a value that does have a type.
-Squirrel basic types are integer, float, string, null, table, array, function, generator,
-class, instance, bool, thread and userdata.
+While Squirrel is a dynamically typed language and variables do not
+have a type, different operations may interpret the variable as
+containing a type.  Squirrel's basic types are integer, float, string,
+null, table, array, function, generator, class, instance, bool, thread
+and userdata.
 
 .. _userdata-index:
 
@@ -15,7 +16,7 @@ class, instance, bool, thread and userdata.
 Integer
 --------
 
-An Integer represents a 32 bits (or better) signed number.::
+An Integer represents a 32 bit (or better) signed number.::
 
     local a = 123 //decimal
     local b = 0x0012 //hexadecimal
@@ -26,7 +27,7 @@ An Integer represents a 32 bits (or better) signed number.::
 Float
 --------
 
-A float represents a 32 bits (or better) floating point number.::
+A float represents a 32 bit (or better) floating point number.::
 
     local a=1.0
     local b=0.234
@@ -35,24 +36,27 @@ A float represents a 32 bits (or better) floating point number.::
 String
 --------
 
-Strings are an immutable sequence of characters to modify a string is necessary create a new one.
+Strings are an immutable sequence of characters. In order to modify a
+string is it necessary create a new one.
 
-Squirrel's strings, behave like C or C++, are delimited by quotation marks(``"``) and can contain
-escape sequences(``\t``, ``\a``, ``\b``, ``\n``, ``\r``, ``\v``, ``\f``, ``\\``, ``\"``, ``\'``, ``\0``,
-``\x<hh>``, ``\u<hhhh>`` and ``\U<hhhhhhhh>``).
+Squirrel's strings are similar to strings in C or C++.  They are
+delimited by quotation marks(``"``) and can contain escape
+sequences (``\t``, ``\a``, ``\b``, ``\n``, ``\r``, ``\v``, ``\f``,
+``\\``, ``\"``, ``\'``, ``\0``, ``\x<hh>``, ``\u<hhhh>`` and
+``\U<hhhhhhhh>``).
 
-Verbatim string literals begin with ``@"`` and end with the matching quote.
-Verbatim string literals also can extend over a line break. If they do, they
-include any white space characters between the quotes: ::
+Verbatim string literals do not interpret escape sequences. They begin
+with ``@"`` and end with the matching quote.  Verbatim string literals
+also can extend over a line break. If they do, they include any white
+space characters between the quotes: ::
 
     local a = "I'm a wonderful string\n"
     // has a newline at the end of the string
     local x = @"I'm a verbatim string\n"
-    // the \n is copied in the string same as \\n in a regular string "I'm a verbatim string\n"
+    // the \n is literal, similar to "\\n" in a regular string.
 
-The only exception to the "no escape sequence" rule for verbatim
-string literals is that you can put a double quotation mark inside a
-verbatim string by doubling it: ::
+However, a doubled quotation mark within a verbatim string is replaced
+by a single quotation mark: ::
 
     local multiline = @"
         this is a multiline string
@@ -73,7 +77,7 @@ reference. The type Null has exactly one value, called null.::
 Bool
 --------
 
-the bool data type can have only two. They are the literals ``true``
+Bool is a double-valued (Boolean) data type. Its literals are ``true``
 and ``false``. A bool value expresses the validity of a condition
 (tells whether the condition is true or false).::
 
@@ -83,7 +87,8 @@ and ``false``. A bool value expresses the validity of a condition
 Table
 --------
 
-Tables are associative containers implemented as pairs of key/value (called a slot).::
+Tables are associative containers implemented as a set of key/value pairs
+called slots.::
 
     local t={}
     local test=
@@ -96,7 +101,7 @@ Tables are associative containers implemented as pairs of key/value (called a sl
 Array
 --------
 
-Arrays are simple sequence of objects, their size is dynamic and their index starts always from 0.::
+Arrays are simple sequence of objects. Their size is dynamic and their index always starts from 0.::
 
     local a  = ["I'm","an","array"]
     local b = [null]
@@ -106,46 +111,48 @@ Arrays are simple sequence of objects, their size is dynamic and their index sta
 Function
 --------
 
-Functions are similar to those in other C-like languages and to most programming
-languages in general, however there are a few key differences (see below).
+Functions are similar to those in other C-like languages with a few key differences (see below).
 
 --------
 Class
 --------
 
-Classes are associative containers implemented as pairs of key/value. Classes are created through
-a 'class expression' or a 'class statement'. class members can be inherited from another class object
-at creation time. After creation members can be added until a instance of the class is created.
+Classes are associative containers implemented as sets of key/value
+pairs. Classes are created through a 'class expression' or a 'class
+statement'. class members can be inherited from another class object
+at creation time. After creation, members can be added until an
+instance of the class is created.
 
 --------------
 Class Instance
 --------------
 
-Class instances are created by calling a *class object*. Instances, as tables, are
-implemented as pair of key/value. Instances members cannot be dynamically added or removed; however the value of the members can be changed.
-
-
+Class instances are created by calling a *class object*. Instances, as
+tables, are implemented as sets of key/value pairs. Instance members
+cannot be dynamically added or removed; however the value of the
+members can be changed.
 
 ---------
 Generator
 ---------
 
-Generators are functions that can be suspended with the statement 'yield' and resumed
-later (see :ref:`Generators <generators>`).
+Generators are functions that can be suspended with the statement
+'yield' and resumed later (see :ref:`Generators <generators>`).
 
 ---------
 Userdata
 ---------
 
-Userdata objects are blobs of memory(or pointers) defined by the host application but
-stored into Squirrel variables (See :ref:`Userdata and UserPointers <embedding_userdata_and_userpointers>`).
-
+Userdata objects are blobs of memory or pointers defined by the host
+application but stored within Squirrel variables (See :ref:`Userdata
+and UserPointers <embedding_userdata_and_userpointers>`).
 
 ---------
 Thread
 ---------
 
-Threads are objects that represents a cooperative thread of execution, also known as coroutines.
+Threads are objects representing a cooperative thread of execution,
+also known as coroutines.
 
 --------------
 Weak Reference
@@ -153,5 +160,3 @@ Weak Reference
 
 Weak References are objects that point to another (non-scalar) object but do not own a strong reference to it.
 (See :ref:`Weak References <weak_references>`).
-
-

+ 2 - 2
doc/source/reference/language/expressions.rst

@@ -243,7 +243,7 @@ Operators precedence
 +---------------------------------------+-----------+
 | ``<<, >>, >>>``                       |           |
 +---------------------------------------+-----------+
-| ``<, <=, >, >=``                      |           |
+| ``<, <=, >, >=, instanceof``          |           |
 +---------------------------------------+-----------+
 | ``==, !=, <=>``                       |           |
 +---------------------------------------+-----------+
@@ -253,7 +253,7 @@ Operators precedence
 +---------------------------------------+-----------+
 | ``&&, in``                            |           |
 +---------------------------------------+-----------+
-| ``+=, =, -=``                         | ...       |
+| ``+=, =, -=, /=, *=, %=``             | ...       |
 +---------------------------------------+-----------+
 | ``, (comma operator)``                | lowest    |
 +---------------------------------------+-----------+

+ 21 - 9
doc/source/reference/language/functions.rst

@@ -140,19 +140,31 @@ Function calls
 The expression is evaluated in this order: derefexp after the explist (arguments) and at
 the end the call.
 
-Every function call in Squirrel passes the environment object *this* as hidden parameter
-to the called function. The 'this' parameter is the object where the function was indexed
-from.
+A function call in Squirrel passes the current environment object *this* as a hidden parameter.
+But when the function was immediately indexed from an object, *this* shall be the object
+which was indexed, instead.
 
-If we call a function with this syntax::
+If we call a function with the syntax::
 
-    table.foo(a)
+    mytable.foo(x,y)
 
-the environment object passed to foo will be 'table'::
+the environment object passed to 'foo' as *this* will be 'mytable' (since 'foo' was immediately indexed from 'mytable')
 
-    foo(x,y) // equivalent to this.foo(x,y)
+Whereas with the syntax::
 
-The environment object will be *this* (the same of the caller function).
+    foo(x,y) // implicitly equivalent to this.foo(x,y)
+
+the environment object will be the current *this* (that is, propagated from the caller's *this*).
+
+It may help to remember the rules in the following way:
+
+    foo(x,y) ---> this.foo(x,y)
+    table.foo(x,y) ---> call foo with (table,x,y)
+
+It may also help to consider why it works this way: it's designed to assist with object-oriented style.
+When calling 'foo(x,y)' it's assumed you're calling another member of the object (or of the file) and
+so should operate on the same object.
+When calling 'mytable.foo(x,y)' it's written plainly that you're calling a member of a different object.
 
 ---------------------------------------------
 Binding an environment to a function
@@ -184,7 +196,7 @@ Lambda Expressions
 
     exp := '@' '(' paramlist ')' exp
 
-Lambda expressions are a synctactic sugar to quickly define a function that consists of a single expression.
+Lambda expressions are a syntactic sugar to quickly define a function that consists of a single expression.
 This feature comes handy when functional programming patterns are applied, like map/reduce or passing a compare method to
 array.sort().
 

+ 12 - 14
doc/source/reference/language/lexical_structure.rst

@@ -13,11 +13,11 @@ Identifiers
 
 .. index:: single: identifiers
 
-Identifiers start with a alphabetic character or '_' followed by any number of alphabetic
-characters, '_' or digits ([0-9]). Squirrel is a case sensitive language, this means that the
-lowercase and uppercase representation of the same alphabetic character are considered
-different characters. For instance "foo", "Foo" and "fOo" will be treated as 3 distinct
-identifiers.
+Identifiers start with an alphabetic character or the symbol '_' followed by any number
+of alphabetic characters, '_' or digits ([0-9]). Squirrel is a case sensitive language
+meaning that the lowercase and uppercase representation of the same alphabetic
+character are considered different characters. For instance, "foo", "Foo" and "fOo" are
+treated as 3 distinct identifiers.
 
 -----------
 Keywords
@@ -25,7 +25,7 @@ Keywords
 
 .. index:: single: keywords
 
-The following words are reserved words by the language and cannot be used as identifiers:
+The following words are reserved and cannot be used as identifiers:
 
 +------------+------------+-----------+------------+------------+-------------+
 | base       | break      | case      | catch      | class      | clone       |
@@ -69,7 +69,7 @@ Other tokens
     single: delimiters
     single: other tokens
 
-Other used tokens are:
+Other significant tokens are:
 
 +----------+----------+----------+----------+----------+----------+
 | ``{``    | ``}``    | ``[``    | ``]``    | ``.``    | ``:``    |
@@ -86,7 +86,7 @@ Literals
     single: string literals
     single: numeric literals
 
-Squirrel accepts integer numbers, floating point numbers and strings literals.
+Squirrel accepts integer numbers, floating point numbers and string literals.
 
 +-------------------------------+------------------------------------------+
 | ``34``                        | Integer number(base 10)                  |
@@ -131,7 +131,7 @@ A comment is text that the compiler ignores but that is useful for programmers.
 Comments are normally used to embed annotations in the code. The compiler
 treats them as white space.
 
-The ``/*`` (slash, asterisk) characters, followed by any
+A comment can be ``/*`` (slash, asterisk) characters, followed by any
 sequence of characters (including new lines),
 followed by the ``*/`` characters. This syntax is the same as ANSI C.::
 
@@ -141,9 +141,9 @@ followed by the ``*/`` characters. This syntax is the same as ANSI C.::
     this lines will be ignored by the compiler
     */
 
-The ``//`` (two slashes) characters, followed by any sequence of characters.
-A new line not immediately preceded by a backslash terminates this form of comment.
-It is commonly called a *"single-line comment."*::
+A comment can also be ``//`` (two slashes) characters, followed by any sequence of
+characters.  A new line not immediately preceded by a backslash terminates this form of
+comment.  It is commonly called a *"single-line comment."*::
 
     //this is a single line comment. this line will be ignored by the compiler
 
@@ -152,5 +152,3 @@ The character ``#`` is an alternative syntax for single line comment.::
     # this is also a single line comment.
 
 This to facilitate the use of squirrel in UNIX-style shell scripts.
-
-

+ 4 - 4
doc/source/reference/language/metamethods.rst

@@ -226,7 +226,7 @@ _nexti
 
     _nexti(previdx)
 
-invoked when a userdata or class instance is iterated by a foreach loop
+invoked when a userdata or class instance is iterated by a foreach loop.
 
 If previdx==null it means that it is the first iteration.
 The function has to return the index of the 'next' value.
@@ -237,10 +237,10 @@ _tostring
 
 ::
 
-    _tostring(previdx)
+    _tostring()
 
-invoked when during string concatenation or when the ``print`` function prints a table, instance, or userdata.
-The method is also invoked by the sq_tostring() API
+Invoked when during string concatenation or when the ``print`` function prints a table, instance, or userdata.
+The method is also invoked by the sq_tostring() API.
 
 Must return a string representation of the object.
 

+ 4 - 4
doc/source/stdlib/stdstringlib.rst

@@ -17,7 +17,7 @@ Global Symbols
 .. js:function:: endswith(str, cmp)
 
     returns `true` if the end of the string `str`  matches a the string `cmp` otherwise returns `false`
-	
+
 .. js:function:: escape(str)
 
     Returns a string with backslashes before characters that need to be escaped(`\",\a,\b,\t,\n,\v,\f,\r,\\,\",\',\0,\xnn`).
@@ -66,7 +66,7 @@ Global Symbols
 .. js:function:: startswith(str, cmp)
 
     returns `true` if the beginning of the string `str` matches the string `cmp`; otherwise returns `false`
-	
+
 .. js:function:: strip(str)
 
     Strips white-space-only characters that might appear at the beginning or end of the given string and returns the new stripped string.
@@ -158,9 +158,9 @@ The regexp class
 +---------------------+--------------------------------------+
 |      `\\C`          |  non control characters              |
 +---------------------+--------------------------------------+
-|      `\\p`          |  punctuation                          |
+|      `\\p`          |  punctuation                         |
 +---------------------+--------------------------------------+
-|      `\\P`          |  non punctuation                      |
+|      `\\P`          |  non punctuation                     |
 +---------------------+--------------------------------------+
 |      `\\b`          |  word boundary                       |
 +---------------------+--------------------------------------+

+ 6 - 2
include/squirrel.h

@@ -22,6 +22,10 @@ THE SOFTWARE.
 #ifndef _SQUIRREL_H_
 #define _SQUIRREL_H_
 
+#ifdef _SQ_CONFIG_INCLUDE
+#include _SQ_CONFIG_INCLUDE
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -394,9 +398,9 @@ SQUIRREL_API void sq_setnativedebughook(HSQUIRRELVM v,SQDEBUGHOOK hook);
 #define SQ_SUCCEEDED(res) (res>=0)
 
 #ifdef __GNUC__
-# define SQ_UNUSED_ARG(x) __attribute__((unused)) x
+# define SQ_UNUSED_ARG(x) x __attribute__((__unused__))
 #else
-# define SQ_UNUSED_ARG(x)
+# define SQ_UNUSED_ARG(x) x
 #endif
 
 #ifdef __cplusplus

+ 3 - 3
sqstdlib/sqstdio.cpp

@@ -399,9 +399,9 @@ SQRESULT sqstd_loadfile(HSQUIRRELVM v,const SQChar *filename,SQBool printerror)
 
 SQRESULT sqstd_dofile(HSQUIRRELVM v,const SQChar *filename,SQBool retval,SQBool printerror)
 {
-    //at least one entry must exist in order for us to push it as the environment
-    if(sq_gettop(v) == 0)
-        return sq_throwerror(v,_SC("environment table expected"));	
+    //at least one entry must exist in order for us to push it as the environment
+    if(sq_gettop(v) == 0)
+        return sq_throwerror(v,_SC("environment table expected"));
 
     if(SQ_SUCCEEDED(sqstd_loadfile(v,filename,printerror))) {
         sq_push(v,-2);

+ 1 - 1
sqstdlib/sqstdrex.cpp

@@ -155,7 +155,7 @@ static SQInteger sqstd_rex_charnode(SQRex *exp,SQBool isclass)
                 }
             case 0:
                 sqstd_rex_error(exp,_SC("letter expected for argument of escape sequence"));
-                break;                
+                break;
             case 'b':
             case 'B':
                 if(!isclass) {

+ 5 - 2
sqstdlib/sqstdstring.cpp

@@ -69,7 +69,10 @@ SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen
     const SQChar *format;
     SQChar *dest;
     SQChar fmt[MAX_FORMAT_LEN];
-    sq_getstring(v,nformatstringidx,&format);
+    const SQRESULT res = sq_getstring(v,nformatstringidx,&format);
+    if (SQ_FAILED(res)) {
+        return res; // propagate the error
+    }
     SQInteger format_size = sq_getsize(v,nformatstringidx);
     SQInteger allocated = (format_size+2)*sizeof(SQChar);
     dest = sq_getscratchpad(v,allocated);
@@ -156,7 +159,7 @@ static SQInteger _string_printf(HSQUIRRELVM v)
     SQInteger length = 0;
     if(SQ_FAILED(sqstd_format(v,2,&length,&dest)))
         return -1;
-    
+
     SQPRINTFUNCTION printfunc = sq_getprintfunc(v);
     if(printfunc) printfunc(v,dest);
 

+ 10 - 2
squirrel/sqapi.cpp

@@ -657,6 +657,10 @@ SQRESULT sq_getinteger(HSQUIRRELVM v,SQInteger idx,SQInteger *i)
         *i = tointeger(o);
         return SQ_OK;
     }
+    if(sq_isbool(o)) {
+        *i = SQVM::IsFalse(o)?SQFalse:SQTrue;
+        return SQ_OK;
+    }
     return SQ_ERROR;
 }
 
@@ -967,7 +971,11 @@ SQRESULT sq_setdelegate(HSQUIRRELVM v,SQInteger idx)
     switch(type) {
     case OT_TABLE:
         if(type(mt) == OT_TABLE) {
-            if(!_table(self)->SetDelegate(_table(mt))) return sq_throwerror(v, _SC("delagate cycle")); v->Pop();}
+            if(!_table(self)->SetDelegate(_table(mt))) {
+                return sq_throwerror(v, _SC("delagate cycle"));
+            }
+            v->Pop();
+        }
         else if(type(mt)==OT_NULL) {
             _table(self)->SetDelegate(NULL); v->Pop(); }
         else return sq_aux_invalidtype(v,type);
@@ -1239,7 +1247,7 @@ SQRESULT sq_writeclosure(HSQUIRRELVM v,SQWRITEFUNC w,SQUserPointer up)
     _GETSAFE_OBJ(v, -1, OT_CLOSURE,o);
     unsigned short tag = SQ_BYTECODE_STREAM_TAG;
     if(_closure(*o)->_function->_noutervalues)
-        return sq_throwerror(v,_SC("a closure with free valiables bound it cannot be serialized"));
+        return sq_throwerror(v,_SC("a closure with free variables bound cannot be serialized"));
     if(w(up,&tag,2) != 2)
         return sq_throwerror(v,_SC("io error"));
     if(!_closure(*o)->Save(v,up,w))

+ 8 - 3
squirrel/sqcompiler.cpp

@@ -859,6 +859,7 @@ public:
         case TK_TYPEOF : Lex() ;UnaryOP(_OP_TYPEOF); break;
         case TK_RESUME : Lex(); UnaryOP(_OP_RESUME); break;
         case TK_CLONE : Lex(); UnaryOP(_OP_CLONE); break;
+        case TK_RAWCALL: Lex(); Expect('('); FunctionCallArgs(true); break;
         case TK_MINUSMINUS :
         case TK_PLUSPLUS :PrefixIncDec(_token); break;
         case TK_DELETE : DeleteExpr(); break;
@@ -915,7 +916,7 @@ public:
         }
         return (!_es.donot_get || ( _es.donot_get && (_token == _SC('.') || _token == _SC('['))));
     }
-    void FunctionCallArgs()
+    void FunctionCallArgs(bool rawcall = false)
     {
         SQInteger nargs = 1;//this
          while(_token != _SC(')')) {
@@ -928,6 +929,10 @@ public:
              }
          }
          Lex();
+         if (rawcall) {
+             if (nargs < 3) Error(_SC("rawcall requires at least 2 parameters (callee and this)"));
+             nargs -= 2; //removes callee and this from count
+         }
          for(SQInteger i = 0; i < (nargs - 1); i++) _fs->PopTarget();
          SQInteger stackbase = _fs->PopTarget();
          SQInteger closure = _fs->PopTarget();
@@ -1337,11 +1342,11 @@ public:
                     val._unVal.fFloat = -_lex._fvalue;
                 break;
                 default:
-                    Error(_SC("scalar expected : integer,float"));
+                    Error(_SC("scalar expected : integer, float"));
                 }
                 break;
             default:
-                Error(_SC("scalar expected : integer,float or string"));
+                Error(_SC("scalar expected : integer, float, or string"));
         }
         Lex();
         return val;

+ 1 - 0
squirrel/sqcompiler.h

@@ -70,6 +70,7 @@ struct SQVM;
 #define TK_STATIC 322
 #define TK_ENUM 323
 #define TK_CONST 324
+#define TK_RAWCALL 325
 
 
 

+ 2 - 0
squirrel/sqlexer.cpp

@@ -67,6 +67,8 @@ void SQLexer::Init(SQSharedState *ss, SQLEXREADFUNC rg, SQUserPointer up,Compile
     ADD_KEYWORD(const,TK_CONST);
     ADD_KEYWORD(__LINE__,TK___LINE__);
     ADD_KEYWORD(__FILE__,TK___FILE__);
+    ADD_KEYWORD(rawcall, TK_RAWCALL);
+
 
     _readf = rg;
     _up = up;