| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2019-09-12 | Merge pull request #4527 from lopopolo/string-each-line-paragraph-mode | Yukihiro "Matz" Matsumoto | |
| Add paragraph mode to String#each_line in mrblib | |||
| 2019-06-29 | Replace `String#[]=` method by C implements | dearblue | |
| The purpose is to eliminate string objects that are temporarily created during processing. | |||
| 2019-06-25 | Unify loops to minimize bytecode size | Ryan Lopopolo | |
| 2019-06-23 | Use explicit block parameter | Ryan Lopopolo | |
| 2019-06-23 | Optimize String#each_line | Ryan Lopopolo | |
| 2019-06-22 | Speed up base case by 2x | Ryan Lopopolo | |
| Make non-paragraph mode twice as fast. Performance is within a factor of 2 of the original implementation. | |||
| 2019-06-22 | Add paragraph mode to String#each_line in mrblib | Ryan Lopopolo | |
| mruby/mruby#4511 demonstrated an infinite loop in `String#each_line` when given an empty string separator. In MRI, an empty separator places String#each_line in paragraph mode, where the String is separated on successive runs of newlines. In paragraph mode, the String `"abc\n\n\ndef\nxyz"` is split into `["abc\n\n\n", "def\nxyz"]`. This commit makes the String#each_line implementation as close to ruby/spec compliant as possible given the limitations of mruby core. With this patch, the following specs fail for `String#each_line`: - uses `$/` as the separator when none is given (can be fixed by aliasing and redefining the method to use $/ as the default value of separator in mruby-io) - when no block is given returned Enumerator size should return nil (`Enumerator#size` is not supported on mruby) - tries to convert the separator to a string using to_str (`String#to_str` is not implemented on mruby) This patch has similar memory consumption compared to the prior implementation and is takes 4x the time the prior implementation takes to execute: ```console /usr/bin/time -l ./bin/mruby -e '("aaa\n\nbbbbb\n\n\n\n\ncccc" * 100000).each_line("\n") { }'; ``` | |||
| 2019-05-15 | Add Enumerator support to `String#each_byte`. | Yukihiro "Matz" Matsumoto | |
| `String#each_byte` is not defined in ISO Ruby but it is implemented in the core mruby because it's useful. | |||
| 2019-05-15 | Remove `String#=~` and `String#match` that requires `Regexp`. | Yukihiro "Matz" Matsumoto | |
| 2019-04-27 | Remove duplicated `String#each_char` | KOBAYASHI Shuji | |
| 2019-04-21 | Commented out `String#scan` because it is not implemented yet | KOBAYASHI Shuji | |
| 2019-04-19 | Add type check (conversion) in `String#[]=` | KOBAYASHI Shuji | |
| Before this patch: 'a'[0] = 1 #=> 1 'a'[:a] = '1' #=> ArgumentError 'a'[:a, 0] = '1' #=> ArgumentError 'a'[0, :a] = '1' #=> ArgumentError 'a'[0, 1] = 1 #=> 1 After this patch / Ruby: 'a'[0] = 1 #=> TypeError 'a'[:a] = '1' #=> TypeError 'a'[:a, 0] = '1' #=> TypeError 'a'[0, :a] = '1' #=> TypeError 'a'[0, 1] = 1 #=> TypeError | |||
| 2019-04-18 | Remove duplicated `include Comparable` in `mrblib/string.rb` | KOBAYASHI Shuji | |
| 2019-04-08 | Avoid infinite loop when no `Regexp` class is available; fix #4363 | Yukihiro "Matz" Matsumoto | |
| 2018-11-19 | Avoid assignments from type checking `String#__to_str`. | Yukihiro "Matz" Matsumoto | |
| 2018-11-19 | Remove implicit conversion using `to_str` method; fix #3854 | Yukihiro "Matz" Matsumoto | |
| We have added internal convenience method `__to_str` which does string type check. The issue #3854 was fixed but fundamental flaw of lack of stack depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA` for workaround. | |||
| 2018-08-07 | Fixed the corner case bug in `String#{gsub!,sub!}`. | Yukihiro "Matz" Matsumoto | |
| `"a".sub!("a", "a")` should not return `nil`. | |||
| 2017-12-12 | Modifying frozen objects will raise `FrozenError`. | Yukihiro "Matz" Matsumoto | |
| `FrozenError` is a subclass of `RuntimeError` which used to be raised. [Ruby2.5] | |||
| 2017-06-21 | use `unless` instead of `if not`. | Yukihiro "Matz" Matsumoto | |
| 2017-03-22 | Fix result if pattern is empty | ksss | |
| 2017-03-19 | Callback should yield with pattern every time | ksss | |
| 2017-03-19 | Support to return Enumerator for String#gsub,gsub! | ksss | |
| 2017-03-15 | Support to return enumerator when no block given | ksss | |
| 2017-03-15 | Suuport custom separator | ksss | |
| 2017-03-15 | Use duplicated object for block args | ksss | |
| 2017-03-11 | Merge branch 'master' into string-gsub | Yukihiro "Matz" Matsumoto | |
| 2017-03-10 | \1 sequences as empty strings | ksss | |
| 2017-03-10 | Avoid infinity loop when empty string pattern | ksss | |
| 2017-03-05 | Check modifiable for String `bang' methods | ksss | |
| 2016-11-16 | Fixed off-by-one error in String#[]= with Ranges | Yukihiro "Matz" Matsumoto | |
| 2016-11-16 | make String#[]= to take Ranges as position argument | Yukihiro "Matz" Matsumoto | |
| 2015-09-23 | remove a comment that no longer be true; 2cb6c27 | Yukihiro "Matz" Matsumoto | |
| 2015-09-22 | String#index should no longer take integer argument | Yukihiro "Matz" Matsumoto | |
| 2015-09-16 | support String#[]= with 3 args | takahashim | |
| 2015-08-21 | string.rb: refactor code (remove redundant code) | go.kikuta | |
| 2015-07-16 | Don't crash if pattern not found for sub | Jared Breeden | |
| 2015-06-08 | gsub/sub supports back references in substitutes. fixes #2816. | Tomoyuki Sahara | |
| This implementation is compatible with CRuby's String#gsub/sub except \1 ... \9 and \+. They are useless without Regexp library. | |||
| 2015-05-29 | update mrblib/*.rb files to conform (some of) Rubocop checks | Yukihiro "Matz" Matsumoto | |
| 2015-01-19 | String#[]= should support negative position; close #2707 | Yukihiro "Matz" Matsumoto | |
| 2015-01-14 | fix infinite loop in String#match(arg) when arg is String | takahashim | |
| 2014-02-08 | made mrb_define_class to return existing class, with heavy refactoring | Yukihiro "Matz" Matsumoto | |
| 2014-01-10 | fix ISO reference number of String#=~. | Tomoyuki Sahara | |
| 2013-12-24 | string type check based on #to_str to encourage duck typing; #1616 | Yukihiro "Matz" Matsumoto | |
| 2013-12-24 | verify the argument of String#=~ | h2so5 | |
| 2013-07-23 | String `=~` and `match` to work with pluggable Regexp; close #1398 | Yukihiro "Matz" Matsumoto | |
| 2013-02-18 | adopt String#gsub to fixed split behavior | Yukihiro Matz Matsumoto | |
| 2013-02-17 | String#gsub fix with last character | Daniel Bovensiepen | |
| 2013-02-12 | Added String#sub/sub! and String#gsub/gsub! | Yuichiro MASUI | |
| 2012-11-02 | delete needless output in String#[]= | skandhas | |
| 2012-11-01 | String#each_byte to use String#bytes; close #508 | Yukihiro Matsumoto | |
