According to the calloc(3) man page, when nmemb or size is 0, `calloc()` can either return NULL or a unique pointer that can be passed to `free()`. While gcc and clang typically return a unique pointer, mruby's `mrb_calloc()` returns NUL...hasumikin (hitoshi hasumi)
This patch moves `ast->node_buffer->config` to `ast->config` aiming to improve readability and maintainability of the source. ## Background We could not add the `config` field to the `rb_ast_t *` due to the five-word restriction of the...hasumikin (hitoshi hasumi)
This patch removes a code that assigns `-1` to `ast->body.line_count` because, at least as of now, it looks not necessary. I made this commit atomically revertable if I was wrong. ## Relevant commits - The preparation for this PR: http...hasumikin (hitoshi hasumi)
This patch adds `int line_count` field to `rb_ast_body_t` structure. Instead, we no longer cast `script_lines` to Fixnum. ## Background Ref https://github.com/ruby/ruby/pull/10618 In the PR above, we have decoupled IMEMO from `rb_ast_...hasumikin (hitoshi hasumi)
This patch removes the `VALUE flags` member from the `rb_ast_t` structure making `rb_ast_t` no longer an IMEMO object. ## Background We are trying to make the Ruby parser generated from parse.y a universal parser that can be used by ot...hasumikin (hitoshi hasumi)
This patch is part of universal parser work. ## Summary - Decouple VALUE from members below: - `(struct parser_params *)->debug_lines` - `(rb_ast_t *)->body.script_lines` - Instead, they are now `rb_parser_ary_t *` - They can also...hasumikin (hitoshi hasumi)
This patch suggests relocating the code dealing with `SCRIPT_LINES__` from ast.c to ruby_parser.c. ## Background - I guess `AbstractSyntaxTree.of` method used to use `SCRIPT_LINES__` internally for some reason before - However, now it ...hasumikin (hitoshi hasumi)
This patch surppresses the warning below: ```console compile.c:10314:1: warning: control reaches end of non-void function [-Wreturn-type] 10314 | } | ^ ```hasumikin (hitoshi hasumi)
For better compatibility, this patch suggests using __MINGW_PRINTF_FORMAT that GCC provides for MINGW environment. https://github.com/ruby/prism/commit/a3a792b64fhasumikin (hitoshi hasumi)
Under a configuration including `cppflags=-DUNIVERSAL_PARSER`, warnings listed below show in build time: ``` node.c:396:30: warning: initialization left-hand side might be a candidate for a format attribute [-Wsuggest-attribute=format] ...hasumikin (hitoshi hasumi)