diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-08-27 10:23:50 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 18:20:06 +0900 |
| commit | 7e3d22f09569b920c8e3dd31d7a0d03e925a06cc (patch) | |
| tree | 4f54ca9134b50e597ba0f32a7cdf1f72fd7beecc /src | |
| parent | 01dbbcd553813c8e26a5f1050822f9cc8e45f51d (diff) | |
| download | mruby-7e3d22f09569b920c8e3dd31d7a0d03e925a06cc.tar.gz mruby-7e3d22f09569b920c8e3dd31d7a0d03e925a06cc.zip | |
Raname `mrb_exc_new_str_lit()` to `mrb_exc_new_lit()`.
It uses `mrb_str_new_lit()` internally, but it doesn't need to express
it in the name of the function (macro).
Diffstat (limited to 'src')
| -rw-r--r-- | src/error.c | 6 | ||||
| -rw-r--r-- | src/load.c | 2 | ||||
| -rw-r--r-- | src/vm.c | 18 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/error.c b/src/error.c index b6a82f867..b19f0ea43 100644 --- a/src/error.c +++ b/src/error.c @@ -622,11 +622,11 @@ mrb_init_exception(mrb_state *mrb) script_error = mrb_define_class(mrb, "ScriptError", mrb->eException_class); /* 15.2.37 */ mrb_define_class(mrb, "SyntaxError", script_error); /* 15.2.38 */ stack_error = mrb_define_class(mrb, "SystemStackError", exception); - mrb->stack_err = mrb_obj_ptr(mrb_exc_new_str_lit(mrb, stack_error, "stack level too deep")); + mrb->stack_err = mrb_obj_ptr(mrb_exc_new_lit(mrb, stack_error, "stack level too deep")); nomem_error = mrb_define_class(mrb, "NoMemoryError", exception); - mrb->nomem_err = mrb_obj_ptr(mrb_exc_new_str_lit(mrb, nomem_error, "Out of memory")); + mrb->nomem_err = mrb_obj_ptr(mrb_exc_new_lit(mrb, nomem_error, "Out of memory")); #ifdef MRB_GC_FIXED_ARENA - mrb->arena_err = mrb_obj_ptr(mrb_exc_new_str_lit(mrb, nomem_error, "arena overflow error")); + mrb->arena_err = mrb_obj_ptr(mrb_exc_new_lit(mrb, nomem_error, "arena overflow error")); #endif } diff --git a/src/load.c b/src/load.c index b06b9ff37..2cc0f7557 100644 --- a/src/load.c +++ b/src/load.c @@ -625,7 +625,7 @@ void mrb_exc_set(mrb_state *mrb, mrb_value exc); static void irep_error(mrb_state *mrb) { - mrb_exc_set(mrb, mrb_exc_new_str_lit(mrb, E_SCRIPT_ERROR, "irep load error")); + mrb_exc_set(mrb, mrb_exc_new_lit(mrb, E_SCRIPT_ERROR, "irep load error")); } void mrb_codedump_all(mrb_state*, struct RProc*); @@ -1016,7 +1016,7 @@ static mrb_bool check_target_class(mrb_state *mrb) { if (!mrb->c->ci->target_class) { - mrb_value exc = mrb_exc_new_str_lit(mrb, E_TYPE_ERROR, "no target class or module"); + mrb_value exc = mrb_exc_new_lit(mrb, E_TYPE_ERROR, "no target class or module"); mrb_exc_set(mrb, exc); return FALSE; } @@ -1096,7 +1096,7 @@ RETRY_TRY_BLOCK: } #endif { - mrb_value exc = mrb_exc_new_str_lit(mrb, E_RUNTIME_ERROR, "integer overflow"); + mrb_value exc = mrb_exc_new_lit(mrb, E_RUNTIME_ERROR, "integer overflow"); mrb_exc_set(mrb, exc); } goto L_RAISE; @@ -1357,7 +1357,7 @@ RETRY_TRY_BLOCK: { mrb_value exc; - exc = mrb_exc_new_str_lit(mrb, E_TYPE_ERROR, + exc = mrb_exc_new_lit(mrb, E_TYPE_ERROR, "class or module required for rescue clause"); mrb_exc_set(mrb, exc); goto L_RAISE; @@ -1585,21 +1585,21 @@ RETRY_TRY_BLOCK: mrb_assert(bidx < irep->nregs); if (mid == 0 || !target_class) { - mrb_value exc = mrb_exc_new_str_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method"); + mrb_value exc = mrb_exc_new_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method"); mrb_exc_set(mrb, exc); goto L_RAISE; } if (target_class->tt == MRB_TT_MODULE) { target_class = ci->target_class; if (target_class->tt != MRB_TT_ICLASS) { - mrb_value exc = mrb_exc_new_str_lit(mrb, E_RUNTIME_ERROR, "superclass info lost [mruby limitations]"); + mrb_value exc = mrb_exc_new_lit(mrb, E_RUNTIME_ERROR, "superclass info lost [mruby limitations]"); mrb_exc_set(mrb, exc); goto L_RAISE; } } recv = regs[0]; if (!mrb_obj_is_kind_of(mrb, recv, target_class)) { - mrb_value exc = mrb_exc_new_str_lit(mrb, E_TYPE_ERROR, + mrb_value exc = mrb_exc_new_lit(mrb, E_TYPE_ERROR, "self has wrong type to call super in this context"); mrb_exc_set(mrb, exc); goto L_RAISE; @@ -1700,7 +1700,7 @@ RETRY_TRY_BLOCK: mrb_value exc; L_NOSUPER: - exc = mrb_exc_new_str_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method"); + exc = mrb_exc_new_lit(mrb, E_NOMETHOD_ERROR, "super called outside of method"); mrb_exc_set(mrb, exc); goto L_RAISE; } @@ -2066,7 +2066,7 @@ RETRY_TRY_BLOCK: goto CHECKPOINT_LABEL_MAKE(RBREAK_TAG_STOP); } if (c->prev->ci == c->prev->cibase) { - mrb_value exc = mrb_exc_new_str_lit(mrb, E_FIBER_ERROR, "double resume"); + mrb_value exc = mrb_exc_new_lit(mrb, E_FIBER_ERROR, "double resume"); mrb_exc_set(mrb, exc); goto L_RAISE; } @@ -2099,7 +2099,7 @@ RETRY_TRY_BLOCK: mrb_value exc; L_BREAK_ERROR: - exc = mrb_exc_new_str_lit(mrb, E_LOCALJUMP_ERROR, + exc = mrb_exc_new_lit(mrb, E_LOCALJUMP_ERROR, "break from proc-closure"); mrb_exc_set(mrb, exc); goto L_RAISE; |
