示例#1
0
 // Used when we may need to register an error (for convenience like a macro)
 public void ASSERT_ERR(bool condition, CoreErrorType err_type, string msg = null)
 {
     if (condition)
     {
         push_err(err_type, msg);
     }
 }
示例#2
0
 public CoreError(CoreState state, TraceBack traceback, CoreErrorType type, string msg = null)
 {
     this.state     = state;
     this.traceback = traceback;
     this.type      = type;
     // Check if the error is fatal by checking the error type
     this.fatal = ((int)type) > 0;
     this.msg   = msg;
 }
示例#3
0
        // Push an error to the cores' error handler
        public void push_err(CoreErrorType err_type, string msg = null)
        {
            CoreError err = new CoreError(this.state, this.traceback, err_type, msg);

            // Register the error with the handler
            this.state.err_handler.register_err(err);
            this.state.had_err = true;
            throw new CoreErrException(err);
        }