summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xdoc/manual.txt2
-rwxr-xr-xdoc/nimrodc.txt43
-rwxr-xr-xtodo.txt2
3 files changed, 45 insertions, 2 deletions
diff --git a/doc/manual.txt b/doc/manual.txt
index c1b0c0b4a..4aed263cc 100755
--- a/doc/manual.txt
+++ b/doc/manual.txt
@@ -1885,7 +1885,7 @@ Overloading of the subscript operator
 

 The ``[]`` subscript operator for arrays/openarrays/sequences can be overloaded.

 Overloading support is only possible if the first parameter has no type that

-already supports the built-in ``[]`` notation. Currently the compiler currently

+already supports the built-in ``[]`` notation. Currently the compiler 

 does not check this. XXX Multiple indexes

 

 

diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt
index 7fada6584..0a0781e36 100755
--- a/doc/nimrodc.txt
+++ b/doc/nimrodc.txt
@@ -130,6 +130,49 @@ encloses the header file in ``""`` in the generated C code.
 

 **Note**: This will not work for the LLVM backend.

 

+
+Compile pragma
+--------------
+The `compile`:idx: pragma can be used to compile and link a C/C++ source file 
+with the project: 
+
+.. code-block:: Nimrod

+  {.compile: "myfile.cpp".}
+
+**Note**: Nimrod computes a CRC checksum and only recompiles the file if it 
+has changed. You can use the ``-f`` command line option to force recompilation
+of the file.
+
+
+Link pragma
+-----------
+The `link`:idx: pragma can be used to link an additional file with the project: 
+
+.. code-block:: Nimrod

+  {.link: "myfile.o".}
+
+
+Emit pragma
+-----------
+The `emit`:idx: pragma can be used to directly affect the output of the 
+compiler's code generator. So it makes your code unportable to other code
+generators/backends. Its usage is highly discouraged! However, it can be
+extremely useful for interfacing with C++ or Objective C code.
+
+Example:
+
+.. code-block:: Nimrod

+  {.emit: """
+  static int cvariable = 420;
+  """.}
+
+  proc embedsC() {.pure.} = 
+    var nimrodVar = 89
+    # use backticks to access Nimrod symbols within an emit section:
+    {.emit: """fprintf(stdout, "%d\n", cvariable + (int)`nimrodVar`);""".}
+
+  embedsC()
+
 

 LineDir option

 --------------

diff --git a/todo.txt b/todo.txt
index f5de17517..d6036db49 100755
--- a/todo.txt
+++ b/todo.txt
@@ -1,6 +1,6 @@
 - we need a way to disable tests
 - {.extern: "thisfile.m".} pragma for objective C/C++ support
-- deprecate ^ and make it awailable as operator
+- deprecate ^ and make it available as operator
 
 
 High priority (version 0.9.0)