Merge branch 'master' of https://github.com/Araq/Nimrod into vm2

Conflicts:
	web/news.txt
This commit is contained in:
Araq 2013-12-23 01:23:16 +01:00
commit b76729df1c
35 changed files with 1047 additions and 269 deletions

View file

@ -8,6 +8,11 @@
.. contents::
.. raw:: html
<blockquote><p>
"yes, I'm the creator" -- Araq, 2013-07-26 19:28:32.
</p></blockquote>
Nimrod differs from many other compilers in that it is really fast,
and being so fast makes it suited to provide external queries for
text editors about the source code being written. Through the
@ -522,21 +527,6 @@ At the moment idetools support is still in development so the test
suite is not integrated with the main test suite and you have to
run it manually. First you have to compile the tester::
$ cd my/nimrod/checkout
$ nimrod c tests/tester.nim
Running the tester without parameters will display some options.
To run the caas test suite (and other special tests) you need to
use the `special` command. You need to run this command from the
root of the checkout or it won't be able to open the required files::
$ ./tests/tester special
However this is a roundabout way of running the test suite. You can
also compile and run ``tests/caasdriver.nim`` manually. In fact,
running it manually will allow you to specify special parameters
too. Example::
$ cd my/nimrod/checkout/tests
$ nimrod c caasdriver.nim

View file

@ -4708,7 +4708,11 @@ fatal pragma
------------
The `fatal`:idx: pragma is used to make the compiler output an error message
with the given content. In contrast to the ``error`` pragma, compilation
is guaranteed to be aborted by this pragma.
is guaranteed to be aborted by this pragma. Example:
.. code-block:: nimrod
when not defined(objc):
{.fatal: "Compile this program with the objc command!".}
warning pragma
--------------
@ -5053,6 +5057,18 @@ Note that this pragma is somewhat of a misnomer: Other backends will provide
the same feature under the same name.
Extern pragma
-------------
Like ``exportc`` or ``importc`` the `extern`:idx: pragma affects name
mangling. The string literal passed to ``extern`` can be a format string:
.. code-block:: Nimrod
proc p(s: string) {.extern: "prefix$1".} =
echo s
In the example the external name of ``p`` is set to ``prefixp``.
Bycopy pragma
-------------

View file

@ -468,6 +468,19 @@ proc is declared in the generated code:
proc myinterrupt() {.codegenDecl: "__interrupt $# $#$#".} =
echo "realistic interrupt handler"
InjectStmt pragma
-----------------
The `injectStmt`:idx: pragma can be used to inject a statement before every
other statement in the current module. It is only supposed to be used for
debugging:
.. code-block:: nimrod
{.injectStmt: gcInvariants().}
# ... complex code here that produces crashes ...
LineDir option