summaryrefslogtreecommitdiffhomepage
path: root/src/codegen.c
AgeCommit message (Collapse)Author
2015-05-25Move "src/mrb_throw.h" to "include/mruby/throw.h".take_cheeze
Related to #2760.
2015-05-23Move `mrb_codedump_all` to "src/codedump.c".take_cheeze
Related to #2760.
2015-05-20there may be expecting here-doc when we see terminating characters; fix #2780Yukihiro "Matz" Matsumoto
2015-05-07fix splat without assignment; fix #2781cremno
The parser generates NODE_NIL for tSTAR without argument in masgns. The codegen didn't handle that.
2015-02-24Fix a bug that no expression case doesn't return valid valueKouhei Sutou
Here is a script that reproduces this problem: x = case when true; 1 end p x # => main # 1 is expected
2015-02-24Fix a bug that if and no return value case can't return true clause valueKouhei Sutou
Here is a script that reproduce this problem: x = if true 1 else case 2 when 3 end 4 end p x # => nil # 1 is expected
2014-12-23Fix splat and multiple assignmentsKouhei Sutou
Case1: From variable Code: a = [1, 2, 3, 4, 5] b, c, *d = a p [a, b, c, d] Before: [[1, 2, 3, 4, 5], 1, 2, []] After: [[1, 2, 3, 4, 5], 1, 2, [3, 4, 5]] Ruby: [[1, 2, 3, 4, 5], 1, 2, [3, 4, 5]] Case2: From variables Code: a = [1, 2, 3] b = [4, 5, 6, 7] c, d, *e, f, g = *a, *b p [a, b, c, d, e, f, g] Before: [[1, 2, 3], [4, 5, 6, 7], 1, 2, [], 6, 7] After: [[1, 2, 3], [4, 5, 6, 7], 1, 2, [3, 4, 5], 6, 7] Ruby: [[1, 2, 3], [4, 5, 6, 7], 1, 2, [3, 4, 5], 6, 7] Case 3: "for" Code: a = [1, 2, 3, 4, 5, 6, 7] for b, c, *d, e, f in [a] do p [a, b, c, d, e, f] end Before: [[1, 2, 3, 4, 5, 6, 7], 1, 2, [], nil, nil] After: [[1, 2, 3, 4, 5, 6, 7], 1, 2, [3, 4, 5], 6, 7] Ruby: [[1, 2, 3, 4, 5, 6, 7], 1, 2, [3, 4, 5], 6, 7]
2014-12-01should not pop register when value from multiple assignment requiredYukihiro "Matz" Matsumoto
2014-11-27wrong register adjustmentYukihiro "Matz" Matsumoto
2014-11-26wrong register number adjustment in multiple assignment; fix #2654Yukihiro "Matz" Matsumoto
2014-11-26OP_APOST local variable display was wrongYukihiro "Matz" Matsumoto
2014-11-23align indent of local variable names in codedump()Yukihiro "Matz" Matsumoto
2014-11-22should support recursive mlhs decomposition, e.g. (a,b),c = [1,2],3Yukihiro "Matz" Matsumoto
2014-10-28Refactor for_body funcJun Hiroe
2014-09-08fixed wandering filename problemYukihiro "Matz" Matsumoto
2014-09-03get rid of shadowing variablescremno
Mostly by renaming the shadowing variable. If a shadowing variable was deleted, the shadowed one can be used instead.
2014-08-29more OP_MOVE swap detection in peephole optimizationYukihiro "Matz" Matsumoto
2014-08-29allow no_optimize esp. for debuggerYukihiro "Matz" Matsumoto
2014-08-29Fix mismatches for MRB_API declarations.Tatsuhiko Kubo
2014-08-27Add a missing space after ",".Tatsuhiko Kubo
2014-08-26printf: cast variables to the expected typecremno
%x expects unsigned int and %p expects void * GCC emits a diagnostic about %p/void* in pedantic mode: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26542
2014-08-20should use non NULL scope for raise_error(); ref #2547Yukihiro "Matz" Matsumoto
2014-08-20Fix allocation-error-handlings for scope_new().Tatsuhiko Kubo
2014-08-20Use specified macro(NULL) instead of magic-number.Tatsuhiko Kubo
2014-08-18refactor mruby method(fix indent. remove temporary value, duplicate procedure)kkkkkt
2014-07-09invalid base shouldn't silently failcremno
Revert 44a5809224e819bf8bcca4ae9a8c5ea5bf4cefd7 and check range of `base` with `mrb_assert`. It actually can only be either 2, 8, 10 or 16 (and never 0), unless mruby sources are modified. But I don't see a reason to impose further limits.
2014-06-13Using 'mrb_assert' instead of an returning 0 while checking s->irep in ↵Jose Narvaez
codegen.c.
2014-06-13Revert "Fixed dereference to null pointer in 'codegen.c' reported by ↵Jose Narvaez
'clang-analyzer'" This reverts commit 29f14e728d319d9fc80702ba78959c1957944767.
2014-06-13Fixed dereference to null pointer in 'codegen.c' reported by 'clang-analyzer'Jose Narvaez
2014-06-13Fixed dereference to null pointer in 'codegen.c' reported by 'clang-analyzer'Jose Narvaez
2014-06-13Fixed possible division by zero in 'codegen.c' reported by 'clang-analyzer'Jose Narvaez
2014-06-10reserve a register for a block parameter in a for statement body; ref #2375Yukihiro "Matz" Matsumoto
2014-06-10NODE_FOR does not introduce new local variablesYukihiro "Matz" Matsumoto
2014-06-09codedump should display proper L(n) for OP_STRING opYukihiro "Matz" Matsumoto
2014-05-16register<nlocals may not have a local variable name (e.g. a block arg); fix ↵Yukihiro "Matz" Matsumoto
#2258
2014-05-14print_r() and print_lv() should only be compiled in for ENABLE_STDIOMitchell Blank Jr
2014-05-14mv opcode.h -> include/mruby/opcode.h and remove duplication from mruby-eval gemYukihiro "Matz" Matsumoto
2014-05-14resize register number in LVAR section from 32bits to 16bitsYukihiro "Matz" Matsumoto
2014-05-14Merge branch 'dump_lv' of https://github.com/take-cheeze/mruby into ↵Yukihiro "Matz" Matsumoto
take-cheeze-dump_lv
2014-05-13Remove unnecessary newline in `OP_GETGLOBAL` codedump.take_cheeze
2014-04-29Remove `lv_len` and use `nlocals - 1` instead.take_cheeze
Check that `lv`'s length is always `nlocals - 1`.
2014-04-29Support local variables information dumping.take_cheeze
2014-04-29indent codedump when file/line info is not available; ref #2147Yukihiro "Matz" Matsumoto
2014-04-28Use int32_t as line variable type.take_cheeze
2014-04-28Print file name and line number in codedump if available.take_cheeze
2014-04-28fix OP_BLKPUSH dump formatYukihiro "Matz" Matsumoto
2014-04-28prevent printf warningYukihiro "Matz" Matsumoto
2014-04-28better codedump formattingYukihiro "Matz" Matsumoto
2014-04-28presreve local variables names in irep->lvYukihiro "Matz" Matsumoto
2014-04-27rename `mrb_str_buf_append` to `mrb_str_cat_str`cremno
The new name is better and less confusing, because: - `mrb_str_append` calls `mrb_str_to_str` and this function doesn't - `mrb_str_buf_append` _is_ `mrb_str_cat` for `mrb_value` strings