diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-10-01 17:07:30 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-10-01 17:07:30 +0900 |
| commit | 732ef6b10ed7282d7cdc8f9fbd80572a42e02903 (patch) | |
| tree | e2c4f18a79e51493468ec77baab75c47149ddfab | |
| parent | 16745261e39c813b6a53e44e07a6f03d45085310 (diff) | |
| download | mruby-732ef6b10ed7282d7cdc8f9fbd80572a42e02903.tar.gz mruby-732ef6b10ed7282d7cdc8f9fbd80572a42e02903.zip | |
Support `NODE_WORDS` in `mrb_parser_dump`
#### 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)
```
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index abdc36b9f..c999782a7 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -6940,6 +6940,11 @@ mrb_parser_dump(mrb_state *mrb, node *tree, int offset) mrb_parser_dump(mrb, tree, offset+1); break; + case NODE_WORDS: + printf("NODE_WORDS:\n"); + dump_recur(mrb, tree, offset+1); + break; + case NODE_SELF: printf("NODE_SELF\n"); break; |
