implemented 'emit' pragma

This commit is contained in:
Araq 2011-01-07 00:17:18 +01:00
commit e008630838
10 changed files with 108 additions and 74 deletions

View 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()