Compiler.bf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. namespace System
  2. {
  3. static class Compiler
  4. {
  5. [LinkName("#CallerLineNum")]
  6. public static extern int CallerLineNum;
  7. [LinkName("#CallerFilePath")]
  8. public static extern String CallerFilePath;
  9. [LinkName("#CallerFileName")]
  10. public static extern String CallerFileName;
  11. [LinkName("#CallerFileDir")]
  12. public static extern String CallerFileDir;
  13. [LinkName("#CallerMemberName")]
  14. public static extern String CallerMemberName;
  15. [LinkName("#CallerProject")]
  16. public static extern String CallerProject;
  17. [LinkName("#CallerExpression")]
  18. public static extern String[Int32.MaxValue] CallerExpression;
  19. [LinkName("#ProjectName")]
  20. public static extern String ProjectName;
  21. [LinkName("#ModuleName")]
  22. public static extern String ModuleName;
  23. [LinkName("#TimeLocal")]
  24. public static extern String TimeLocal;
  25. [LinkName("#IsConstEval")]
  26. public static extern bool IsConstEval;
  27. [LinkName("#IsBuilding")]
  28. public static extern bool IsBuilding;
  29. [LinkName("#IsReified")]
  30. public static extern bool IsReified;
  31. [LinkName("#CompileRev")]
  32. public static extern int32 CompileRev;
  33. [ConstEval]
  34. public static void Assert(bool cond)
  35. {
  36. if (!cond)
  37. Runtime.FatalError("Assert failed");
  38. }
  39. }
  40. }