| Age | Commit message (Collapse) | Author |
|
|
|
|
|
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)
```
|
|
|
|
|
|
|
|
* mrb_sym2name -> mrb_sym_name
* mrb_sym2name_len -> mrb_sym_name_len
* mrb_sym2str -> mrb_sym_str
|
|
Support parsing a Regexp literal with 'o' option
|
|
#4706"
The `bison` on MacOS does not support `%define api.pure`.
This reverts commit f7c9f1f796d83b9316917681ea068ff648248425.
|
|
|
|
`strncat()` also needs `'\0'`.
|
|
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in
my environment than before the introduction of new specifiers/modifiers
(5116789a) with this change.
------------+-------------------+-------------------+--------
BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO
------------+-------------------+-------------------+--------
mruby | 593416 bytes | 593208 bytes | -0.04%
libmruby.a | 769048 bytes | 767264 bytes | -0.23%
------------+-------------------+-------------------+--------
BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613,
so I put it back.
|
|
Also fix the misfeature introduced in 23783a4, that ignores newlines
between method chains.
|
|
Originally, it was not necessary to change. I made mistake.
|
|
|
|
CRuby supports a 'o' `Regexp` option for `Regexp` literals, e.g. `/foo/o` that disables multiple interpolation passes.
This commit adds support for parsing such literals. Nothing is done with the option, it is consumed and ignored by the parser.
|
|
|
|
|
|
|
|
|
|
It used heap allocated memory for the parser stack, but there's
possibility of parser termination by exceptions. In that case, the
parser stack memory is leaked.
We were afraid of stack consumption, but parser stack size is only 4KB,
so we don't have to worry about it (at least for the parser).
|
|
|
|
|
|
|
|
Removed duplicates in the code entered for "Concatenate string literal".
|
|
`sizeof(string-literal)` is included `'\0'` character
|
|
|
|
|
|
|
|
|
|
The addresses for packed inline symbols reference `mrb->symbuf` that
could be overridden by the later call of `mrb_sym2name_len`. Since
file names in call stack information are kept as symbols, keeping the
address in the C structures could cause problems like #4342.
This changes small incompatible changes in function prototypes:
* `mrb_parser_get_filename`: return value changed to `mrb_sym`.
* `mrb_debug_get_filename`: add `mrb_state*` as a first argument.
* `mrb_debug_get_line`: ditto.
I believe above functions are almost internal, and no third-party
mrbgem use them.
|
|
|
|
|
|
Remove unnecessary backticks; ref #2858
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
So that `lambda{}.call(1)` raises `ArgumentError` as CRuby does.
Also, fixed junk assignment for `lambda{|;a|p a}.call{}`.
|