diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-09-30 11:54:51 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-09-30 11:54:51 +0900 |
| commit | 16745261e39c813b6a53e44e07a6f03d45085310 (patch) | |
| tree | ec585b34115e98ba52d06da3c705bff0bd4a0db8 | |
| parent | 9ddde3be391874b2ba3c7bb2fe510421aaa191c3 (diff) | |
| download | mruby-16745261e39c813b6a53e44e07a6f03d45085310.tar.gz mruby-16745261e39c813b6a53e44e07a6f03d45085310.zip | |
Support `NODE_DSYM` in `mrb_parser_dump`
#### 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)
```
| -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 e1d23f5d4..abdc36b9f 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -6935,6 +6935,11 @@ mrb_parser_dump(mrb_state *mrb, node *tree, int offset) intn(tree)); break; + case NODE_DSYM: + printf("NODE_DSYM:\n"); + mrb_parser_dump(mrb, tree, offset+1); + break; + case NODE_SELF: printf("NODE_SELF\n"); break; |
