tnimscriptwithmacro.nims 282 B

1234567891011121314151617181920212223
  1. discard """
  2. cmd: "nim e $file"
  3. output: '''
  4. foobar
  5. nothing
  6. hallo
  7. """
  8. # this test ensures that the mode is resetted correctly to repr
  9. import macros
  10. macro foobar(): void =
  11. result = newCall(bindSym"echo", newLit("nothing"))
  12. echo "foobar"
  13. let x = 123
  14. foobar()
  15. exec "echo hallo"