Yukihiro "Matz" Matsumoto
a3fe04eda2
Merge pull request #5548 from mruby/dependabot/github_actions/github/super-linter-4.7.2
...
build(deps): bump github/super-linter from 4.7.1 to 4.7.2
2021-09-09 07:34:02 +09:00
dependabot[bot]
ddf2a49622
build(deps): bump github/super-linter from 4.7.1 to 4.7.2
...
Bumps [github/super-linter](https://github.com/github/super-linter ) from 4.7.1 to 4.7.2.
- [Release notes](https://github.com/github/super-linter/releases )
- [Changelog](https://github.com/github/super-linter/blob/master/docs/release-process.md )
- [Commits](https://github.com/github/super-linter/compare/v4.7.1...v4.7.2 )
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2021-09-08 14:04:32 +00:00
Yukihiro "Matz" Matsumoto
e4a0728b24
array.c: refactor mrb_ary_splice.
2021-09-08 07:33:08 +09:00
Yukihiro "Matz" Matsumoto
1d1a89874f
value.h: fixed address comparison on macOS.
2021-09-07 18:51:04 +09:00
Yukihiro "Matz" Matsumoto
cbfaa5e20f
object.c: rename mrb_to_int to mrb_to_integer.
...
Consistent naming: `integer` to represent integer packed in `mrb_value`
instead of `int`.
2021-09-07 14:31:56 +09:00
Yukihiro "Matz" Matsumoto
79bc8e2539
string.h: rename mrb_str_to_inum to mrb_str_to_integer.
...
Consistent naming: `integer` to represent integer packed in `mrb_value`
instead of `inum`.
2021-09-07 14:31:56 +09:00
Yukihiro "Matz" Matsumoto
674d841ead
eval.c: if the parser raises an exception without an error message
...
`eval` would have crashed in formatting.
2021-09-07 07:37:19 +09:00
Yukihiro "Matz" Matsumoto
711f06a562
eval.c: check length of the file name.
...
It should be lexx than `UINT16_MAX`. If you don't check here, the parser
would raise an exception.
2021-09-07 07:35:35 +09:00
Yukihiro "Matz" Matsumoto
6fc6880f1f
codegen.c: improve exception handling in generate_code.
...
- remove `mrb_jmpbuf` from `codegen_scope`
- unify exception handling of `mrb_state` and `codegen_scope`
2021-09-07 07:33:28 +09:00
Yukihiro "Matz" Matsumoto
2fb06aabe6
parse.y: refactor mrb_parser_parse().
...
- remove `mrb_jmpbuf` from `truct mrb_parser_state`
- unify exception handling of `mrb_state` and `mrb_parser_state`.
2021-09-07 07:31:21 +09:00
Yukihiro "Matz" Matsumoto
ad3404229f
parse.y: refactoring mrb_parser_parser().
2021-09-06 13:58:01 +09:00
Yukihiro "Matz" Matsumoto
fc1f7c4bf0
numeric.c: shortcut overflowing operation when ndigit is too small.
2021-09-06 10:21:42 +09:00
Yukihiro "Matz" Matsumoto
ab3db07752
boxing_word.h: avoid mrb_float_p() when MRB_NO_FLOAT is on; fix #5546
2021-09-05 20:59:49 +09:00
Yukihiro "Matz" Matsumoto
43abf36f00
array.c: check integer overflow before addition.
2021-09-05 16:41:08 +09:00
Yukihiro "Matz" Matsumoto
7552b9322a
codegen.c: avoid integer overflow.
2021-09-05 09:25:44 +09:00
Yukihiro "Matz" Matsumoto
28c4f2f683
kernel.c: add __method__; ref #4468
2021-09-04 17:57:35 +09:00
Yukihiro "Matz" Matsumoto
09f686cd7b
Merge branch 'shuujii-rename-Kernel-__method__-to-Kernel-__callee__'
2021-09-04 16:18:20 +09:00
KOBAYASHI Shuji
8a9f891fd3
Rename Kernel#__method__ to Kernel#__callee__
...
Because the current behavior of `__method__` is equivalent to `__callee__`.
Example:
# example.rb
def src
__send__(ARGV[0])
end
alias dst src
%w[src dst].each {|n| puts "call #{n} => #{__send__(n).inspect}"}
Ruby:
$ ruby example.rb __method__
call src => :src
call dst => :src
$ ruby example.rb __callee__
call src => :src
call dst => :dst
mruby:
$ mruby example.rb __method__
call src => :src
call dst => :dst
2021-09-04 16:17:06 +09:00
Yukihiro "Matz" Matsumoto
2d8f4fa92f
proc.c: need to preserve target_class in callinfo.
...
Otherwise `target_class` can be lost when it differs from `proc`'s
`target_class`, e.g. when called from `instance_eval`.
Also we should not pass `target_class` to `MRB_OBJ_ALLOC` since it
checks instance type from the class, and `target_class` may not have
proper information. ref #5272
2021-09-04 13:50:32 +09:00
Yukihiro "Matz" Matsumoto
5acf7e7cf7
vm.c: remove duplicated calls of mrb_vm_ci_target_class().
2021-09-04 12:54:04 +09:00
Yukihiro "Matz" Matsumoto
e02350dd02
range.c: len = b - a may overflow.
2021-09-03 16:30:42 +09:00
Yukihiro "Matz" Matsumoto
dc4b60291a
range.c: hide internal `__num_to_a' method from backtrace.
2021-09-03 16:30:42 +09:00
Yukihiro "Matz" Matsumoto
161f2403b3
Merge pull request #5545 from mruby/dependabot/github_actions/github/super-linter-4.7.1
...
build(deps): bump github/super-linter from 4.6.3 to 4.7.1
2021-09-02 07:26:25 +09:00
dependabot[bot]
a6bb53f65a
build(deps): bump github/super-linter from 4.6.3 to 4.7.1
...
Bumps [github/super-linter](https://github.com/github/super-linter ) from 4.6.3 to 4.7.1.
- [Release notes](https://github.com/github/super-linter/releases )
- [Changelog](https://github.com/github/super-linter/blob/master/docs/release-process.md )
- [Commits](https://github.com/github/super-linter/compare/v4.6.3...v4.7.1 )
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2021-09-01 14:06:39 +00:00
Yukihiro "Matz" Matsumoto
de9bf86432
Merge pull request #5544 from stuarth/change-language
...
Use gender-neutral pronouns
2021-09-01 13:59:04 +09:00
Stuart Hinson
2c167361d5
use gender-neutral pronouns
2021-08-31 19:17:49 -07:00
Yukihiro "Matz" Matsumoto
5211a3f209
Merge pull request #5543 from mruby/dependabot/github_actions/github/super-linter-4.6.3
...
build(deps): bump github/super-linter from 4.6.2 to 4.6.3
2021-09-01 07:03:01 +09:00
Yukihiro "Matz" Matsumoto
41d0b343e6
string.c: need to adjust index for UTF-8.
2021-09-01 07:00:56 +09:00
Yukihiro "Matz" Matsumoto
7ffffbfe01
build_config/ci/gcc-clang.rb: enable MRB_UTF8_STRING.
2021-09-01 07:00:55 +09:00
Yukihiro "Matz" Matsumoto
3622f2c4b5
string.c: implement __sub_replace() in C.
...
To reduce number of string allocation.
2021-09-01 07:00:55 +09:00
Yukihiro "Matz" Matsumoto
2c41739b66
mruby.h: obsolete mrb_to_str().
...
Replace them by `mrb_ensure_string_type()`.
2021-09-01 07:00:55 +09:00
Yukihiro "Matz" Matsumoto
082882da69
string.rb: avoid internal __to_str calls.
...
`__to_str` was a mere type check method despite its name.
2021-09-01 07:00:55 +09:00
Yukihiro "Matz" Matsumoto
8c296a3818
object.c: remove `mrb_convert_to_integer()' function.
...
And merged to `mrb_f_integer()` which is only usage of the function.
2021-09-01 07:00:54 +09:00
Yukihiro "Matz" Matsumoto
37a7ff228b
string-ext/string.c: implement casecmp in C.
...
* should not raise error for non-string arguments
* avoid allocating case converted string internally
2021-09-01 07:00:54 +09:00
Yukihiro "Matz" Matsumoto
f6e5c902f0
string.h: obsolete mrb_str_to_str(), even from examples.
2021-09-01 07:00:54 +09:00
Yukihiro "Matz" Matsumoto
e86c9cb57c
Do no use return values from mrb_ensure_ functions.
...
They return the checking argument without modification, so the values
are already there. Maybe we should change the return type to `void` but
keep them unchanged for compatibility.
2021-09-01 07:00:54 +09:00
Yukihiro "Matz" Matsumoto
572a43de84
mruby.h: reorganize mrb_ensure/check functions in headers.
2021-09-01 07:00:53 +09:00
dependabot[bot]
ad5c90e556
build(deps): bump github/super-linter from 4.6.2 to 4.6.3
...
Bumps [github/super-linter](https://github.com/github/super-linter ) from 4.6.2 to 4.6.3.
- [Release notes](https://github.com/github/super-linter/releases )
- [Commits](https://github.com/github/super-linter/compare/v4.6.2...v4.6.3 )
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2021-08-31 14:07:23 +00:00
Yukihiro "Matz" Matsumoto
64d5a40cde
Merge pull request #5542 from dearblue/mrb_get_args-cI
...
Allow `nil` for `c!` and `I!` specifiers of `mrb_get_args()`
2021-08-30 07:38:45 +09:00
Yukihiro "Matz" Matsumoto
84e36d748c
Merge pull request #5541 from dearblue/mrb_get_args-oCSAH
...
Integrate the processing of similar specifiers of `mrb_get_args()`
2021-08-29 08:32:05 +09:00
dearblue
f99620436d
Allow nil for c! and I! specifiers of mrb_get_args()
2021-08-28 15:54:30 +09:00
dearblue
c9f7bcc0cf
Integrate the processing of similar specifiers of mrb_get_args()
...
It is `o`, `C`, `S`, `A` and `H` specifiers that are integrated.
As a side effect, the `C!` Specifier can now be used.
2021-08-28 15:52:37 +09:00
Yukihiro "Matz" Matsumoto
07f12fe890
Merge pull request #5540 from dearblue/mrb_get_args
...
Refactor the `mrb_get_args()` function
2021-08-28 12:50:47 +09:00
dearblue
6ac8d14b7b
Refactor the mrb_get_args() function
...
- Removed the `ARGV` macro.
The current path doesn't go into the mruby VM and there's also no need to separate variables.
- Use common functions to check object types.
- Use `mrb_ensure_string_type()` to check the string instead of `mrb_to_str()`.
This is for consistency with array and hash.
- Use `mrb_ensure_array_type()` to check the array instead of `to_ary()`.
- Use `mrb_ensure_hash_type()` to check the hash instead of `to_hash()`.
- Add and use `ensure_class_type()` to check class and module.
- Changed the argument index type from `mrb_int` to `int`.
Even if it is `int16_t`, it is enough.
`mrb_int` is overkill, especially if `MRB_32BIT` and `MRB_INT64` are defined.
2021-08-27 22:43:25 +09:00
Yukihiro "Matz" Matsumoto
12a483c1bc
Merge pull request #5539 from mruby/dependabot/github_actions/github/super-linter-4.6.2
...
build(deps): bump github/super-linter from 4.6.1 to 4.6.2
2021-08-27 07:43:48 +09:00
dependabot[bot]
86c5414dc1
build(deps): bump github/super-linter from 4.6.1 to 4.6.2
...
Bumps [github/super-linter](https://github.com/github/super-linter ) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/github/super-linter/releases )
- [Commits](https://github.com/github/super-linter/compare/v4.6.1...v4.6.2 )
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2021-08-26 14:05:40 +00:00
Yukihiro "Matz" Matsumoto
4654de9074
etc.c: keep full float32 with MRB_64BIT and MRB_USE_FLOAT32.
2021-08-26 16:06:02 +09:00
Yukihiro "Matz" Matsumoto
ba6e121537
boxing_nan.h: rename prefix BOXNAN to NANBOX.
2021-08-26 16:06:02 +09:00
Yukihiro "Matz" Matsumoto
9d6755569e
boxing_word.h: rename prefix BOXWORD to WORDBOX.
2021-08-26 16:06:01 +09:00
Yukihiro "Matz" Matsumoto
fdfa0caa46
boxing_word.h: rename configuration macro name.
...
`MRB_WORDBOX_USE_HEAP_FLOAT` instead of `MRB_USE_FLOAT_FULL_PRECISION`.
2021-08-26 16:06:01 +09:00