summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJuan Carlos <juancarlospaco@gmail.com>2019-10-17 06:39:01 -0300
committerAndreas Rumpf <rumpf_a@web.de>2019-10-17 11:39:01 +0200
commit4d1f69c7d253ad9dbe9681062eb650acc9ff5d22 (patch)
tree64dc1eafa8d702f5816eecf8073d3e1888f6747e
parent2cfd58de48668d4827c86d70f1ee6d5872f7c654 (diff)
downloadNim-4d1f69c7d253ad9dbe9681062eb650acc9ff5d22.tar.gz
Fixes #10824 (#12437)
-rw-r--r--doc/manual.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/manual.rst b/doc/manual.rst
index b8c976edb..e1c650a93 100644
--- a/doc/manual.rst
+++ b/doc/manual.rst
@@ -6224,6 +6224,25 @@ but are used to override the settings temporarily. Example:
   # ... some code ...
   {.pop.} # restore old settings
 
+`push/pop`:idx: can switch on/off some standard library pragmas, example:
+
+.. code-block:: nim
+  {.push inline.}
+  proc thisIsInlined(): int = 42
+  func willBeInlined(): float = 42.0
+  {.pop.}
+  proc notInlined(): int = 9
+
+  {.push discardable, boundChecks: off, compileTime, noSideEffect, experimental.}
+  template example(): string = "https://nim-lang.org"
+  {.pop.}
+
+  {.push deprecated, hint[LineTooLong]: off, used, stackTrace: off.}
+  proc sample(): bool = true
+  {.pop.}
+
+For third party pragmas it depends on its implementation, but uses the same syntax.
+
 
 register pragma
 ---------------