tprep.nim 525 B

12345678910111213141516171819202122232425262728293031
  1. # Test the features that used to belong to the preprocessor
  2. import
  3. times
  4. #{.warning: "This is only a test warning!".}
  5. const
  6. case2 = true
  7. case3 = true
  8. when defined(case1):
  9. {.hint: "Case 1".}
  10. when case3:
  11. {.hint: "Case 1.3".}
  12. elif case2:
  13. {.hint: "Case 2".}
  14. when case3:
  15. {.hint: "Case 2.3".}
  16. elif case3:
  17. {.hint: "Case 3".}
  18. else:
  19. {.hint: "unknown case".}
  20. var
  21. s: string
  22. write(stdout, "compiled at " & system.CompileDate &
  23. " " & CompileTime & "\n")
  24. echo getDateStr()
  25. echo getClockStr()