| Age | Commit message (Collapse) | Author |
|
|
|
Make non-paragraph mode twice as fast. Performance is within a factor of 2
of the original implementation.
|
|
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") { }';
```
|
|
Previous example doesn't work because string key (frozen) can't be modified.
|
|
For example on 32 bit mode, when `p = 0xfffffffd`, `e = 0xfffffffe`
and `len = 4`, the sum of `p` and `len` can be to `1`, and comparison
with `e` will to be false.
As a result, a segmentation fault occurs by referring to address 0.
|
|
shuujii/add-ISO-section-number-to-Kernel-local_variables
Add ISO section number to `Kernel.#local_variables` [ci skip]
|
|
|
|
shuujii/move-Kernel-__send__-test-to-core-from-mruby-metaprog
Move `Kernel#__send__` test to core from `mruby-metaprog`
|
|
|
|
|
|
`(r).value.bp` and `v` have the same value due to assignment of the line
preceding the removed line.
|
|
Remove unneeded `mrb_str_dup()` in `Module#name`
|
|
Fix path of `error.h`.
|
|
|
|
|
|
CRuby supports a 'o' `Regexp` option for `Regexp` literals, e.g. `/foo/o` that disables multiple interpolation passes.
This commit adds support for parsing such literals. Nothing is done with the option, it is consumed and ignored by the parser.
|
|
`mrb_class_path()` always returns a new string or `nil`.
|
|
shuujii/fix-cvar-ivar-const-and-method-can-be-removed-to-frozen-object
Fix cvar, ivar, const and method can be removed to frozen object
|
|
Fix index in error message of `Struct#[]`
|
|
|
|
|
|
|
|
|
|
shuujii/adjust-allocation-size-in-mrb_id_attrset-mruby-struct
Adjust allocation size in `mrb_id_attrset()` (`mruby-struct`)
|
|
|
|
Before this patch:
$ bin/mruby -e 'Struct.new(:a,:b).new[-3]'
#=> offset -1 too small for struct(size:2) (IndexError)
After this patch (same as Ruby):
$ bin/mruby -e 'Struct.new(:a,:b).new[-3]'
#=> offset -3 too small for struct(size:2) (IndexError)
|
|
shuujii/remove-a-meaningless-branch-condition-in-mruby-struct
Remove a meaningless branch condition in `mruby-struct`
|
|
The following branch condition is always true:
// mrbgems/mruby-struct/src/struct.c:187 in make_struct_define_accessors()
if (is_local_id(mrb, name) || is_const_id(mrb, name)) {
|
|
Fix class name validation in `Struct.new`
|
|
Before this patch:
$ bin/mruby -e 'p Struct.new("A-")'
#=> Struct::"A-"
After this patch:
$ bin/mruby -e 'p Struct.new("A-")'
#=> NameError: identifier A- needs to be constant
|
|
shuujii/kernel-global_variables-should-not-include-undefined-gvar
`Kernel#global_variables` should not include undefined `$1`-`$9`
|
|
Fix typo in `String#setbyte` error message
|
|
|
|
|
|
shuujii/remove-redundant-colon-in-Proc-inspect-mruby-proc-ext
Remove redundant colon in `Proc#inspect` (`mruby-proc-ext`)
|
|
Before this patch:
$ bin/mruby -e 'p proc{}' #=> #<Proc:0x7fd5eb8206d0@-e::1>
After this patch:
$ bin/mruby -e 'p proc{}' #=> #<Proc:0x7fd5eb8206d0@-e:1>
|
|
Replace obsolete macros
|
|
- They are not include in Ruby.
- Appear in duplicate when `$1`-`$9` are defined.
|
|
Remove `Kernel#global_variables` from core
|
|
shuujii/clarify-mruby-kernel-object-ext-gem-summary
Clarify `mruby-(kernel|object)-ext` gem summary; ref 8e637bdd [ci skip]
|
|
Fix missing assertions in `test/t/syntax.rb`
|
|
|
|
shuujii/remove-Check-the-usage-of-a-NUL-character-test
Remove "Check the usage of a NUL character" test
|
|
Because there is not assertion in this test and NUL character literal is
used in other tests.
|
|
|
|
This method is defined in `mruby-metaprog` gem.
|
|
|
|
|
|
In that case, to be switched implementation with `RData`.
It is based to "complex".
|
|
Object allocation was separated, and initialization was made common.
|