implemented 'emit' pragma
This commit is contained in:
parent
1e25aa365b
commit
e008630838
10 changed files with 108 additions and 74 deletions
14
tests/accept/run/temit.nim
Normal file
14
tests/accept/run/temit.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Test the new ``emit`` pragma:
|
||||
|
||||
{.emit: """
|
||||
static int cvariable = 420;
|
||||
|
||||
""".}
|
||||
|
||||
proc embedsC() {.pure.} =
|
||||
var nimrodVar = 89
|
||||
{.emit: """fprintf(stdout, "%d\n", cvariable + (int)`nimrodVar`);""".}
|
||||
|
||||
embedsC()
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue