implemented 'emit' pragma
This commit is contained in:
parent
1e25aa365b
commit
e008630838
10 changed files with 108 additions and 74 deletions
|
|
@ -19,6 +19,7 @@ tconstr2.nim;69
|
|||
tcontinuexc.nim;ECcaught
|
||||
tcopy.nim;TEMP=C:\Programs\xyz\bin
|
||||
tcurrncy.nim;25
|
||||
temit.nim;509
|
||||
texcsub.nim;caught!
|
||||
texplicitgeneric1.nim;Key: 12 value: 12Key: 13 value: 13 Key: A value: 12 Key: B value: 13
|
||||
tfinally.nim;came here 3
|
||||
|
|
|
|||
|
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