diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-01-14 17:55:11 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-01-14 17:55:11 +0900 |
commit | 0610f555ea4f3ba571482f90393fe8c0701cd58a () | |
tree | ad0a25d4edfe51b545debf9e7e959f82b9f8d417 | |
parent | 4e5754a459ea10c73381b3009bb889e83077575c (diff) |
Constify `rb_global_parser_config`
-rw-r--r-- | node.c | 4 | ||||
-rw-r--r-- | node.h | 4 | ||||
-rw-r--r-- | parse.y | 6 | ||||
-rw-r--r-- | ruby_parser.c | 2 | ||||
-rw-r--r-- | rubyparser.h | 4 |
5 files changed, 10 insertions, 10 deletions
@@ -53,7 +53,7 @@ init_node_buffer_list(node_buffer_list_t * nb, node_buffer_elem_t *head, void *x #ifdef UNIVERSAL_PARSER static node_buffer_t * -rb_node_buffer_new(rb_parser_config_t *config) #else static node_buffer_t * rb_node_buffer_new(void) @@ -318,7 +318,7 @@ rb_ast_delete_node(rb_ast_t *ast, NODE *n) #ifdef UNIVERSAL_PARSER rb_ast_t * -rb_ast_new(rb_parser_config_t *config) { node_buffer_t *nb = rb_node_buffer_new(config); return config->ast_new((VALUE)nb); @@ -43,14 +43,14 @@ struct node_buffer_struct { // Array, whose entry is array VALUE tokens; #ifdef UNIVERSAL_PARSER - rb_parser_config_t *config; #endif }; RUBY_SYMBOL_EXPORT_BEGIN #ifdef UNIVERSAL_PARSER -rb_ast_t *rb_ast_new(rb_parser_config_t *config); #else rb_ast_t *rb_ast_new(void); #endif @@ -611,7 +611,7 @@ struct parser_params { struct lex_context ctxt; #ifdef UNIVERSAL_PARSER - rb_parser_config_t *config; #endif /* compile_option */ signed int frozen_string_literal:2; /* -1: not specified, 0: false, 1: true */ @@ -15989,7 +15989,7 @@ rb_reserved_word(const char *str, unsigned int len) #ifdef UNIVERSAL_PARSER rb_parser_t * -rb_ruby_parser_allocate(rb_parser_config_t *config) { /* parser_initialize expects fields to be set to 0 */ rb_parser_t *p = (rb_parser_t *)config->calloc(1, sizeof(rb_parser_t)); @@ -15998,7 +15998,7 @@ rb_ruby_parser_allocate(rb_parser_config_t *config) } rb_parser_t * -rb_ruby_parser_new(rb_parser_config_t *config) { /* parser_initialize expects fields to be set to 0 */ rb_parser_t *p = rb_ruby_parser_allocate(config); @@ -484,7 +484,7 @@ extern VALUE rb_eArgError; extern VALUE rb_mRubyVMFrozenCore; VALUE rb_node_case_when_optimizable_literal(const NODE *const node); -rb_parser_config_t rb_global_parser_config = (rb_parser_config_t) { .malloc = ruby_xmalloc, .calloc = ruby_xcalloc, .realloc = ruby_xrealloc, @@ -1439,8 +1439,8 @@ void rb_ruby_parser_free(void *ptr); rb_ast_t* rb_ruby_parser_compile_string(rb_parser_t *p, const char *f, VALUE s, int line); #ifdef UNIVERSAL_PARSER -rb_parser_t *rb_ruby_parser_allocate(rb_parser_config_t *config); -rb_parser_t *rb_ruby_parser_new(rb_parser_config_t *config); #endif long rb_parser_string_length(rb_parser_string_t *str); |