Commit Graph

6325 Commits

Author SHA1 Message Date
Daniel Bovensiepen a3111f144c Round execution time 2015-01-03 17:53:32 +08:00
Yukihiro "Matz" Matsumoto 3dea108857 Merge pull request #2690 from furunkel/master
Set correct build dir for bins
2015-01-03 13:04:20 +09:00
Julian Aron Prenner 1aef549971 Set correct build dir for bins 2015-01-02 14:47:57 +01:00
Yukihiro "Matz" Matsumoto 7d4b516ca3 Merge pull request #2689 from cubicdaiya/remove-null-checks
Remove redundant NULL checks for mrb_malloc().
2015-01-01 13:13:50 +09:00
Tatsuhiko Kubo 606095f2fe Remove redundant NULL checks for mrb_malloc(). 2015-01-01 05:12:41 +09:00
Yukihiro "Matz" Matsumoto 4046368ef3 Merge pull request #2687 from suzukaze/avoid_block_given
Avoid block_given? in mrbgem:enum.rb to reduce method calls
2014-12-27 20:12:55 +09:00
Yukihiro "Matz" Matsumoto baa0ee4133 Merge pull request #2686 from cubicdaiya/use-suitable-type
Use suitable type.
2014-12-27 20:12:09 +09:00
Jun Hiroe 3a21c9b6d7 Avoid block_given? in mrbgem:enum.rb to reduce method calls 2014-12-27 18:17:29 +09:00
Tatsuhiko Kubo 093560e7d1 Use suitable type. 2014-12-27 10:18:18 +09:00
Yukihiro "Matz" Matsumoto ef3bbd2e64 avoid block_given? in enum.rb to reduce method calls 2014-12-25 15:59:22 +09:00
Yukihiro "Matz" Matsumoto 6eeaef705d Merge pull request #2685 from sdottaka/fix-typo-in-mruby-eval
mruby-eval: fix typo
2014-12-24 01:07:18 +09:00
Yukihiro "Matz" Matsumoto bb3447173b khash.h: keep key/value table accessible from original hashtable during resize; fix #2682 2014-12-23 22:28:33 +09:00
Yukihiro "Matz" Matsumoto 7f630d41ab Merge pull request #2684 from kou/fix-splat-and-multiple-assignments
Fix splat and multiple assignments
2014-12-23 22:19:20 +09:00
sdottaka 79f703ecba mruby-eval: fix typo 2014-12-23 22:17:07 +09:00
Kouhei Sutou 5ec676aa37 Fix splat and multiple assignments
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-23 21:16:01 +09:00
Yukihiro "Matz" Matsumoto e618438882 Merge pull request #2681 from sdottaka/mrdb-break-windows
mrdb: fix that break command cannot handle Windows paths
2014-12-20 10:39:58 +09:00
sdottaka 80a742df51 mrdb: fix that break command cannot handle Windows paths
Before fix:
```
$ mrdb c:\tmp\b.rb
(c:\tmp\b.rb:1) break c:\tmp\b.rb:3
Class name 'c' is invalid.
```

