| Age | Commit message (Collapse) | Author |
|
|
|
Normally a single spell checker can't find all the mistakes or check all types of code.
These mistakes were found by another spell checker inside my editor with a more manual sift / find.
|
|
Run on pull request only.
Use a shell script to check for trailing whitespace in all files.
Fail if trailing whitespace is found.
|
|
Check if `esclen` is smaller than `len` (original string length).
|
|
Fix build `mruby-catch` gem without presym
|
|
|
|
|
|
|
|
|
|
- Move `#catch` definition to `mruby-catch.c` to avoid tweaking
- Remove `#__preserve_catch_method`
- Implement whole `#throw` method in C
|
|
dearblue-mruby-catch
|
|
|
|
|
|
Along with some refactoring on `mruby-math` tests.
|
|
|
|
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.
|
|
Both MinGW and MSVC provide _WIN32 macro.
|
|
Because now the `Struct` class is always defined when this file is included.
|
|
|
|
Also implement the following changes.
* Add tests
* Use `Object#equal?` to compare tags for Ruby compatibility
* Use `attr_reader`
|
|
|
|
shuujii/fix-message-of-ThrowCatchJump-in-mruby-catch-gem
Fix message of `ThrowCatchJump` in `mruby-catch` gem
|
|
|
|
|
|
* Use `_Complex` instead of `complex` (MSYS2 do not support `complex`)
* Use `_Dcomplex` instead of `_Complex` on MSCV
* Avoid operator division and multiplication of complex
|
|
### 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
```
|
|
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.
|
|
|
|
* Use `class_eval` instead of `instance_eval`.
* Reduce `class_eval` calls
* define `Numeric#i`
* undefine `Complex#i`
|
|
|
|
|
|
We have introduced following new instructions.
* `OP_LAMBDA16`
* `OP_BLOCK16`
* `OP_METHOD16`
* `OP_EXEC16`
Each instruction uses 16 bits operand for `reps` index. Since new
instructions are added, `mruby/c` VM should be updated.
Due to new instructions, dump format compatibility is lost, we have
increased `RITE_BINARY_MAJOR_VER`.
In addition, we have decreased the size of `refcnt` in `mrb_irep` from
`uint32_t` to `uint16_t`, which is reasonably big enough.
|
|
|
|
This is a correction based on the review by @matz.
https://github.com/mruby/mruby/pull/5306#pullrequestreview-578378401
|
|
Previously, problems occurred when the `fixnum` was exceeded.
- 32-bit cpu mode with `MRB_WORD_BOXING` and `MRB_INT32`:
```console
% bin/mruby -e 'p [0x7fffffff].pack("N").unpack("N")'
trace (most recent call last):
-e:1: cannot unpack to Integer: 2147483647 (RangeError)
```
- 64-bit cpu mode with `MRB_WORD_BOXING` and `MRB_INT64`:
```console
% bin/mruby -e 'p [0x7fffffff_ffffffff].pack("q").unpack("q")'
trace (most recent call last):
-e:1: cannot unpack to Integer: 9223372036854775807 (RangeError)
```
|
|
|
|
|
|
|
|
This reverts commit 34f82f24e941f36edc8d947a8a9300631b3121ff.
Ref #5282
|
|
Or no argument at all.
|
|
Where `mruby-config` command should be generated.
|
|
This reverts commit dc51d89ac22acc60b9bfeed87115863565b74085.
|
|
|
|
|
|
|
|
|
|
As CRuby does.
|
|
|
|
Instead of including `mruby/presym.h` everywhere, we provided the
fallback `mruby/presym.inc` under `include/mruby` directory, and specify
`-I<build-dir>/include` before `-I<top-dir>/include` in `presym.rake`.
So even when someone drops `-I<build-dir>/include` in compiler options,
it just compiles without failure.
|
|
https://github.com/shuujii/mruby into shuujii-avoid-including-presym.inc-in-existing-header-files
|