summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
AgeCommit message (Collapse)Author
2020-10-15Merge branch 'work_for_merge' of https://github.com/zubycz/mruby into ↵Yukihiro "Matz" Matsumoto
zubycz-work_for_merge
2020-10-15Fix out of bound access in `parse.y`.Yukihiro "Matz" Matsumoto
2020-10-15Merge pull request #5084 from mruby/mruby3Yukihiro "Matz" Matsumoto
Mruby3
2020-10-14Avoid using C struct dump for test Ruby code.Yukihiro "Matz" Matsumoto
Files under `test/t` and `mrbgem/*/test` are for tests, not for actual execution. So symbols in those files need not to be pre-allocated. This change slightly reduce the memory consumption.
2020-10-13Introduce endless range (a part of #5085)taiyoslime
Co-Authored-By: n4o847 <[email protected]> Co-Authored-By: smallkirby <[email protected]>
2020-10-12Revert e2e6554b56 not to use `MRB_TRY()`; close #5088Yukihiro "Matz" Matsumoto
`MRB_TRY()` does not work when compiled by C compiler with `cxx_exception`, due to the mixture of `setjmp()` used by `mirb.c` and `throw` used by the core. The original intension of e2e6554b56 is to protect code from signal interruption, but the signal interruption is not well-defined in mruby anyway.
2020-10-12Unify `mrb_str_to_str` to `mrb_obj_as_string`.Yukihiro "Matz" Matsumoto
Redirect `mrb_str_to_str` to `mrb_obj_as_string` via C macro. Inspired by #5082
2020-10-12Update `bintest` of `mruby-bin-debugger`.Yukihiro "Matz" Matsumoto
Need to support `int / int -> int` update.
2020-10-12Add `const` before `struct mrb_irep` in `mruby-bin-debugger` gem.Yukihiro "Matz" Matsumoto
2020-10-12Fix `mrb_int_mul_overflow()` to check either operand being zero.Yukihiro "Matz" Matsumoto
2020-10-12Embed debug information to resolve Windows VC's issue.Yukihiro "Matz" Matsumoto
2020-10-12Adjust backslash position in multi-line macros.Yukihiro "Matz" Matsumoto
2020-10-12Use `MRB_INT_MAX` instead of `INT_MAX` according to variable type.Yukihiro "Matz" Matsumoto
2020-10-12Restore old function names for compatibility; ref #5070Yukihiro "Matz" Matsumoto
- `mrb_check_intern()` to return `mrb_value` - `mrb_intern_check()` to return `mrb_sym` [NEW] Other new functions: - `mrb_intern_check_cstr()` - `mrb_intern_check_str()`
2020-10-12Restore old function names for compatibility; fix #5070Yukihiro "Matz" Matsumoto
Rename new functions: - `mrb_convert_type(mrb,val,type,tname,method)` => `mrb_type_convert(mrb,val,type,tname,method)` - `mrb_check_convert_type(mrb,val,type,tname,method)` => `mrb_type_convert_check(mrb,val,type,tname,method)` Old names are defined by macros (support `tname` drop and `char*` => `mrb_sym` conversion).
2020-10-12Fix warning from VC regarding implicit int conversion.Yukihiro "Matz" Matsumoto
2020-10-12Made `Rational` overhaul.Yukihiro "Matz" Matsumoto
- Implement `Rational()` in `C`. - Use `float` to `rational` conversion function taken from: https://rosettacode.org/wiki/Convert_decimal_number_to_rational#C
2020-10-12Avoid `unsigned int`; Use `mrb_int` instead.Yukihiro "Matz" Matsumoto
2020-10-12Remove meaningless `IO.open(1<<32)` test.Yukihiro "Matz" Matsumoto
2020-10-12Skip some `Math.atan2()` tests.Yukihiro "Matz" Matsumoto
Linux `atan2(3)` man page says: ``` If y is positive infinity (negative infinity) and x is positive infinity, +pi/4 (-pi/4) is re‐ turned. ``` But on Microsoft VC/MinGW, `atan2()` returns `NaN` if either of arguments is infinite. So we skip those tests on the platforms.
2020-10-12Update `IO#popen` to use keyword arguments instead of `Hash` args.Yukihiro "Matz" Matsumoto
2020-10-12Use `mrb_integer()` instead of `mrb_int()`.Yukihiro "Matz" Matsumoto
`mrb_int()` includes implicit integer conversion, where `mrb_integer()` does not. In this case, we know `obj` is an integer before hand.
2020-10-12Silence warnings from implicit integer conversions.Yukihiro "Matz" Matsumoto
Caused from combination of `mrb_int`, `int` and `size_t`..
2020-10-12Add a new gem: `mruby-catch`.Yukihiro "Matz" Matsumoto
Implements `catch`/`throw` non-local jump inherited from Lisp. `catch([tag]) {|tag| block } -> obj` Example: ``` catch(:foo) { 123 } # => 123 catch(:foo) { throw(:foo, 456) } # => 456 catch(:foo) { throw(:foo) } # => nil ```
2020-10-12Change float representation in `mrb` binary files.Yukihiro "Matz" Matsumoto
From human readable (ASCII) string representation to binary dump of IEEE754 in little endian.
2020-10-12Replace the implementation of method tables in classes/modules.Yukihiro "Matz" Matsumoto
They are basically the copy of instance variable tables. On my Linux box, memory consumption of `mrbtest` measured by `valgrind` is: - old: 17,683,830 bytes - new: 14,283,749 bytes
2020-10-12Raname `mrb_exc_new_str_lit()` to `mrb_exc_new_lit()`.Yukihiro "Matz" Matsumoto
It uses `mrb_str_new_lit()` internally, but it doesn't need to express it in the name of the function (macro).
2020-10-12Handle integer overflow in `rational_s_new`.Yukihiro "Matz" Matsumoto
2020-10-12Use `mrb_int_value()` instead of `mrb_fixnum_value()`.Yukihiro "Matz" Matsumoto
Where fixnum overflow can happen.
2020-10-12Update `mruby-random` gem to support 32 bit platforms.Yukihiro "Matz" Matsumoto
`sizeof(rand_state)` had been bigger than `sizeof(void*)*3`. Changed random number generator to `Xorshift96` on 32 bit platforms.
2020-10-12Reorganize `Integer` system.Yukihiro "Matz" Matsumoto
- Integrate `Fixnum` and `Integer` - Remove `Integral` - `int / int -> int` - Replace `mrb_fixnum()` to `mrb_int()` - Replace `mrb_fixnum_value()` to `mrb_int_value()`. - Use `mrb_integer_p()` instead of `mrb_fixnum_p()`
2020-10-12Remove unnecessary assignment in String#upton4o847
Co-authored-by: taiyoslime <[email protected]> Co-authored-by: smallkirby <[email protected]>
2020-10-12Describe the need for `-o` option if multi files given.Yukihiro "Matz" Matsumoto
2020-10-12Update usage description of `mrbc`.Yukihiro "Matz" Matsumoto
2020-10-12"backport" CRuby r46756; ref #3500Yukihiro "Matz" Matsumoto
Based on cremno/mruby@6bd0119
2020-10-12Change the return type of `mrb_check_intern()` and friends.Yukihiro "Matz" Matsumoto
They used to return `mrb_value` but now return `mrb_sym` for consistency with other `intern` functions. If symbols are not defined, `check` functions return `0`, instead of `nil` in the past. It causes API incompatibility but I believe few people use those functions out of the core, and those changes are very easy to handle, hopefully.
2020-10-12Avoid using `mrb_check_intern_str()`.Yukihiro "Matz" Matsumoto
We call `mrb_intern_str()` later anyway, so there's no need to avoid defining a new symbol here.
2020-10-12"backport" CRuby r46656; #2500Yukihiro "Matz" Matsumoto
Based on cremno/mruby@d446192
2020-10-12Fixed wrong size calculation for `memsize_of()`.Yukihiro "Matz" Matsumoto
2020-10-12Rename `MRB_TT_FIXNUM` to `MRB_TT_INTEGER`.Yukihiro "Matz" Matsumoto
We still have `#define MRB_TT_FIXNUM MRB_TT_INTEGER` for compatibility.
2020-10-12change linkage to internalcremno
2020-10-12define sprintf and format as global functionscremno
2020-10-12move mrbgem initialization into sprintf.ccremno
Also remove some unnecessary code.
2020-10-12Add tests for CRuby bug #9982cremno
https://bugs.ruby-lang.org/issues/9982
2020-10-12Integrate `Fixnum` class into `Integer` classdearblue
* The `Fixnum` constant is now an alias for the `Integer` class. * Remove `struct mrb_state::fixnum_class` member. If necessary, use `struct mrb_state::integer_class` instead.
2020-10-12Update tests for integer division.Yukihiro "Matz" Matsumoto
2020-10-12Make `Proc#parameters` to support keyword arguments; fix #5066Yukihiro "Matz" Matsumoto
TODO: Unlike CRuby, mruby's `Proc#parameters` does not distinguish required keyword arguments and optional keyword arguments currently.
2020-10-12Use xoshiro128++ instead of xorshift96/128.Yukihiro "Matz" Matsumoto
2020-10-12Fix `rand_real` to return random number `[0,1)` not `[0,1]`.Yukihiro "Matz" Matsumoto
2020-10-12Rename float configuration option names.Yukihiro "Matz" Matsumoto
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general.