summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2019-06-28Remove unnecessary backticks in `src/range.c`; ref #2858KOBAYASHI Shuji
2019-06-27Skip copying delete keys in a hash; fix #4534Yukihiro "Matz" Matsumoto
2019-06-26Silence unused label warnings from gcc; ref #4524KOBAYASHI Shuji
mruby/mruby/src/string.c:1722:4: warning: label 'bytes' defined but not used [-Wunused-label] bytes: ^~~~~
2019-06-26Merge pull request #4524 from dearblue/reverse-utf8Yukihiro "Matz" Matsumoto
Change to UTF-8 string reversing with in place
2019-06-26Merge pull request #4532 from ↵Yukihiro "Matz" Matsumoto
shuujii/fix-String-byteslice-with-MRB_UTF8_STRING-and-some-edge-cases Fix `String#byteslice` with `MRB_UTF8_STRING` and some edge cases
2019-06-25Fix `String#byteslice` with `MRB_UTF8_STRING` and some edge casesKOBAYASHI Shuji
Example: $ bin/mruby -e ' p "あa".byteslice(1) p "bar".byteslice(3) p "bar".byteslice(4..0) ' Before this patch: "a" "" RangeError (4..0 out of range) After this patch (same as Ruby): "\x81" nil nil
2019-06-25Merge pull request #4528 from shuujii/fix-argument-specs-to-ArrayYukihiro "Matz" Matsumoto
Fix argument specs to `Array`
2019-06-25Merge pull request #4530 from ↵Yukihiro "Matz" Matsumoto
shuujii/compare-obj-pointer-directly-instead-of-using-mrb_obj_eq-in-mrb_gc_unregister Compare obj pointer directly instead of using mrb_obj_eq in mrb_gc_unregister
2019-06-25Fixed `mrb_iv_remove` with immediate objects; fix #4519Yukihiro "Matz" Matsumoto
The #4520 tried to address the issue, but it changes the type of `mrb_check_frozen` argument; close #4520
2019-06-25Fix `mrb_str_to_str()` to handle symbols.Yukihiro "Matz" Matsumoto
2019-06-24Compare obj pointer directly instead of using mrb_obj_eq in mrb_gc_unregisterKOBAYASHI Shuji
Because immediate values are not registered.
2019-06-23Fix argument specs to `Array`KOBAYASHI Shuji
2019-06-23Merge pull request #4526 from shuujii/refine-Hash-rehash-exampleYukihiro "Matz" Matsumoto
Refine `Hash#rehash` example [ci skip]
2019-06-22Fix the unnecessary `mrb_str_modify()` calldearblue
Now to be calls `mrb_str_modify()` only once when 2 or more characters.
2019-06-22Delete the unnecessary block brace in `mrb_str_reverse_bang`dearblue
2019-06-22Fix string brakes for one UTF-8 charactordearblue
2019-06-22Change to UTF-8 string reversing with in placedearblue
Reverses UTF-8 strings without allocated heap for working memory. 1. String before reversing: ``` "!yburmの界世" # byte unit [33, 121, 98, 117, 114, 109, 227, 129, 174, 231, 149, 140, 228, 184, 150] ``` 2. Reverse the byte order of each character: ``` [33, 121, 98, 117, 114, 109, 174, 129, 227, 140, 149, 231, 150, 184, 228] ``` 3. Reverse the whole byte order and complete: ``` [228, 184, 150, 231, 149, 140, 227, 129, 174, 109, 114, 117, 98, 121, 33] # string "世界のmruby!" ```
2019-06-22Replacement to function for string reversingdearblue
2019-06-22Refine `Hash#rehash` example [ci skip]KOBAYASHI Shuji
Previous example doesn't work because string key (frozen) can't be modified.
2019-06-22Fix potential overflow in `utf8len()`dearblue
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.
2019-06-16Fix cvar, ivar, const and method can be removed to frozen objectKOBAYASHI Shuji
2019-06-13Fix class name validation in `Struct.new`KOBAYASHI Shuji
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
2019-06-10`Kernel#global_variables` should not include undefined `$1`-`$9`KOBAYASHI Shuji
- They are not include in Ruby. - Appear in duplicate when `$1`-`$9` are defined.
2019-06-07Remove `Kernel#global_variables` from coreKOBAYASHI Shuji
This method is defined in `mruby-metaprog` gem.
2019-05-30Fix inverted compilation condition; fix #4478Yukihiro "Matz" Matsumoto
2019-05-29Add `mrb_alloca` again; ref #4470Yukihiro "Matz" Matsumoto
This time, the allocated memory comes from the string object, which is referenced from GC arena. The memory region will be reclaimed when the C function called from VM is terminated, or the GC arena is restored.
2019-05-27Merge pull request #4470 from dearblue/remove-mrb_allocaYukihiro "Matz" Matsumoto
Remove `mrb_alloca()` function
2019-05-26Move `mrb_mod_s_nesting()` to `mruby-metaprog` gem from the coreKOBAYASHI Shuji
2019-05-25Remove `mrb_alloca()` functiondearblue
When I found this function, I expected it to behave the same as the `alloca(3)` function, but it is accually the `mrb_alloca()` function does not free the heap until the `mrb_close()` function is called. Also, even if it is deleted, it can be replaced with the combination of the `MRB_TT_DATA` object and the `mrb_gv_set()` function if it is sure necessary.
2019-05-25Fix double rounded by negative indexdearblue
- Before patched: ``` $ mruby -e 'p (-12..-1).map { |i| "Hello"[i] }.join' "HelloHello" ``` - After patched: ``` $ mruby -e 'p (-12..-1).map { |i| "Hello"[i] }.join' "Hello" ```
2019-05-25Name the return value of `mrb_range_beg_len()`dearblue
2019-05-22Merge pull request #4403 from dearblue/read-irep-from-bufYukihiro "Matz" Matsumoto
Read irep from buffers
2019-05-21Update ISO section number for some Numeric methods.Yukihiro "Matz" Matsumoto
2019-05-21Export `mrb_int_value` that converts `mrb_float` to `Fixnum`.Yukihiro "Matz" Matsumoto
Or `Float` if `mrb_float` value is too big (or too small) to fit in `mrb_int`. The `_int_` in `mrb_int_value` means `Integral` module, which represents integer-like values in mruby.
2019-05-21Silence the return value warnings from gcc; ref 237a57bYukihiro "Matz" Matsumoto
2019-05-21Move `**`,`/`,`quo`,`div` and comparison methods to Integral from NumericKOBAYASHI Shuji
Having these methods in Numeric can get in the way of creating subclasses of Numeric because they only support Fixnum and Float.
2019-05-20Add new functions for numerical operation; ref 237a57bYukihiro "Matz" Matsumoto
New functions: * mrb_num_plus(mrb, x, y) * mrb_num_minus(mrb, x, y) * num_num_mul(mrb, x, y)
2019-05-19Merge pull request #4455 from dearblue/remove-LINE-sectionYukihiro "Matz" Matsumoto
Remove "LINE" section reader
2019-05-19Remove "LINE" section readerdearblue
Because it is not currently output by `mrbc`.
2019-05-18Move `Kernel#equal? to `BasicObject`KOBAYASHI Shuji
2019-05-18Move `Numeric#__coerce_step_counter` to `Integral`KOBAYASHI Shuji
This method is only used in `Integral#step`
2019-05-18Add ISO section number to `Module#===`.Yukihiro "Matz" Matsumoto
2019-05-18Rename `struct RIstruct` to `struct RIStruct`.Yukihiro "Matz" Matsumoto
2019-05-17Make unused functions private.Yukihiro "Matz" Matsumoto
* mrb_fixnum_plus() * mrb_fixnum_minus() * mrb_fixnum_mul()
2019-05-17Remove unused `mrb_num_div()` function.Yukihiro "Matz" Matsumoto
2019-05-17Move `Numeric#div` to the core.Yukihiro "Matz" Matsumoto
2019-05-17Make `flo_rount` to return `Integeral`.Yukihiro "Matz" Matsumoto
2019-05-17Change the `num.divmod(float)` to return `[int,num]`.Yukihiro "Matz" Matsumoto
2019-05-17Add a new function `mrb_int_value`.Yukihiro "Matz" Matsumoto
This function returns `Fixnum` if the value fits in `mrb_int`, otherwise it returns `Float` value (mruby behavior of handling integers).
2019-05-17Use `int64_t` instead of `mrb_int` in `int64_value`.Yukihiro "Matz" Matsumoto