debug.monkey2 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. Namespace monkey.debug
  2. Extern
  3. #rem monkeydoc @hidden
  4. #end
  5. Function DebugStop()="bbDB::stop"
  6. #rem monkeydoc @hidden
  7. #end
  8. Function RuntimeError( message:String )="bbDB::error"
  9. #rem monkeydoc Generates a runtime error if a boolean expression is false.
  10. @param condition The boolean condition to check.
  11. @param message Runtime error message to generate.
  12. #end
  13. Function Assert( condition:Bool,message:String="Assert failed" )="bbAssert"
  14. #rem monkeydoc Generates a runtime error if a boolean expression is false (Debug builds only).
  15. This function does not execute at all in release builds, so make sure that `condition` doesn't inadvertantly execute
  16. any critical code.
  17. @param condition The boolean condition to check.
  18. @param message Runtime error message to generate.
  19. #end
  20. Function DebugAssert( condition:Bool,message:String="Debug assert failed" )="bbDebugAssert"
  21. #rem monkeydoc Gets the current stack state (Debug builds only).
  22. In release mode, an empty array is returned.
  23. @example
  24. Namespace test
  25. Function Test2()
  26. Print "~n".Join( GetDebugStack() )
  27. End
  28. Function Test()
  29. Test2()
  30. End
  31. Function Main()
  32. Test()
  33. End
  34. @end
  35. @return A string array reprenting the current stack state.
  36. #end
  37. Function GetDebugStack:String[]()="bbDB::stack"