| Age | Commit message (Collapse) | Author |
|
|
|
|
|
- It can now deal with operands in the range of `OP_EXT*`.
- It can now call the same method as the variable name without arguments.
```ruby
def a
"Safe!"
end
a = "Auto!"
eval "a()" # call method `a`
```
|
|
I sometimes see Bison related problems in setting up build environments.
Therefore to remove Bison from build time dependencies, add `y.tab.c`
generated by Bison to the repository.
The reduction of dependency at build time also reduces the labor and time
for setup and installation in CI.
In addition, a path in `#line` directive is converted to a relative path so
that its path is constant regardless of development environments.
|
|
Instead we added `%define parse.error verbose`.
|
|
It was making a negative integer if the highest-order bit of a 16-bit
integer was 1.
no patched:
```ruby
p 0x7fff # => 32767
p 0x8000 # => -32768
p 0xffff # => -1
p 0x10000 # => 65536
```
|
|
Which loads 16bit integer to the register. The instruction number should
be reorder on massive instruction refactoring. The instruction is added
for `mruby/c` which had performance issue with `OP_EXT`. With this
instruction, `mruby/c` VM can just raise errors on `OP_EXT` extension
instructions.
|
|
|
|
|
|
This reverts commit 682a31f92b3ac86ca59f7e8e740197e50b4452e5.
Unfortunately, I couldn't run newer `bison` on TravisCI. Maybe next
time.
|
|
Recent `bison` warns for `%pure-parser`. We kept it since MacOS only
provide ancient `bison`, but the warning is noisy and there's no hope
that Apple will upgrade `bison`. MacOS users must install the newer
version of `bison`, by typing `brew install bison` for example.
Note that `brew` does not overwrite the `bison` execution path
automatically, so you need to update your `.bash_profile` as instructed
by `brew`.
|
|
|
|
|
|
This is reported by oss-fuzz:
Issue 19886: mruby:mruby_fuzzer: Potential-null-reference in setup_numparams
|
|
The basic idea of this change is from @dearblue.
Note: the arguments of `mrb_str_pool()` have changed, but the function
is provided for internal use (No `MRB_API`). So basically you don't have
to worry about the change.
|
|
|
|
|
|
It is stricter than CRuby but confusing anyway.
|
|
But it causes warnings as CRuby does; fix #4892 fix #489
|
|
|
|
As of CRuby2.7 it is only warned. `mruby` prohibits explicitly to
implement the future Ruby3 behavior.
|
|
|
|
`mruby` does not warn like `CRuby` for cases like #4893.
Fix #4890, fix #4891, fix #4893.
|
|
#### Before this patch:
```console
$ bin/mruby rb -e '_0=:l; p ->{_0}.()'
-e:1:13: _0 is not available
-e:1:13: syntax error, unexpected $end, expecting '}'
```
#### After this patch (same as Ruby):
```console
$ bin/mruby rb -e '_0=:l; p ->{_0}.()'
:l
```
|
|
|
|
|
|
Now identifiers like `_1abc` are allowed.
|
|
|
|
|
|
I think they can always be enabled because the regular expression literal is
always enabled.
|
|
#### Before this patch:
```
$ bin/mruby -e 'p <<EOS
1
EOS'
-e:4:0: can't find heredoc delimiter "EOS" anywhere before EOF
-e:4:0: syntax error, unexpected $end, expecting tHEREDOC_END or tHD_STRING_PART or tHD_STRING_MID
```
#### After this patch (same as Ruby):
```
$ bin/mruby -e 'p <<EOS
1
EOS'
"1\n"
```
|
|
|
|
|
|
This is caused by incomplete fix in #4746
|
|
|
|
|
|
|
|
Besides that fix bugs that mistakenly calls `raise_error` that emits
code to raise runtime error instead of `codegen_error` that terminates
code generation immediately.
|
|
|
|
|
|
For example, local variables in the following def:
```ruby
def foo(a = (not_set = true), &block)
...
end
```
should be `a, block, not_set`, but were `a, not_set, block`.
|
|
|
|
Escape the AST string
|
|
#### Before this patch:
```terminal
$ bin/mruby -v -e '%w[1 2]'
mruby 2.0.1 (2019-04-04)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 NODE_WORDS:
00001 NODE_STR "1" len 1
00001 node type: 85 (0x55)
00001 NODE_STR "2" len 1
(snip)
```
#### After this patch:
```terminal
$ bin/mruby -v -e '%w[1 2]'
mruby 2.0.1 (2019-04-04)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 NODE_WORDS:
00001 NODE_STR "1" len 1
00001 NODE_LITERAL_DELIM
00001 NODE_STR "2" len 1
(snip)
```
|
|
#### Before this patch:
```terminal
$ bin/mruby -v -e '%i[1]; %I[#{2}]'
mruby 2.0.1 (2019-04-04)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 node type: 87 (0x57)
00001 node type: 87 (0x57)
(snip)
```
#### After this patch:
```terminal
$ bin/mruby -v -e '%i[1]; %I[#{2}]'
mruby 2.0.1 (2019-04-04)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 NODE_SYMBOLS:
00001 NODE_STR "1" len 1
00001 NODE_SYMBOLS:
00001 NODE_STR "" len 0
00001 NODE_BEGIN:
00001 NODE_INT 2 base 10
00001 NODE_STR "" len 0
(snip)
```
|
|
#### Before this patch:
```terminal
$ bin/mruby -v -e '%w[1]; %W[#{2}]'
mruby 2.0.1 (2019-04-04)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 node type: 86 (0x56)
00001 node type: 86 (0x56)
(snip)
```
#### After this patch:
```terminal
$ bin/mruby -v -e '%w[1]; %W[#{2}]'
mruby 2.0.1 (2019-04-04)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 NODE_WORDS:
00001 NODE_STR "1" len 1
00001 NODE_WORDS:
00001 NODE_STR "" len 0
00001 NODE_BEGIN:
00001 NODE_INT 2 base 10
00001 NODE_STR "" len 0
(snip)
```
|
|
#### Before this patch:
```terminal
$ bin/mruby -v -e ':"#{1}"; ["#{2}": 0]'
mruby 2.0.1 (2019-04-04)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 node type: 83 (0x53)
00001 NODE_ARRAY:
00001 NODE_KW_HASH:
00001 key:
00001 node type: 83 (0x53)
00001 value:
00001 NODE_INT 0 base 10
(snip)
```
#### After this patch:
```terminal
$ bin/mruby -v -e ':"#{1}"; ["#{2}": 0]'
mruby 2.0.1 (2019-04-04)
00001 NODE_SCOPE:
00001 NODE_BEGIN:
00001 NODE_DSYM:
00001 NODE_DSTR:
00001 NODE_STR "" len 0
00001 NODE_BEGIN:
00001 NODE_INT 1 base 10
00001 NODE_STR "" len 0
00001 NODE_ARRAY:
00001 NODE_KW_HASH:
00001 key:
00001 NODE_DSYM:
00001 NODE_DSTR:
00001 NODE_STR "" len 0
00001 NODE_BEGIN:
00001 NODE_INT 2 base 10
00001 NODE_STR "" len 0
00001 value:
00001 NODE_INT 0 base 10
(snip)
```
|
|
|
|
|
|
|