- 10 Feb, 2021 3 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
- Move `#catch` definition to `mruby-catch.c` to avoid tweaking - Remove `#__preserve_catch_method` - Implement whole `#throw` method in C
-
-
- 09 Feb, 2021 1 commit
-
-
Yukihiro "Matz" Matsumoto authored
Ruby 2.5 is the oldest maintained version.
-
- 08 Feb, 2021 2 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
- 07 Feb, 2021 6 commits
-
-
Yukihiro "Matz" Matsumoto authored
Explicit top level task to clarify in `tasks/test.rake`
-
KOBAYASHI Shuji authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
Along with some refactoring on `mruby-math` tests.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
- 06 Feb, 2021 13 commits
-
-
dearblue authored
When there is a corresponding tag, the `RBreak` object is used to make a global jump. Like CRuby, it can't be caught by `rescue`. It is also the same as CRuby that it can be canceled in the middle by `ensure`. ### How to find the corresponding tag with `throw` The called `catch` method remains in the call stack, and the tag also remains in the stack at that time. So it is possible to find the called location by searching the two. Note that no method can be given to the `proc` object specified in `RBreak`. Therefore, inside the `catch` method, the argument block is called in a seemingly meaningless closure. Also, as a countermeasure against `alias` etc., the `proc` object, which is the body of the `catch` method, is saved when mrbgem is initialized.
-
Yukihiro "Matz" Matsumoto authored
Both MinGW and MSVC provide _WIN32 macro.
-
Yukihiro "Matz" Matsumoto authored
`compile_as_cxx` should generate a path under` conf.build_dir`
-
Yukihiro "Matz" Matsumoto authored
Ignore if `conf.enable_test` does not exist
-
Yukihiro "Matz" Matsumoto authored
No need to check class definition
-
dearblue authored
Because if the configuration file didn't contain any `conf.enable_test`, `rake test` would report an exception and exit. ```console % cat my_config.rb MRuby::Build.new { toolchain } % rake MRUBY_CONFIG=my_config.rb test ...SNIP... rake aborted! NoMethodError: undefined method `invoke' for nil:NilClass /var/tmp/mruby/tasks/test.rake:24:in `block (3 levels) in <top (required)>' Tasks: TOP => test => test:build => test:build:lib (See full trace by running task with --trace) ```
-
dearblue authored
Because now the `Struct` class is always defined when this file is included.
-
dearblue authored
If the current directory is different from `MRUBY_ROOT` and it has` conf.build_dir` and `conf.enable_cxx_exception` set, it was generating a pathname outside of` build_dir`. As a result, in some cases files unrelated to mruby could be linked. ```console % pwd /tmp/mruby/1/2/3/4/5/6 % mruby_dir=/tmp/mruby/a/b/c/d/mruby % cat my_config.rb MRuby::Build.new("host", "build/to/custom/directory") do toolchain enable_cxx_exception end % rake MRUBY_CONFIG=my_config.rb -f $mruby_dir/Rakefile > logs % grep CXX logs CXX a/b/c/d/mruby/src/error-cxx.cxx -> a/b/c/d/mruby/src/error-cxx.o CXX a/b/c/d/mruby/src/gc-cxx.cxx -> a/b/c/d/mruby/src/gc-cxx.o CXX a/b/c/d/mruby/src/vm-cxx.cxx -> a/b/c/d/mruby/src/vm-cxx.o CXX a/b/c/d/mruby/mrbgems/mruby-compiler/core/codegen-cxx.cxx -> a/b/c/d/mruby/mrbgems/mruby-compiler/core/codegen-cxx.o CXX a/b/c/d/mruby/mrbgems/mruby-compiler/core/y.tab-cxx.cxx -> a/b/c/d/mruby/mrbgems/mruby-compiler/core/y.tab-cxx.o CXX ../a/b/c/d/mruby/src/error-cxx.cxx -> ../a/b/c/d/mruby/src/error-cxx.o CXX ../a/b/c/d/mruby/src/gc-cxx.cxx -> ../a/b/c/d/mruby/src/gc-cxx.o CXX ../a/b/c/d/mruby/src/vm-cxx.cxx -> ../a/b/c/d/mruby/src/vm-cxx.o ```
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
Exclude `<build-dir>/mrbc/**/*` from rake target rules
-
Yukihiro "Matz" Matsumoto authored
Make the argument of `Kernel#catch` optional as Ruby does
-
dearblue authored
Prevents the auto-generated mrbc target source code from being compiled under host conditions. This is because a build error occurred when `conf.enable_cxx_exception` was set.
-
KOBAYASHI Shuji authored
Also implement the following changes. * Add tests * Use `Object#equal?` to compare tags for Ruby compatibility * Use `attr_reader`
-
- 05 Feb, 2021 11 commits
-
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
Fix message of `ThrowCatchJump` in `mruby-catch` gem
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
* Use `_Complex` instead of `complex` (MSYS2 do not support `complex`) * Use `_Dcomplex` instead of `_Complex` on MSCV * Avoid operator division and multiplication of complex
-
KOBAYASHI Shuji authored
### Example ```ruby begin throw 1 rescue Exception => e puts e.message end ``` #### Before this patch: ```console $ bin/mruby example.rb uncaught throw :1 ``` #### After this patch (same as Ruby): ```console $ bin/mruby example.rb uncaught throw 1 ```
-
Yukihiro "Matz" Matsumoto authored
This gem uses C99 `_Complex` features. You need a C compiler that supports `_Complex` to enable this gem. All `gcc`, `clang`, `VC` support `_Complex` so there should not be a big problem.
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
* Use `class_eval` instead of `instance_eval`. * Reduce `class_eval` calls * define `Numeric#i` * undefine `Complex#i`
-
Yukihiro "Matz" Matsumoto authored
-
Yukihiro "Matz" Matsumoto authored
-
- 04 Feb, 2021 4 commits
-
-
Yukihiro "Matz" Matsumoto authored
Check if `.pi` build rules are defined
-
KOBAYASHI Shuji authored
`.pi` files are created for `.o` files that `build.products` depends on, but an error will occur if the build rule is unknown, so add a check. I don't think this situation would normally arise. However, in `mattn/mruby-onig-regexp`, when using bundled onigmo, onigmo's `.o` files are added to dependency of `libmruby.a` in the second and subsequent builds, and mruby does not know the build rule, so the following error had occured. ```console rake aborted! Don't know how to build task '/mruby/build/host/mrbgems/mruby-onig-regexp/onigmo-6.2.0/libonig_objs/ascii.pi' (See the list of available tasks with `rake --tasks`) ```
-
Yukihiro "Matz" Matsumoto authored
Fix breakage where builds except `host` don't refer` mrbc` in `host`
-
KOBAYASHI Shuji authored
Build error occurred under the following conditions. * `host` build is presym enabled and unspecified `mruby-bin-mrbc` gem. * Build except `host` unspecified `mruby-bin-mrbc` gem and mrbcfile. ### Example #### Build configuration ```ruby MRuby::Build.new{|conf| conf.toolchain} MRuby::Build.new("host2"){|conf| conf.toolchain} ``` #### Error ```console rake aborted! external mrbc or mruby-bin-mrbc gem in current('host2') or 'host' build is required /mruby/lib/mruby/build.rb:326:in `mrbcfile' /mruby/tasks/mrblib.rake:9:in `block in <top (required)>' /mruby/lib/mruby/build.rb:18:in `instance_eval' /mruby/lib/mruby/build.rb:18:in `block in each_target' /mruby/lib/mruby/build.rb:17:in `each' /mruby/lib/mruby/build.rb:17:in `each_target' /mruby/tasks/mrblib.rake:1:in `<top (required)>' /mruby/Rakefile:27:in `load' /mruby/Rakefile:27:in `<top (required)>' ```
-