After fix:
```
$ mrdb c:\tmp\b.rb
(c:\tmp\b.rb:1) break c:\tmp\b.rb:3
Breakpoint 1: file c:\tmp\b.rb, line 3.
```
2014-12-20 08:32:28 +09:00
Yukihiro "Matz" Matsumoto 10e9a1a167 now retrieves number of arguments of blocks from OP_ENTER op code; close #2671 2014-12-19 19:45:20 +09:00
Yukihiro "Matz" Matsumoto 358dd61107 block_given? should return correct value when called in blocks; close #2678
avoid a loop to find parent's callinfo using mrb->c->cibase[env->cioff]
2014-12-19 19:05:27 +09:00
Yukihiro "Matz" Matsumoto 5014bfb50d block_given? should return false on top-level; ref #2678 2014-12-19 18:51:14 +09:00
Yukihiro "Matz" Matsumoto 2732879f3e String#[]: float handling merged to #2677 2014-12-17 20:19:52 +09:00
Yukihiro "Matz" Matsumoto 545c5eecc0 Merge branch 'h2so5-string-nil-index' 2014-12-17 20:10:08 +09:00
Yukihiro "Matz" Matsumoto 4319eaaa45 try to convert not only nil but every objects to fixnums; ref #2677 2014-12-17 20:08:26 +09:00
h2so5 05b00a14c5 String#[] should reject nil index 2014-12-17 14:01:39 +09:00
Yukihiro "Matz" Matsumoto 5b203ead1e mruby-eval: proc from env may be NULL; close #2676 2014-12-17 12:35:19 +09:00
Yukihiro "Matz" Matsumoto ed56d56dab avoid out-of-bounds access of irep->lv; ref #2671, fix #2675
allocation size of irep->iv is irep->nlocals-1.
2014-12-17 11:14:14 +09:00
Yukihiro "Matz" Matsumoto a19a6edb7c mrb_str_new(mrb, "", len) creates an unmodifiable string object; ref #2674 2014-12-17 08:06:44 +09:00
Yukihiro "Matz" Matsumoto 0c4d053a94 Merge pull request #2674 from suzukaze/string.prepend
Add String#prepend
2014-12-17 07:45:45 +09:00
Jun Hiroe 7ea38ce473 Add String#prepend 2014-12-17 02:23:36 +09:00
Yukihiro "Matz" Matsumoto ab72410456 eval() should preserve stack in env properly; fix #2671 2014-12-17 01:10:19 +09:00
Yukihiro "Matz" Matsumoto fcbb7ec49d Fix crash if #inspect does not return a string value 2014-12-16 19:26:40 +09:00
Yukihiro "Matz" Matsumoto 05e6513fb4 Merge pull request #2669 from suzukaze/string.insert
Add String#insert
2014-12-13 15:40:37 +09:00
Jun Hiroe 45a442a9d7 Add String#insert 2014-12-13 15:31:22 +09:00
Yukihiro "Matz" Matsumoto f1481105b7 Merge pull request #2668 from sdottaka/fix-crash-for-inspect
Fix crash if #inspect does not return a string value
2014-12-12 23:12:48 +09:00
sdottaka fe01ce5b02 Fix crash if #inspect does not return a string value
case 1
~~~
class A; def inspect; 1; end; end
A.new.a
~~~

case 2

~~~
class A
  def self.inspect
    1
  end
  alias_method :a, :b
end
~~~
2014-12-12 23:05:22 +09:00
Yukihiro "Matz" Matsumoto 96d02b1268 Merge pull request #2667 from murasesyuka/usage_message_is_used_switches_instead_of_option
fix usage message
2014-12-12 22:13:06 +09:00
Yukihiro "Matz" Matsumoto 4078670bca mrb_p() should print mrb_obj_as_string() if #inspect does not return a string value 2014-12-12 21:32:02 +09:00
Yukihiro "Matz" Matsumoto 9723d6e4ba mirb dies if #inspect returns a non-string value; fix #2666 2014-12-12 13:14:56 +09:00
murase_syuka 77c6bfe287 fix usage message 2014-12-11 06:54:15 +09:00
Yukihiro "Matz" Matsumoto 44c29e88ae block_given did not work with nested block invocation for some cases; fix #2665 2014-12-11 00:36:18 +09:00
Yukihiro "Matz" Matsumoto 4eff93632f mrb_parser_dump() did not work with block arguments 2014-12-11 00:08:56 +09:00
Yukihiro "Matz" Matsumoto b48514bdcb Merge pull request #2663 from iij/pr-fix-string-utf8-aref
adding mruby-string-utf8 breaks String#[float]
2014-12-05 14:54:59 +09:00
Tomoyuki Sahara 5f68be7190 String#[] accepts float. 2014-12-05 13:42:58 +09:00
Yukihiro "Matz" Matsumoto ea828944ef Merge branch 'master' of github.com:mruby/mruby 2014-12-02 15:44:32 +09:00
Yukihiro "Matz" Matsumoto 64d1d10492 Merge pull request #2660 from cremno/fix-isblank-for-visual-studio-versions-older-than-2013
fix ISBLANK() for Visual Studio < 2013
2014-12-02 12:02:38 +09:00
cremno f6d15cfc38 fix ISBLANK() for Visual Studio < 2013 (ref #2658)
Visual Studio versions older than 2013 lack C99's isblank().
Since only ASCII characters are passed to it, implement it
directly without calling the locale-specific isblank().
2014-12-02 00:43:45 +01:00
Yukihiro "Matz" Matsumoto 4c70b5c644 should not pop register when value from multiple assignment required 2014-12-01 08:06:23 +09:00
Yukihiro "Matz" Matsumoto 260cad689a Merge pull request #2656 from murasesyuka/bugfix/mruby-bin-debugger_enforce_the_c99
adhoc fix for pass build
2014-11-29 09:32:44 +09:00
murase_syuka 39b4caea81 closing to Local Scope 2014-11-29 01:02:40 +09:00
Yukihiro "Matz" Matsumoto 09c6ca936c preserve ICLASS in ci->target_class; fix #2657; ensuring #1467 #1470 #1493 still works 2014-11-28 20:35:06 +09:00