summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/nimrodc.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt
index 339cee382..ae169829f 100644
--- a/doc/nimrodc.txt
+++ b/doc/nimrodc.txt
@@ -399,6 +399,21 @@ interfacing with libraries written in Objective C:
 The compiler needs to be told to generate Objective C (command ``objc``) for 

 this to work. The conditional symbol ``objc`` is defined when the compiler

 emits Objective C code.

+
+
+CodegenDecl pragma
+------------------
+
+The `codegenDecl`:idx: pragma can be used to directly influence Nimrod's code
+generator. It receives a format string that determines how the variable or 
+proc is declared in the generated code:
+
+.. code-block:: nimrod
+  var
+    a {.codegenDecl: "$# progmem $#".}: int
+
+  proc myinterrupt() {.codegenDecl: "__interrupt $# $#$#".} =
+    echo "realistic interrupt handler"
 

 

 LineDir option