summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
AgeCommit message (Collapse)Author
2021-06-07pack.c: raise exception for unsupported specifiers.Yukihiro "Matz" Matsumoto
2021-06-06pack.c: check overflow before calling `pack_x`.Yukihiro "Matz" Matsumoto
2021-06-06pack.c: check overflow before reading count.Yukihiro "Matz" Matsumoto
2021-06-06pack.c: failed to detect overflow when `ch` is zero in `read_tmpl`.Yukihiro "Matz" Matsumoto
2021-06-05pack.c: hold `enum` values in `enum` variables not `int`.Yukihiro "Matz" Matsumoto
2021-06-03add a few regressions test from #2313Yukihiro "Matz" Matsumoto
The code was contributed from Carson McDonald (@carsonmcdonald)
2021-05-30sprintf.c: avoid object allocation in integer formatting.Yukihiro "Matz" Matsumoto
2021-05-30numeric.c: introduce `mrb_int_to_cstr()` to dump `mrb_int`.Yukihiro "Matz" Matsumoto
* refactor `mrb_integer_to_str()` * refactor `mrb_str_format()`
2021-05-29codegen.c: just raise the exception on broken node for assignments.Yukihiro "Matz" Matsumoto
2021-05-28kernel.c: avoid recursive VM call in `mrb_f_caller`.Yukihiro "Matz" Matsumoto
2021-05-28kernel.c: `caller` should not include the frame for itself.Yukihiro "Matz" Matsumoto
2021-05-27array.c: unify `mrb_ary_ref` and `mrb_ary_entry`Yukihiro "Matz" Matsumoto
Use only `mrb_ary_entry` hereafter.
2021-05-22mruby-sprintf: reduce float digits to avoid test failure.Yukihiro "Matz" Matsumoto
Too many digits to fit in single precision float numbers, so that tests fail when `MRB_USE_FLOAT32` defined.
2021-05-22fp_fmt.c: remove `mrb_float_to_cstr()`.Yukihiro "Matz" Matsumoto
The function was intended to be a utility function for `mruby-sprintf`. The functionality was integrated into `sprintf.c`.
2021-05-21sprintf.c: remove specifiers `%a` and `%A`.Yukihiro "Matz" Matsumoto
`fmt_fp.c` does not support those specifiers. In addition, I believe no one uses hexadecimal representation of float values.
2021-05-18parse.y: allow "command" syntax in endless method definition.Yukihiro "Matz" Matsumoto
This change allows `def hello = puts "Hello"` without parentheses. This syntax has been introduced since Ruby3.1.
2021-05-18parse.y: endless singleton method definition can omit parens.Yukihiro "Matz" Matsumoto
2021-05-17Global renaming regarding `integer` and `float`.Yukihiro "Matz" Matsumoto
Consistent number conversion function names: * `mrb_value` to immediate (C) value * `mrb_int()` -> `mrb_as_int()` * `mrb_to_flo()` -> `mrb_as_float()` * `mrb_value` to `mrb_value` (converted) * `mrb_to_int()' * `mrb_Integer()` - removed * `mrb_Float()` -> `mrb_to_float` Consistent function name (avoid `_flo` suffix): * `mrb_div_flo()` -> `mrb_div_float`
2021-05-17Rename `mrb_fixnum_to_str` to `mrb_integer_to_str`.Yukihiro "Matz" Matsumoto
2021-05-17Rename `mrb_flo_to_fixnum` to `mrb_float_to_integer`.Yukihiro "Matz" Matsumoto
2021-05-17rational.c: update function prefixes.Yukihiro "Matz" Matsumoto
To be consistent, functions with `rational_` prefix implements methods, functions with `rat_` prefix are utility functions.
2021-05-15mruby-array-ext/array.c: implement `Array#rotate` in C.Yukihiro "Matz" Matsumoto
The Ruby version of `Array#rotate!` generated a rotated array and replaced the receiver, but the C version rotates the receiver array in-place. So the performance is improved a lot both in speed and memory consumption. Look for the comments in `array.c` for the in-place rotating algorithm, if you are interested.
2021-05-14mruby-array-ext/array.c: implement `Array#compact` in C.Yukihiro "Matz" Matsumoto
2021-05-14array.rb: replace `can't` with `cannot`.Yukihiro "Matz" Matsumoto
To avoid editor coloring failures.
2021-05-13string.c: remove unnecessary branch in the internal method.Yukihiro "Matz" Matsumoto
2021-05-13range.c: avoid use of `mrb_fixnum_p`.Yukihiro "Matz" Matsumoto
`mrb_int` may not fit in `fixnum` (inline integer).
2021-05-13mruby-test: `MRB_INT_MAX` etc. may not fit in `Fixnum` (inline int).Yukihiro "Matz" Matsumoto
2021-05-08time.c: Windows API provides `clock_gettime`.Yukihiro "Matz" Matsumoto
`gettimeofday` emulation needed no longer.
2021-05-05Extend the tab with 8 whitespacedearblue
This work was done as follows: - check: `git grep $'\011' -- :^oss-fuzz` - convert: `ruby -pi -e 'nil while $_.sub!(/^(.*?)\t/) { $1 + " " * (8 - $1.size % 8) }'` The `doc/guide/{compile,mrbgems}.md` file adds and removes whitespace to make the directory tree look the same. In `mrbgems/mruby-socket/src/socket.c`, there is a part where the indent is changed from 4 to 2 at the same time as the tab is changed.
2021-05-05Merge pull request #5442 from dearblue/mruby-packYukihiro "Matz" Matsumoto
Fix documents for `mruby-io`
2021-05-03Fix documents for `mruby-io`dearblue
2021-05-03Update gem spec for `mruby-sleep`dearblue
To align the spec like any other core mrbgems: - Delete `spec.version` - Set `spec.summary`
2021-05-02Rename mrbgems/mruby-inline-struct with mrbgems/mruby-test-inline-structdearblue
This gem contains only tests.
2021-05-02Run the task only once when `parse.y` is updateddearblue
Previously, the task was executed as many times as there were targets, including `mruby-compiler`. ```console % rm mrbgems/mruby-compiler/core/y.tab.c % rake `pwd`/mrbgems/mruby-compiler/core/y.tab.c YACC mrbgems/mruby-compiler/core/parse.y -> mrbgems/mruby-compiler/core/y.tab.c YACC mrbgems/mruby-compiler/core/parse.y -> mrbgems/mruby-compiler/core/y.tab.c ```
2021-05-01io.rb,print.rb: `puts` to expand array arguments.Yukihiro "Matz" Matsumoto
As CRuby behaves.
2021-04-29Fix typo in `mrbgems/mruby-io/mrblib/io.rb`; ref cb55e7ecaKOBAYASHI Shuji
2021-04-28string.c: add a new method `String#center`.Yukihiro "Matz" Matsumoto
2021-04-28string.{c,rb}: fix type of return values from some methods as Ruby3.0Yukihiro "Matz" Matsumoto
When the receiver is the instance of subclass of `String`. - `String#each_char` - `String#each_line` - `String#partition`
2021-04-28io.rb: reimplement `IO#each_char`.Yukihiro "Matz" Matsumoto
It used to be an alias to `IO#each_byte` but those methods should have behave differently.
2021-04-28array.rb: `Array#uniq` to return always `Array`.Yukihiro "Matz" Matsumoto
Even called for subclass of `Array`, according to new Ruby3.0 behavior. Other methods of `Array` behave as Ruby3.0 from the first hand.
2021-04-26mruby.c: specify file names for libraries set by `-r`; fix #5427Yukihiro "Matz" Matsumoto
2021-04-26Merge pull request #5423 from dearblue/gc-redYukihiro "Matz" Matsumoto
Introduce `MRB_GC_RED`
2021-04-25Merge pull request #5422 from dearblue/binding1Yukihiro "Matz" Matsumoto
Avoid ill-advised `goto`
2021-04-24Skip tests that use `Float` inside; ref #5421Yukihiro "Matz" Matsumoto
2021-04-24time.c: `fixable_time_t_p` is not used with `MRB_NO_FLOAT`; #5421Yukihiro "Matz" Matsumoto
2021-04-24random.c: refactoring; #5421Yukihiro "Matz" Matsumoto
- `Random.rand` with `MRB_NO_FLOAT` behaves as `Random.rand(100)` - `Random.rand(i)` where `i<0` raises `ArgumentError`
2021-04-24Introduce `MRB_GC_RED`dearblue
Replaces the magic number `7` except in `src/gc.c`.
2021-04-23Avoid ill-advised `goto`dearblue
ref #5362
2021-04-23time.c: `time_t` may be unsigned on some platforms.Yukihiro "Matz" Matsumoto
2021-04-22error.h: rename `mrb_protect_raw` to `mrb_protect_error`; #5415Yukihiro "Matz" Matsumoto
- `_raw` does not describe the nature of the function - the function protect errors during C function execution