[前][次][番号順一覧][スレッド一覧]

ruby-changes:48451

From: ko1 <ko1@a...>
Date: Mon, 30 Oct 2017 00:51:29 +0900 (JST)
Subject: [ruby-changes:48451] ko1:r60565 (trunk): * node.h (ast_t): renamed to `rb_ast_t`.

ko1	2017-10-30 00:51:23 +0900 (Mon, 30 Oct 2017)

  New Revision: 60565

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60565

  Log:
    * node.h (ast_t): renamed to `rb_ast_t`.

  Modified files:
    trunk/gc.c
    trunk/iseq.c
    trunk/load.c
    trunk/node.c
    trunk/node.h
    trunk/parse.y
    trunk/ruby.c
    trunk/template/prelude.c.tmpl
Index: iseq.c
===================================================================
--- iseq.c	(revision 60564)
+++ iseq.c	(revision 60565)
@@ -641,9 +641,9 @@ rb_iseq_compile_with_option(VALUE src, V https://github.com/ruby/ruby/blob/trunk/iseq.c#L641
 #else
 # define INITIALIZED /* volatile */
 #endif
-    ast_t *(*parse)(VALUE vparser, VALUE fname, VALUE file, int start);
+    rb_ast_t *(*parse)(VALUE vparser, VALUE fname, VALUE file, int start);
     int ln;
-    ast_t *INITIALIZED ast;
+    rb_ast_t *INITIALIZED ast;
 
     /* safe results first */
     make_compile_option(&option, opt);
@@ -854,7 +854,7 @@ iseqw_s_compile_file(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/iseq.c#L854
 {
     VALUE file, line = INT2FIX(1), opt = Qnil;
     VALUE parser, f, exc = Qnil, ret;
-    ast_t *ast;
+    rb_ast_t *ast;
     rb_compile_option_t option;
     int i;
 
Index: load.c
===================================================================
--- load.c	(revision 60564)
+++ load.c	(revision 60565)
@@ -602,7 +602,7 @@ rb_load_internal0(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/load.c#L602
     EC_PUSH_TAG(th->ec);
     state = EXEC_TAG();
     if (state == TAG_NONE) {
-	ast_t *ast;
+	rb_ast_t *ast;
 	const rb_iseq_t *iseq;
 
 	if ((iseq = rb_iseq_load_iseq(fname)) != NULL) {
@@ -611,7 +611,7 @@ rb_load_internal0(rb_thread_t *th, VALUE https://github.com/ruby/ruby/blob/trunk/load.c#L611
 	else {
 	    VALUE parser = rb_parser_new();
 	    rb_parser_set_context(parser, NULL, FALSE);
-	    ast = (ast_t *)rb_parser_load_file(parser, fname);
+	    ast = (rb_ast_t *)rb_parser_load_file(parser, fname);
 	    iseq = rb_iseq_new_top(ast->root, rb_fstring_cstr("<top (required)>"),
 			    fname, rb_realpath_internal(Qnil, fname, 1), NULL);
 	    rb_ast_dispose(ast);
Index: gc.c
===================================================================
--- gc.c	(revision 60564)
+++ gc.c	(revision 60565)
@@ -434,7 +434,7 @@ typedef struct RVALUE { https://github.com/ruby/ruby/blob/trunk/gc.c#L434
 	    const rb_iseq_t iseq;
 	    rb_env_t env;
 	    struct rb_imemo_alloc_struct alloc;
-	    ast_t ast;
+	    rb_ast_t ast;
 	} imemo;
 	struct {
 	    struct RBasic basic;
Index: parse.y
===================================================================
--- parse.y	(revision 60564)
+++ parse.y	(revision 60565)
@@ -239,7 +239,7 @@ struct parser_params { https://github.com/ruby/ruby/blob/trunk/parse.y#L239
     unsigned int do_chomp: 1;
     unsigned int do_split: 1;
 
-    ast_t *ast;
+    rb_ast_t *ast;
     NODE *eval_tree_begin;
     NODE *eval_tree;
     VALUE error_buffer;
@@ -5589,11 +5589,11 @@ lex_getline(struct parser_params *parser https://github.com/ruby/ruby/blob/trunk/parse.y#L5589
 static const rb_data_type_t parser_data_type;
 
 #ifndef RIPPER
-static ast_t*
+static rb_ast_t*
 parser_compile_string(VALUE vparser, VALUE fname, VALUE s, int line)
 {
     struct parser_params *parser;
-    ast_t *ast;
+    rb_ast_t *ast;
 
     TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
     parser->ast = ast = rb_ast_new();
@@ -5610,34 +5610,34 @@ parser_compile_string(VALUE vparser, VAL https://github.com/ruby/ruby/blob/trunk/parse.y#L5610
     return ast;
 }
 
-ast_t*
+rb_ast_t*
 rb_compile_string(const char *f, VALUE s, int line)
 {
     must_be_ascii_compatible(s);
     return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), s, line);
 }
 
-ast_t*
+rb_ast_t*
 rb_parser_compile_string(VALUE vparser, const char *f, VALUE s, int line)
 {
     return rb_parser_compile_string_path(vparser, rb_filesystem_str_new_cstr(f), s, line);
 }
 
-ast_t*
+rb_ast_t*
 rb_parser_compile_string_path(VALUE vparser, VALUE f, VALUE s, int line)
 {
     must_be_ascii_compatible(s);
     return parser_compile_string(vparser, f, s, line);
 }
 
-ast_t*
+rb_ast_t*
 rb_compile_cstr(const char *f, const char *s, int len, int line)
 {
     VALUE str = rb_str_new(s, len);
     return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), str, line);
 }
 
-ast_t*
+rb_ast_t*
 rb_parser_compile_cstr(VALUE vparser, const char *f, const char *s, int len, int line)
 {
     VALUE str = rb_str_new(s, len);
@@ -5652,7 +5652,7 @@ lex_io_gets(struct parser_params *parser https://github.com/ruby/ruby/blob/trunk/parse.y#L5652
     return rb_io_gets_internal(io);
 }
 
-ast_t*
+rb_ast_t*
 rb_compile_file(const char *f, VALUE file, int start)
 {
     VALUE vparser = rb_parser_new();
@@ -5660,17 +5660,17 @@ rb_compile_file(const char *f, VALUE fil https://github.com/ruby/ruby/blob/trunk/parse.y#L5660
     return rb_parser_compile_file(vparser, f, file, start);
 }
 
-ast_t*
+rb_ast_t*
 rb_parser_compile_file(VALUE vparser, const char *f, VALUE file, int start)
 {
     return rb_parser_compile_file_path(vparser, rb_filesystem_str_new_cstr(f), file, start);
 }
 
-ast_t*
+rb_ast_t*
 rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE file, int start)
 {
     struct parser_params *parser;
-    ast_t *ast;
+    rb_ast_t *ast;
 
     TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser);
     parser->ast = ast = rb_ast_new();
Index: ruby.c
===================================================================
--- ruby.c	(revision 60564)
+++ ruby.c	(revision 60565)
@@ -177,7 +177,7 @@ cmdline_options_init(ruby_cmdline_option https://github.com/ruby/ruby/blob/trunk/ruby.c#L177
     return opt;
 }
 
-static ast_t *load_file(VALUE parser, VALUE fname, VALUE f, int script,
+static rb_ast_t *load_file(VALUE parser, VALUE fname, VALUE f, int script,
 		       ruby_cmdline_options_t *opt);
 static VALUE open_load_file(VALUE fname_v, int *xflag);
 static void forbid_setid(const char *, const ruby_cmdline_options_t *);
@@ -1461,7 +1461,7 @@ rb_f_chomp(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1461
 static VALUE
 process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
 {
-    ast_t *ast = 0;
+    rb_ast_t *ast = 0;
     VALUE parser;
     VALUE script_name;
     const rb_iseq_t *iseq;
@@ -1797,7 +1797,7 @@ load_file_internal(VALUE argp_v) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1797
     ruby_cmdline_options_t *opt = argp->opt;
     VALUE f = argp->f;
     int line_start = 1;
-    ast_t *ast = 0;
+    rb_ast_t *ast = 0;
     rb_encoding *enc;
     ID set_encoding;
 
@@ -2011,7 +2011,7 @@ restore_load_file(VALUE arg) https://github.com/ruby/ruby/blob/trunk/ruby.c#L2011
     return Qnil;
 }
 
-static ast_t *
+static rb_ast_t *
 load_file(VALUE parser, VALUE fname, VALUE f, int script, ruby_cmdline_options_t *opt)
 {
     struct load_file_arg arg;
@@ -2020,7 +2020,7 @@ load_file(VALUE parser, VALUE fname, VAL https://github.com/ruby/ruby/blob/trunk/ruby.c#L2020
     arg.script = script;
     arg.opt = opt;
     arg.f = f;
-    return (ast_t *)rb_ensure(load_file_internal, (VALUE)&arg,
+    return (rb_ast_t *)rb_ensure(load_file_internal, (VALUE)&arg,
 			      restore_load_file, (VALUE)&arg);
 }
 
Index: node.c
===================================================================
--- node.c	(revision 60564)
+++ node.c	(revision 60565)
@@ -1248,7 +1248,7 @@ rb_node_buffer_free(node_buffer_t *nb) https://github.com/ruby/ruby/blob/trunk/node.c#L1248
 }
 
 NODE *
-rb_ast_newnode(ast_t *ast)
+rb_ast_newnode(rb_ast_t *ast)
 {
     node_buffer_t *nb = ast->node_buffer;
     if (nb->idx >= nb->len) {
@@ -1264,27 +1264,27 @@ rb_ast_newnode(ast_t *ast) https://github.com/ruby/ruby/blob/trunk/node.c#L1264
 }
 
 void
-rb_ast_delete_node(ast_t *ast, NODE *n)
+rb_ast_delete_node(rb_ast_t *ast, NODE *n)
 {
     (void)ast;
     (void)n;
     /* should we implement freelist? */
 }
 
-ast_t *
+rb_ast_t *
 rb_ast_new(void)
 {
-    return (ast_t *)rb_imemo_new(imemo_ast, 0, (VALUE)rb_node_buffer_new(), rb_ary_tmp_new(0), 0);
+    return (rb_ast_t *)rb_imemo_new(imemo_ast, 0, (VALUE)rb_node_buffer_new(), rb_ary_tmp_new(0), 0);
 }
 
 void
-rb_ast_mark(ast_t *ast)
+rb_ast_mark(rb_ast_t *ast)
 {
     if (ast->node_buffer) rb_gc_mark(ast->mark_ary);
 }
 
 void
-rb_ast_free(ast_t *ast)
+rb_ast_free(rb_ast_t *ast)
 {
     if (ast->node_buffer) rb_node_buffer_free(ast->node_buffer);
     ast->node_buffer = 0;
@@ -1293,20 +1293,20 @@ rb_ast_free(ast_t *ast) https://github.com/ruby/ruby/blob/trunk/node.c#L1293
 }
 
 void
-rb_ast_dispose(ast_t *ast)
+rb_ast_dispose(rb_ast_t *ast)
 {
     rb_ast_free(ast);
     rb_gc_writebarrier_remember((VALUE)ast);
 }
 
 void
-rb_ast_add_mark_object(ast_t *ast, VALUE obj)
+rb_ast_add_mark_object(rb_ast_t *ast, VALUE obj)
 {
     rb_ary_push(ast->mark_ary, obj);
 }
 
 void
-rb_ast_delete_mark_object(ast_t *ast, VALUE obj)
+rb_ast_delete_mark_object(rb_ast_t *ast, VALUE obj)
 {
     long i;
     for (i = 0; i < RARRAY_LEN(ast->mark_ary); i++) {
Index: node.h
===================================================================
--- node.h	(revision 60564)
+++ node.h	(revision 60565)
@@ -441,21 +441,21 @@ RUBY_SYMBOL_EXPORT_BEGIN https://github.com/ruby/ruby/blob/trunk/node.h#L441
 
 typedef struct node_buffer_struct node_buffer_t;
 /* T_IMEMO/ast */
-typedef struct ast_struct {
+typedef struct rb_ast_struct {
     VALUE flags;
     VALUE reserved1;
     NODE *root;
     node_buffer_t *node_buffer;
     VALUE mark_ary;
-} ast_t;
-ast_t *rb_ast_new();
-void rb_ast_mark(ast_t*);
-void rb_ast_dispose(ast_t*);
-void rb_ast_free(ast_t*);
-void rb_ast_add_mark_object(ast_t*, VALUE);
-void rb_ast_delete_mark_object(ast_t*, VALUE);
-NODE *rb_ast_newnode(ast_t*);
-void rb_ast_delete_node(ast_t*, NODE *n);
+} rb_ast_t;
+rb_ast_t *rb_ast_new();
+void rb_ast_mark(rb_ast_t*);
+void rb_ast_dispose(rb_ast_t*);
+void rb_ast_free(rb_ast_t*);
+void rb_ast_add_mark_object(rb_ast_t*, VALUE);
+void rb_ast_delete_mark_object(rb_ast_t*, VALUE);
+NODE *rb_ast_newnode(rb_ast_t*);
+void rb_ast_delete_node(rb_ast_t*, NODE *n);
 
 VALUE rb_parser_new(void);
 VALUE rb_parser_end_seen_p(VALUE);
@@ -465,15 +465,15 @@ VALUE rb_parser_set_yydebug(VALUE, VALUE https://github.com/ruby/ruby/blob/trunk/node.h#L465
 VALUE rb_parser_dump_tree(NODE *node, int comment);
 void rb_parser_set_options(VALUE, int, int, int, int);
 
-ast_t *rb_parser_compile_cstr(VALUE, const char*, const char*, int, int);
-ast_t *rb_parser_compile_string(VALUE, const char*, VALUE, int);
-ast_t *rb_parser_compile_file(VALUE, const char*, VALUE, int);
-ast_t *rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line);
-ast_t *rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line);
+rb_ast_t *rb_parser_compile_cstr(VALUE, const char*, const char*, int, int);
+rb_ast_t *rb_parser_compile_string(VALUE, const char*, VALUE, int);
+rb_ast_t *rb_parser_compile_file(VALUE, const char*, VALUE, int);
+rb_ast_t *rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line);
+rb_ast_t *rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line);
 
-ast_t *rb_compile_cstr(const char*, const char*, int, int);
-ast_t *rb_compile_string(const char*, VALUE, int);
-ast_t *rb_compile_file(const char*, VALUE, int);
+rb_ast_t *rb_compile_cstr(const char*, const char*, int, int);
+rb_ast_t *rb_compile_string(const char*, VALUE, int);
+rb_ast_t *rb_compile_file(const char*, VALUE, int);
 
 void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2);
 NODE *rb_node_newnode(enum node_type,VALUE,VALUE,VALUE);
Index: template/prelude.c.tmpl
===================================================================
--- template/prelude.c.tmpl	(revision 60564)
+++ template/prelude.c.tmpl	(revision 60565)
@@ -121,7 +121,7 @@ prelude_eval(VALUE code, VALUE name, int https://github.com/ruby/ruby/blob/trunk/template/prelude.c.tmpl#L121
 	FALSE, /* int debug_frozen_string_literal; */
     };
 
-    ast_t *ast = rb_parser_compile_string_path(rb_parser_new(), name, code, line);
+    rb_ast_t *ast = rb_parser_compile_string_path(rb_parser_new(), name, code, line);
     if (!ast->root) {
 	rb_ast_dispose(ast);
 	rb_exc_raise(rb_errinfo());

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]