- 06 Jul, 2021 2 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
https://github.com/cremno/mrubyYukihiro "Matz" Matsumoto authored
Merge branch 'mrb_debug_strdup-and-strndup' of https://github.com/cremno/mruby into cremno-mrb_debug_strdup-and-strndup
-
- 05 Jul, 2021 1 commit
-
-
Yukihiro "Matz" Matsumoto authored
To be compatible with CRuby.
-
- 03 Jul, 2021 2 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
- `Lit` -> `Pool` - `SEQ` -> `Irep`
-
- 02 Jul, 2021 5 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
The code generator no longer need to emit `OP_LOADSYM` after `OP_DEF`. `doc/opcode.md` is also updated.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
- 30 Jun, 2021 2 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
This reverts commit fd10c723. I thought it was OK to restrict index value within 1 byte, but in some cases index value could be 16 bits (2 bytes). I had several ideas to address the issue, but reverting `fd10c723` is the easiest way. The biggest reason is `mruby/c` still supports `OP_EXT[123]`, so that they don't need any additional work.
-
- 29 Jun, 2021 3 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
Drop unnecessary upper procs linked from class/module/def syntax
-
Yukihiro "Matz" Matsumoto authored
Avoid warnings with `ruby -cw`
-
- 28 Jun, 2021 3 commits
-
-
dearblue authored
```console % for rb in `git ls-files '*/mrblib/*.rb' 'mrblib'`; do ruby30 -cw $rb > /dev/null; done mrbgems/mruby-array-ext/mrblib/array.rb:389: warning: assigned but unused variable - ary mrbgems/mruby-array-ext/mrblib/array.rb:663: warning: assigned but unused variable - len mrbgems/mruby-hash-ext/mrblib/hash.rb:119: warning: possibly useless use of a variable in void context mrbgems/mruby-hash-ext/mrblib/hash.rb:259: warning: assigned but unused variable - keys mrbgems/mruby-io/mrblib/io.rb:229: warning: literal in condition mrbgems/mruby-io/mrblib/io.rb:280: warning: literal in condition mrbgems/mruby-string-ext/mrblib/string.rb:347: warning: assigned but unused variable - len mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb:2: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument ```
-
dearblue authored
It does not need to hold an anonymous proc for constant search. Also, this change can be expected to cause an anonymous proc to be GC'd. This is useful for metaprogramming that makes heavy use of the `class`/`module`/`def` syntax in the `class_eval`/`eval` method. Example: - code ```ruby p ObjectSpace.count_objects String.class_eval do def a end end p ObjectSpace.count_objects String.class_eval do eval <<~CODE def b end CODE end p ObjectSpace.count_objects ``` - result of building mruby-head (d63c0df6) with `build_config/default.rb` ``` {:TOTAL=>1024, :FREE=>262, :T_PROC=>495, :T_ENV=>61, ...} {:TOTAL=>1024, :FREE=>259, :T_PROC=>497, :T_ENV=>62, ...} {:TOTAL=>1024, :FREE=>255, :T_PROC=>500, :T_ENV=>63, ...} ``` - result of building mruby with this patch and `build_config/default.rb` ``` {:TOTAL=>1024, :FREE=>264, :T_PROC=>494, :T_ENV=>60, ...} {:TOTAL=>1024, :FREE=>262, :T_PROC=>495, :T_ENV=>61, ...} {:TOTAL=>1024, :FREE=>261, :T_PROC=>496, :T_ENV=>61, ...} ```
-
Yukihiro "Matz" Matsumoto authored
Fixed finding variables from `proc` in `binding.eval` failed
-
- 27 Jun, 2021 1 commit
-
-
Yukihiro "Matz" Matsumoto authored
Fixed finding variables defined in the upper proc failed
-
- 26 Jun, 2021 4 commits
-
-
dearblue authored
Previously the following code did not produce the expected results: ```ruby bx = binding block = bx.eval("a = 1; proc { a }") bx.eval("a = 2") p block.call # Expect 2 but return 1 due to a bug ``` The previous implementation of `Binding#eval` evaluated the code and then merged the top layer variables. This patch will parse and expand the variable space before making a call to `eval`. This means that the call to `Binding#eval` will do the parsing twice. In addition, the following changes will be made: - Make `mrb_parser_foreach_top_variable()`, `mrb_binding_extract_proc()` and `mrb_binding_extract_env()` functions private global functions. - Remove the `posthook` argument from `mrb_exec_irep()`. The `posthook` argument was introduced to implement the `binding` method. This patch is unnecessary because it uses a different implementation method. ref #5362 fixed #5491
-
Yukihiro "Matz" Matsumoto authored
Fix memory leak in `Kernel#eval`
-
dearblue authored
If no new variable was defined in the `eval` method, the variable was hidden from the nested `eval` method. ```ruby a = 1 p eval %(b = 2; eval %(a)) # => 1 (good) p eval %(eval %(a)) # => undefined method 'a' (NoMethodError) ``` This issue has occurred since mruby 3.0.0.
-
dearblue authored
The `mrbc_context` remained unreleased when the `mrb_parse_nstring()` function returned `NULL`.
-
- 25 Jun, 2021 1 commit
-
-
Yukihiro "Matz" Matsumoto authored
-
- 24 Jun, 2021 2 commits
-
-
Yukihiro "Matz" Matsumoto authored
- `Module#method_added` - `BasicObject#singleton_method_added`
-
Yukihiro "Matz" Matsumoto authored
-
- 23 Jun, 2021 2 commits
-
-
Yukihiro "Matz" Matsumoto authored
Add official pre-commit file-contents-sorter
-
John Bampton authored
Remove unneeded bash script sort-codespell-wordlist.sh https://github.com/pre-commit/pre-commit-hooks#file-contents-sorter
-
- 22 Jun, 2021 4 commits
-
-
Yukihiro "Matz" Matsumoto authored
* android_arm64-v8a.rb -> android_arm64_v8a.rb * no-float.rb -> host-nofloat.rb
-
Yukihiro "Matz" Matsumoto authored
Enable markdownlint rules MD003,MD005,MD007
-
Yukihiro "Matz" Matsumoto authored
pre-commit autoupdate
-
-
- 21 Jun, 2021 3 commits
-
-
John Bampton authored
Lint Markdown https://github.com/DavidAnson/markdownlint#rules--aliases
-
Yukihiro "Matz" Matsumoto authored
- `truncate` - `floor` - `ceil` `round` already takes `ndigits`.
-
Yukihiro "Matz" Matsumoto authored
Added `MRB_OBJ_ALLOC()` macro that does not require a cast
-
- 20 Jun, 2021 2 commits
- 19 Jun, 2021 3 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
dearblue authored
- ` mrb_block_given_p()` -- The name comes from CRuby's `rb_block_given_p ()` At the same time, it applies to `f_instance_eval()` and `f_class_eval()` of `mruby-eval`.
-