- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-proc-ext/src/proc.c
r321 r331 1 #include "mruby.h"2 #include "mruby/proc.h"3 #include "mruby/opcode.h"4 #include "mruby/array.h"5 #include "mruby/string.h"6 #include "mruby/debug.h"1 #include <mruby.h> 2 #include <mruby/proc.h> 3 #include <mruby/opcode.h> 4 #include <mruby/array.h> 5 #include <mruby/string.h> 6 #include <mruby/debug.h> 7 7 8 8 static mrb_value … … 53 53 line = mrb_debug_get_line(irep, 0); 54 54 if (line != -1) { 55 mrb_str_append(mrb, str, mrb_fixnum_value(line));55 str = mrb_format(mrb, "%S:%S", str, mrb_fixnum_value(line)); 56 56 } 57 57 else { … … 108 108 const struct mrb_irep *irep = proc->body.irep; 109 109 mrb_aspec aspec; 110 mrb_value parameters;110 mrb_value sname, parameters; 111 111 int i, j; 112 112 113 113 if (MRB_PROC_CFUNC_P(proc)) { 114 114 // TODO cfunc aspec is not implemented yet 115 return mrb_ary_new(mrb); 116 } 117 if (!irep) { 115 118 return mrb_ary_new(mrb); 116 119 } … … 135 138 136 139 parameters = mrb_ary_new_capa(mrb, irep->nlocals-1); 140 137 141 for (i = 0, p = parameters_list; p->name; p++) { 138 mrb_value sname = mrb_symbol_value(mrb_intern_cstr(mrb, p->name)); 142 if (p->size <= 0) continue; 143 sname = mrb_symbol_value(mrb_intern_cstr(mrb, p->name)); 139 144 for (j = 0; j < p->size; i++, j++) { 140 mrb_assert(i < (irep->nlocals-1)); 141 mrb_ary_push(mrb, parameters, mrb_assoc_new(mrb, 142 sname, 143 mrb_symbol_value(irep->lv[i].name) 144 )); 145 mrb_value a = mrb_ary_new(mrb); 146 mrb_ary_push(mrb, a, sname); 147 if (irep->lv[i].name) { 148 mrb_ary_push(mrb, a, mrb_symbol_value(irep->lv[i].name)); 149 } 150 mrb_ary_push(mrb, parameters, a); 145 151 } 146 152 }
Note:
See TracChangeset
for help on using the changeset viewer.