summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
AgeCommit message (Collapse)Author
2022-02-27cleanup of build processHEADmasterrealtradam
2022-01-21added felflamerealtradam
2022-01-20development gem linkrealtradam
2022-01-18switch mruby-raylib gem to master brancharngo
2022-01-18use mruby-raylib gemarngo
2022-01-15started work on raylib bindingsrealtradam
2022-01-13added gemboxrealtradam
2022-01-11parse.y: numbered parameters should not appear on toplevel.Yukihiro "Matz" Matsumoto
Toplevel includes the top of the method/class/module definitions.
2022-01-11parse.y: move numbered parameter indexing to lexer.Yukihiro "Matz" Matsumoto
2022-01-10parse.y: `p->nvar` (numbered argument index list) may be `NULL`.Yukihiro "Matz" Matsumoto
2022-01-06Merge pull request #5628 from dearblue/super-kwargsYukihiro "Matz" Matsumoto
Fixing keyword arguments with `super`
2022-01-05mrbc.c: simplify place holder functions; #5622Yukihiro "Matz" Matsumoto
2022-01-05object.c: Call functions directly from `mrb_ensure_int_type()`; #5622Yukihiro "Matz" Matsumoto
2022-01-05Fixing keyword arguments with `super`dearblue
fix #5627
2021-12-31Call functions directly from `mrb_ensure_float_type()`dearblue
ref. commit 7f40b645d2773c8f50c48ae4adf90488e164da55 Currently, the build configurations `MRB_USE_COMPLEX` and `MRB_USE_RATIONAL` are not listed in the documentation. In other words, they are hidden settings. They are defined in `mrbgems/mruby-{complex,rational}/mrbgem.rake`. So this patch assumes that it is safe to refer to these functions in core-gems directly from core functions. However, applications that link with `libmruby_core.a` will have compatibility issues. In fact, `mrbgems/mruby-bin-mrbc` links with `libmruby_core.a`, so I had to prepare a dummy function.
2021-12-31Merge pull request #5619 from dearblue/propertiesYukihiro "Matz" Matsumoto
Get object properties after `mrb_get_args()`
2021-12-30Get object properties after `mrb_get_args()`dearblue
ref. #5613 I checked with Valgrind, and the methods that can cause use-after-free are `Array#rotate`, `Array#rotate!`, and `String#byteslice`. Since `String#rindex` uses `RSTRING_LEN()` indirectly inside the function, no reference to the out-of-bounds range is generated.
2021-12-29object.c: move string to float conversion to `mrb_f_float`.Yukihiro "Matz" Matsumoto
2021-12-28Fix build error and refine definition of `ssize_t` on MSVC.mimaki
2021-12-27parse.y: prohibit numbered parameters as arguments; fix #5605Yukihiro "Matz" Matsumoto
2021-12-25Fix summary typo for `mrbgems/mruby-compar-ext`dearblue
2021-12-24parse.y: allow arguments start with `_` to appear multiple times; fix #5604Yukihiro "Matz" Matsumoto
2021-12-23pack.c: check integer overflow in unpacking BER; fix #5611Yukihiro "Matz" Matsumoto
2021-12-22parse.y: adjust `void_expr_error()`; fix #5606Yukihiro "Matz" Matsumoto
Allow void expression on some places e.g. right hand of `rescue` modifier. In addition, checks added on some places, e.g. left hand of logical operators.
2021-12-20codegen.c: generate `OP_SETIDX`; close #5608Yukihiro "Matz" Matsumoto
Note that the current implantation only calls `[]=` method. No performance improvement. Just 2 bytes less byte code per assignment.
2021-12-19Merge pull request #5602 from dearblue/no-ext-opsYukihiro "Matz" Matsumoto
Add `bin/mrbc --no-ext-ops` switch
2021-12-17Print error before cleanup in `codegen_error()`dearblue
Previously, it always pointed to the highest scope as the location of the error. - example code `code.rb` ```ruby huge_num = "1" + "0" * 300; eval <<CODE, nil, "test.rb", 1 class Object module A #{huge_num} end end CODE ``` - Before this patch ```console % bin/mruby code.rb test.rb:1: integer too big trace (most recent call last): [1] code.rb:1 code.rb:1:in eval: codegen error (ScriptError) ``` - After this patch ```console % bin/mruby code.rb test.rb:3: integer too big trace (most recent call last): [1] code.rb:1 code.rb:1:in eval: codegen error (ScriptError) ```
2021-12-17Add `bin/mrbc --no-ext-ops` switchdearblue
Print an error if `OP_EXT[123]` is needed when generating mruby binary. This may be useful for mruby/c. Inspired by #5590.
2021-12-16string-ext.c: fix memory leak in `tr_parse_pattern`.Yukihiro "Matz" Matsumoto
2021-12-13string-ext/string.c: fixed memory leak from `tr` on exception.Yukihiro "Matz" Matsumoto
With some refactoring. * `ret` argument is always non-nil, so no check needed. * move allocation check right after malloc(). * simplify conditions.
2021-12-12Add `Array#{repeated_combination,repeated_permutation}` methodsdearblue
Ruby 1.9.2 feature. ref: https://docs.ruby-lang.org/ja/3.1.0/method/Array/i/repeated_combination.html ref: https://docs.ruby-lang.org/ja/3.1.0/method/Array/i/repeated_permutation.html
2021-12-07mruby-compiler/mrbgem.rake: fix regexp pattern; close #5591Yukihiro "Matz" Matsumoto
2021-12-02parse.y: support anonymous block argument introduced by Ruby3.1.Yukihiro "Matz" Matsumoto
2021-12-01codegen.c: `ADDI/SUBI` should not be prefixed by `OP_EXT`; fix #5590Yukihiro "Matz" Matsumoto
As a general principles numeric instructions should not be prefixed by `OP_EXT` instructions since they are not supported by "mruby/c".
2021-12-01codegen.c: skip `ADDI/SUBI` for zero operand.Yukihiro "Matz" Matsumoto
2021-12-01codegen.c: fix a bug in `OP_ADDI` and `OP_SUBI` regarding negative values.Yukihiro "Matz" Matsumoto
2021-12-01codegen.c: `get_int_operand` to retrieve negative values correctly.Yukihiro "Matz" Matsumoto
2021-11-29Merge pull request #5589 from dearblue/argerrYukihiro "Matz" Matsumoto
Align "wrong number of arguments" messages
2021-11-28Merge pull request #5588 from dearblue/cmath+clang++Yukihiro "Matz" Matsumoto
Fixed compile error for `mrbgems/mruby-cmath` with `clang++`
2021-11-28Align "wrong number of arguments" messagesdearblue
Make "N for M" into the form "given N, expected M". As I worked, I noticed that the `argnum_error()` function had a part to include the method name in the message. I think this part is no longer needed by https://github.com/mruby/mruby/pull/5394. - Before this patch ```console % bin/mruby -e '[1, 2, 3].each 0' trace (most recent call last): [1] -e:1 -e:1:in each: 'each': wrong number of arguments (1 for 0) (ArgumentError) ``` - After this patch ```console % bin/mruby -e '[1, 2, 3].each 0' trace (most recent call last): [1] -e:1 -e:1:in each: wrong number of arguments (given 1, expected 0) (ArgumentError) ```
2021-11-28Fixed compile error for `mrbgems/mruby-cmath` with `clang++`dearblue
If the preprocessor check part is only `__clang__`, CI's such as `Ubuntu-2004-clang` will fail to compile. This is why we limited the addition to FreeBSD and OpenBSD, which have `clang++` in their base systems. DragonFly BSD and NetBSD have GCC built into their base systems, so nothing is changed.
2021-11-28Fix `args_unshift()` in `mrbgems/mruby-method`dearblue
Both keyword arguments and block arguments were being destroyed when there were no arguments. The cause of this is #5585. I' m sorry.
2021-11-26Check more `MRB_ARGS_NONE()`dearblue
The `__id__` method implemented in the C function has `MRB_ARGS_NONE()` specified, but it is also effective in the following cases. ```ruby p nil.__id__ opts: 1 rescue p :a p nil.method(:__id__).call 1 rescue p :b p nil.method(:__id__).call opts: 1 rescue p :c p nil.method(:__id__).to_proc.call 1 rescue p :d p nil.method(:__id__).to_proc.call opts: 1 rescue p :e p nil.method(:__id__).unbind.bind_call nil, 1 rescue p :f p nil.method(:__id__).unbind.bind_call nil, opts: 1 rescue p :g p nil.__send__ :__id__, 1 rescue p :h p nil.__send__ :__id__, opts: 1 rescue p :i ``` After applying this patch, all items will output symbols in the same way as CRuby. For this purpose, add `MRB_PROC_NOARG` to `struct RProc::flags`.
2021-11-24Fixed some methods where keyword arguments are not passeddearblue
2021-11-22Fixed occurs `SIGSEGV` with `mrbgems/mruby-method`dearblue
Calling the `Method#{parameters,source_location}` method on a static `Proc` object resulted in `SIGSEGV`. The trigger is https://github.com/mruby/mruby/pull/5402. The original implementation of the `Method#{parameters,source_location}` method was to temporarily rewrite the object and then call the method of the same name in `Proc`. Rewriting of objects placed in the ROM section by #5402 above is prohibited by hardware such as the CPU. This caused a `SIGSEGV`.
2021-11-21parse.y: check duplicated argument names; fix #5575Yukihiro "Matz" Matsumoto
2021-11-20fixup! parse.y: unnamed rest argument should be `mul (*)`.Yukihiro "Matz" Matsumoto
2021-11-20parse.y: unnamed rest argument should be `mul (*)`.Yukihiro "Matz" Matsumoto
2021-11-20parse.y: skip unnecessary `local_add_f(p, 0)`.Yukihiro "Matz" Matsumoto
2021-11-17codegen.c: fixed a bug in post mandatory arguments.Yukihiro "Matz" Matsumoto