tstrformat.nim 326 B

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