From b0134309292e41a9b29777b5bdd79f2a1278a03d Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 17 Dec 2016 14:20:57 +0100 Subject: reworked emit pragma; fixes #4730 --- doc/manual/pragmas.txt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/manual/pragmas.txt b/doc/manual/pragmas.txt index a19f41a34..2a276c2e7 100644 --- a/doc/manual/pragmas.txt +++ b/doc/manual/pragmas.txt @@ -26,9 +26,6 @@ It can also be used as a statement, in that case it takes a list of *renamings*. Stream = ref object {.deprecated: [TFile: File, PStream: Stream].} -The ``nimfix`` tool can be used to, without effort, automatically update your -code and refactor it by performing these renamings. - noSideEffect pragma ------------------- @@ -678,14 +675,15 @@ Example: {.push stackTrace:off.} proc embedsC() = var nimVar = 89 - # use backticks to access Nim symbols within an emit section: - {.emit: """fprintf(stdout, "%d\n", cvariable + (int)`nimVar`);""".} + # access Nim symbols within an emit section outside of string literals: + {.emit: ["""fprintf(stdout, "%d\n", cvariable + (int)""", nimVar, ");"].} {.pop.} embedsC() -As can be seen from the example, to Nim symbols can be referred via backticks. -Use two backticks to produce a single verbatim backtick. +For backwards compatibility, if the argument to the ``emit`` statement +is a single string literal, Nim symbols can be referred to via backticks. +This usage is however deprecated. For a toplevel emit statement the section where in the generated C/C++ file the code should be emitted can be influenced via the -- cgit 1.4.1-2-gfad0 f9f28ca05e15d4df3836'>diff stats
path: root/src/lcurses/Makefile
blob: 3214fcb27e0df827abe011bd5f4b40d973b02ad5 (plain) (blame)
1