mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
use mrb_str_cat_lit() more widely
This commit is contained in:
@@ -39,29 +39,29 @@ mrb_proc_inspect(mrb_state *mrb, mrb_value self)
|
||||
|
||||
if (!MRB_PROC_CFUNC_P(p)) {
|
||||
mrb_irep *irep = p->body.irep;
|
||||
mrb_str_cat_cstr(mrb, str, "@");
|
||||
mrb_str_cat_lit(mrb, str, "@");
|
||||
|
||||
if (irep->filename) {
|
||||
mrb_str_cat_cstr(mrb, str, irep->filename);
|
||||
}
|
||||
else {
|
||||
mrb_str_cat_cstr(mrb, str, "-");
|
||||
mrb_str_cat_lit(mrb, str, "-");
|
||||
}
|
||||
mrb_str_cat_cstr(mrb, str, ":");
|
||||
mrb_str_cat_lit(mrb, str, ":");
|
||||
|
||||
if (irep->lines) {
|
||||
mrb_str_append(mrb, str, mrb_fixnum_value(*irep->lines));
|
||||
}
|
||||
else {
|
||||
mrb_str_cat_cstr(mrb, str, "-");
|
||||
mrb_str_cat_lit(mrb, str, "-");
|
||||
}
|
||||
}
|
||||
|
||||
if (MRB_PROC_STRICT_P(p)) {
|
||||
mrb_str_cat_cstr(mrb, str, " (lambda)");
|
||||
mrb_str_cat_lit(mrb, str, " (lambda)");
|
||||
}
|
||||
|
||||
mrb_str_cat_cstr(mrb, str, ">");
|
||||
mrb_str_cat_lit(mrb, str, ">");
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ inspect_struct(mrb_state *mrb, mrb_value s, int recur)
|
||||
mrb_str_append(mrb, str, mrb_str_new_cstr(mrb, cn));
|
||||
}
|
||||
if (recur) {
|
||||
return mrb_str_cat_cstr(mrb, str, ":...>");
|
||||
return mrb_str_cat_lit(mrb, str, ":...>");
|
||||
}
|
||||
|
||||
members = mrb_struct_members(mrb, s);
|
||||
@@ -462,10 +462,10 @@ inspect_struct(mrb_state *mrb, mrb_value s, int recur)
|
||||
mrb_sym id;
|
||||
|
||||
if (i > 0) {
|
||||
mrb_str_cat_cstr(mrb, str, ", ");
|
||||
mrb_str_cat_lit(mrb, str, ", ");
|
||||
}
|
||||
else if (cn) {
|
||||
mrb_str_cat_cstr(mrb, str, " ");
|
||||
mrb_str_cat_lit(mrb, str, " ");
|
||||
}
|
||||
slot = ptr_members[i];
|
||||
id = mrb_symbol(slot);
|
||||
@@ -479,10 +479,10 @@ inspect_struct(mrb_state *mrb, mrb_value s, int recur)
|
||||
else {
|
||||
mrb_str_append(mrb, str, mrb_inspect(mrb, slot));
|
||||
}
|
||||
mrb_str_cat_cstr(mrb, str, "=");
|
||||
mrb_str_cat_lit(mrb, str, "=");
|
||||
mrb_str_append(mrb, str, mrb_inspect(mrb, ptr[i]));
|
||||
}
|
||||
mrb_str_cat_cstr(mrb, str, ">");
|
||||
mrb_str_cat_lit(mrb, str, ">");
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user