tstrformat.nim 324 B

123456789101112131415161718192021
  1. discard """
  2. output: '''verstuff'''
  3. cmd: "nim c --gc:arc $file"
  4. """
  5. # bug #13622
  6. import strformat
  7. template necho*(args: string) {.dirty.} =
  8. if getCurrentException() != nil:
  9. echo args
  10. else:
  11. stdout.writeLine(args)
  12. proc main(cond: bool; arg: string) =
  13. if cond:
  14. necho &"ver{arg}\n"
  15. main(true, "stuff")