Age | Commit message (Collapse) | Author |
---|
| Notes: Merged: https://github.com/ruby/ruby/pull/12715 |
| Notes: Merged: https://github.com/ruby/ruby/pull/12688 |
| Notes: Merged: https://github.com/ruby/ruby/pull/12643 |
| Ruby Parser not used rb_obj_as_string. And obj_as_string property can be removed from Universal Parser. Notes: Merged: https://github.com/ruby/ruby/pull/12603 |
| Ruby Parser not used SYM2ID. And sym2id property can be removed from Universal Parser. Notes: Merged: https://github.com/ruby/ruby/pull/12507 |
| Notes: Merged: https://github.com/ruby/ruby/pull/12493 |
| Notes: Merged: https://github.com/ruby/ruby/pull/12046 |
| rb_ary_new function was not used by the parser and could be removed. Notes: Merged: https://github.com/ruby/ruby/pull/11734 |
| Notes: Merged: https://github.com/ruby/ruby/pull/11713 |
| Changed to use `rb_parser_is_ascii_string` function instead of `is_ascii_string` function Notes: Merged: https://github.com/ruby/ruby/pull/11698 |
| Notes: Merged: https://github.com/ruby/ruby/pull/11672 |
| This change is reduce Ruby C API dependency for Universal Parser. Reuse dedent_string functions in rb_ruby_ripper_dedent_string functions and remove dependencies on rb_str_modify and rb_str_set_len from the parser. Notes: Merged: https://github.com/ruby/ruby/pull/11658 |
| StringValueCStr has not used in parse.y |
| Recently, `TestRubyLiteral#test_float` fails randomly. ``` 1) Error: TestRubyLiteral#test_float: ArgumentError: SyntaxError#path changed: "(eval at /home/chkbuild/chkbuild/tmp/build/20240527T050036Z/ruby/test/ruby/test_literal.rb:642)"->"(eval at /home/chkbuild/chkbuild/tmp/build/20240527T050036Z/ruby/test/ruby/test_literal.rb:642)" ``` https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20240527T050036Z.fail.html.gz According to Launchable, the first failure was on Apr 30. This is just when 528c4501f46fbe1e06028d673a777ef124d29829 was committed. I don't know if the change is really the cause, but I want to revert it once to see if the random failure disappears. |
| Fixed warning about discarding modifiers. ``` ../src/ruby_parser.c:677:48: warning: passing 'rb_encoding *' (aka 'const struct OnigEncodingTypeST *') to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 677 | ast = rb_parser_compile(p, gets, ptr, len, enc, input, line); | ^~~ ../src/internal/parse.h:58:128: note: passing argument to parameter 'fname_enc' here 58 | rb_ast_t *rb_parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, const char *fname_ptr, long fname_len, rb_encoding *fname_enc, rb_parser_input_data input, int line); | ^ ``` |
| This reduces dependency on VALUE. |
| |
| |
| |
| |
| |
| |
| |
| |
| `st_init_table_with_size` is already defined in universal_parser.c. |
| |
| |
| |
| |
| |
| |
| No parser semantic value types are `VALUE` then no need to use imemo for managing semantic value stack anymore. |
| clause duplication This commit simplifies warnings for hash keys duplication and when clause duplication, based on the discussion of https://bugs.ruby-lang.org/issues/20331. Warnings are reported only when strings are same to ohters. |
| |
| - Introduce `rb_parser_ary_t` structure to partly eliminate RArray from parse.y - In this patch, `parser_params->tokens` and `parser_params->ast->node_buffer->tokens` are now `rb_parser_ary_t *` - Instead, `ast_node_all_tokens()` internally creates a Ruby Array object from the `rb_parser_ary_t` - Also, delete `rb_ast_tokens()` and `rb_ast_set_tokens()` in node.c - Implement `rb_parser_str_escape()` - This is a port of the `rb_str_escape()` function in string.c - `rb_parser_str_escape()` does not depend on `VALUE` (RString) - Instead, it uses `rb_parser_stirng_t *` - This function works when --dump=y option passed - Because WIP of the universal parser, similar functions like `rb_parser_tokens_free()` exist in both node.c and parse.y. Refactoring them may be needed in some way in the future - Although we considered redesigning the structure: `ast->node_buffer->tokens` into `ast->tokens`, we leave it as it is because `rb_ast_t` is an imemo. (We will address it in the future) |
| This commit changes rb_fstring to rb_str_to_interned_str in parse.y. rb_fstring is private so it shouldn't be used by ripper. |
| |
| |
| Co-authored-by: Yuichiro Kaneko <spiketeika@gmail.com> |
| |
| For example: 10.times do 100_000.times do eval('{"\xC3": 1}') rescue EncodingError end puts `ps -o rss= -p #{$$}` end Before: 32032 48464 66112 84192 100592 117520 134096 150656 167168 183760 After: 17120 17120 17120 17120 18560 18560 18560 18560 18560 18560 |
| String nodes holds ruby string object on `VALUE nd_lit`. This commit changes it to `struct rb_parser_string *string` to reduce dependency on ruby object. Sometimes these strings are concatenated with other string therefore string concatenate functions are needed. |
| Introduce `rb_node_const_decl_val` function to allow `rb_ary_join` and `rb_ary_reverse` functions to be removed from Universal Parser. |
| |
| |
| |
| |
| |
| |
| NODE_ARGS, NODE_ARYPTN, NODE_FNDPTN manage memory of their structure by imemo tmpbuf Object. However rb_ast_struct has reference to NODE. Then these memory can be freed directly when rb_ast_struct is freed. This commit reduces parser's dependency on CRuby functions. |