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

ruby-changes:48627

From: nobu <ko1@a...>
Date: Sat, 11 Nov 2017 13:50:16 +0900 (JST)
Subject: [ruby-changes:48627] nobu:r60742 (trunk): parse.y: constified YYLTYPE

nobu	2017-11-11 13:50:11 +0900 (Sat, 11 Nov 2017)

  New Revision: 60742

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

  Log:
    parse.y: constified YYLTYPE

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 60741)
+++ parse.y	(revision 60742)
@@ -386,15 +386,15 @@ set_line_body(NODE *body, int line) https://github.com/ruby/ruby/blob/trunk/parse.y#L386
 
 #define yyparse ruby_yyparse
 
-static NODE *cond_gen(struct parser_params*,NODE*,int,YYLTYPE*);
+static NODE *cond_gen(struct parser_params*,NODE*,int,const YYLTYPE*);
 #define cond(node,location) cond_gen(parser, (node), FALSE, location)
 #define method_cond(node,location) cond_gen(parser, (node), TRUE, location)
 #define new_nil() NEW_NIL()
-static NODE *new_if_gen(struct parser_params*,NODE*,NODE*,NODE*,YYLTYPE*);
+static NODE *new_if_gen(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
 #define new_if(cc,left,right,location) new_if_gen(parser, (cc), (left), (right), (location))
-static NODE *new_unless_gen(struct parser_params*,NODE*,NODE*,NODE*,YYLTYPE*);
+static NODE *new_unless_gen(struct parser_params*,NODE*,NODE*,NODE*,const YYLTYPE*);
 #define new_unless(cc,left,right,location) new_unless_gen(parser, (cc), (left), (right), (location))
-static NODE *logop_gen(struct parser_params*,enum node_type,NODE*,NODE*,YYLTYPE*);
+static NODE *logop_gen(struct parser_params*,enum node_type,NODE*,NODE*,const YYLTYPE*);
 #define logop(id,node1,node2,location) \
     logop_gen(parser, ((id)==idAND||(id)==idANDOP)?NODE_AND:NODE_OR, \
 	      (node1), (node2), (location))
@@ -416,29 +416,29 @@ static void reduce_nodes_gen(struct pars https://github.com/ruby/ruby/blob/trunk/parse.y#L416
 static void block_dup_check_gen(struct parser_params*,NODE*,NODE*);
 #define block_dup_check(n1,n2) block_dup_check_gen(parser,(n1),(n2))
 
-static NODE *block_append_gen(struct parser_params*,NODE*,NODE*,YYLTYPE*);
+static NODE *block_append_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define block_append(h,t,location) block_append_gen(parser,(h),(t),(location))
-static NODE *list_append_gen(struct parser_params*,NODE*,NODE*,YYLTYPE*);
+static NODE *list_append_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define list_append(l,i,location) list_append_gen(parser,(l),(i),(location))
 static NODE *list_concat(NODE*,NODE*);
-static NODE *arg_append_gen(struct parser_params*,NODE*,NODE*,YYLTYPE*);
+static NODE *arg_append_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define arg_append(h,t,location) arg_append_gen(parser,(h),(t),(location))
-static NODE *arg_concat_gen(struct parser_params*,NODE*,NODE*,YYLTYPE*);
+static NODE *arg_concat_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define arg_concat(h,t,location) arg_concat_gen(parser,(h),(t),(location))
-static NODE *literal_concat_gen(struct parser_params*,NODE*,NODE*,YYLTYPE*);
+static NODE *literal_concat_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define literal_concat(h,t,location) literal_concat_gen(parser,(h),(t),(location))
 static int literal_concat0(struct parser_params *, VALUE, VALUE);
-static NODE *new_evstr_gen(struct parser_params*,NODE*,YYLTYPE*);
+static NODE *new_evstr_gen(struct parser_params*,NODE*,const YYLTYPE*);
 #define new_evstr(n, location) new_evstr_gen(parser,(n),(location))
-static NODE *evstr2dstr_gen(struct parser_params*,NODE*,YYLTYPE*);
+static NODE *evstr2dstr_gen(struct parser_params*,NODE*,const YYLTYPE*);
 #define evstr2dstr(n,location) evstr2dstr_gen(parser,(n),(location))
 static NODE *splat_array(NODE*);
 
-static NODE *call_bin_op_gen(struct parser_params*,NODE*,ID,NODE*,YYLTYPE*);
+static NODE *call_bin_op_gen(struct parser_params*,NODE*,ID,NODE*,const YYLTYPE*);
 #define call_bin_op(recv,id,arg1,location) call_bin_op_gen(parser, (recv),(id),(arg1),(location))
-static NODE *call_uni_op_gen(struct parser_params*,NODE*,ID,YYLTYPE*);
+static NODE *call_uni_op_gen(struct parser_params*,NODE*,ID,const YYLTYPE*);
 #define call_uni_op(recv,id,location) call_uni_op_gen(parser, (recv),(id),(location))
-static NODE *new_qcall_gen(struct parser_params* parser, ID atype, NODE *recv, ID mid, NODE *args, YYLTYPE *location);
+static NODE *new_qcall_gen(struct parser_params* parser, ID atype, NODE *recv, ID mid, NODE *args, const YYLTYPE *location);
 #define new_qcall(q,r,m,a,location) new_qcall_gen(parser,q,r,m,a,location)
 #define new_command_qcall(q,r,m,a,location) new_qcall_gen(parser,q,r,m,a,location)
 static NODE *new_command_gen(struct parser_params*parser, NODE *m, NODE *a) {m->nd_args = a; return m;}
@@ -448,9 +448,9 @@ static NODE *method_add_block_gen(struct https://github.com/ruby/ruby/blob/trunk/parse.y#L448
 
 static NODE *new_args_gen(struct parser_params*,NODE*,NODE*,ID,NODE*,NODE*);
 #define new_args(f,o,r,p,t) new_args_gen(parser, (f),(o),(r),(p),(t))
-static NODE *new_args_tail_gen(struct parser_params*,NODE*,ID,ID,YYLTYPE*);
+static NODE *new_args_tail_gen(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
 #define new_args_tail(k,kr,b,location) new_args_tail_gen(parser, (k),(kr),(b),(location))
-static NODE *new_kw_arg_gen(struct parser_params *parser, NODE *k, YYLTYPE *location);
+static NODE *new_kw_arg_gen(struct parser_params *parser, NODE *k, const YYLTYPE *location);
 #define new_kw_arg(k,location) new_kw_arg_gen(parser, k, location)
 
 static VALUE negate_lit_gen(struct parser_params*, VALUE);
@@ -458,37 +458,37 @@ static VALUE negate_lit_gen(struct parse https://github.com/ruby/ruby/blob/trunk/parse.y#L458
 static NODE *ret_args_gen(struct parser_params*,NODE*);
 #define ret_args(node) ret_args_gen(parser, (node))
 static NODE *arg_blk_pass(NODE*,NODE*);
-static NODE *new_yield_gen(struct parser_params*,NODE*,YYLTYPE*);
+static NODE *new_yield_gen(struct parser_params*,NODE*,const YYLTYPE*);
 #define new_yield(node,location) new_yield_gen(parser, (node), (location))
-static NODE *dsym_node_gen(struct parser_params*,NODE*,YYLTYPE*);
+static NODE *dsym_node_gen(struct parser_params*,NODE*,const YYLTYPE*);
 #define dsym_node(node,location) dsym_node_gen(parser, (node), (location))
 
-static NODE *gettable_gen(struct parser_params*,ID,YYLTYPE*);
+static NODE *gettable_gen(struct parser_params*,ID,const YYLTYPE*);
 #define gettable(id,location) gettable_gen(parser,(id),(location))
-static NODE *assignable_gen(struct parser_params*,ID,NODE*,YYLTYPE*);
+static NODE *assignable_gen(struct parser_params*,ID,NODE*,const YYLTYPE*);
 #define assignable(id,node,location) assignable_gen(parser, (id), (node), (location))
 
-static NODE *aryset_gen(struct parser_params*,NODE*,NODE*,YYLTYPE*);
+static NODE *aryset_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define aryset(node1,node2,location) aryset_gen(parser, (node1), (node2), (location))
-static NODE *attrset_gen(struct parser_params*,NODE*,ID,ID,YYLTYPE*);
+static NODE *attrset_gen(struct parser_params*,NODE*,ID,ID,const YYLTYPE*);
 #define attrset(node,q,id,location) attrset_gen(parser, (node), (q), (id), (location))
 
 static void rb_backref_error_gen(struct parser_params*,NODE*);
 #define rb_backref_error(n) rb_backref_error_gen(parser,(n))
-static NODE *node_assign_gen(struct parser_params*,NODE*,NODE*,YYLTYPE*);
+static NODE *node_assign_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define node_assign(node1, node2, location) node_assign_gen(parser, (node1), (node2), (location))
 
-static NODE *new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, YYLTYPE *location);
+static NODE *new_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *location);
 #define new_op_assign(lhs, op, rhs, location) new_op_assign_gen(parser, (lhs), (op), (rhs), (location))
-static NODE *new_attr_op_assign_gen(struct parser_params *parser, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, YYLTYPE *location);
+static NODE *new_attr_op_assign_gen(struct parser_params *parser, NODE *lhs, ID atype, ID attr, ID op, NODE *rhs, const YYLTYPE *location);
 #define new_attr_op_assign(lhs, type, attr, op, rhs, location) new_attr_op_assign_gen(parser, (lhs), (type), (attr), (op), (rhs), (location))
-static NODE *new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, YYLTYPE *location);
+static NODE *new_const_op_assign_gen(struct parser_params *parser, NODE *lhs, ID op, NODE *rhs, const YYLTYPE *location);
 #define new_const_op_assign(lhs, op, rhs, location) new_const_op_assign_gen(parser, (lhs), (op), (rhs), (location))
 
-static NODE *const_path_field_gen(struct parser_params *parser, NODE *head, ID mid, YYLTYPE *location);
+static NODE *const_path_field_gen(struct parser_params *parser, NODE *head, ID mid, const YYLTYPE *location);
 #define const_path_field(w, n, location) const_path_field_gen(parser, w, n, location)
 #define top_const_field(n) NEW_COLON3(n)
-static NODE *const_decl_gen(struct parser_params *parser, NODE* path, YYLTYPE *location);
+static NODE *const_decl_gen(struct parser_params *parser, NODE* path, const YYLTYPE *location);
 #define const_decl(path, location) const_decl_gen(parser, path, location)
 
 #define var_field(n) (n)
@@ -496,87 +496,87 @@ static NODE *const_decl_gen(struct parse https://github.com/ruby/ruby/blob/trunk/parse.y#L496
 
 static NODE *kwd_append(NODE*, NODE*);
 
-static NODE *new_hash_gen(struct parser_params *parser, NODE *hash, YYLTYPE *location);
+static NODE *new_hash_gen(struct parser_params *parser, NODE *hash, const YYLTYPE *location);
 #define new_hash(hash, location) new_hash_gen(parser, (hash), location)
 
-static NODE *new_defined_gen(struct parser_params *parser, NODE *expr, YYLTYPE *location);
+static NODE *new_defined_gen(struct parser_params *parser, NODE *expr, const YYLTYPE *location);
 #define new_defined(expr, location) new_defined_gen(parser, expr, location)
 
-static NODE *new_regexp_gen(struct parser_params *, NODE *, int, YYLTYPE *);
+static NODE *new_regexp_gen(struct parser_params *, NODE *, int, const YYLTYPE *);
 #define new_regexp(node, opt, location) new_regexp_gen(parser, node, opt, location)
 
-static NODE *new_lit_gen(struct parser_params *parser, VALUE sym, YYLTYPE *location);
+static NODE *new_lit_gen(struct parser_params *parser, VALUE sym, const YYLTYPE *location);
 #define new_lit(sym, location) new_lit_gen(parser, sym, location)
 
-static NODE *new_list_gen(struct parser_params *parser, NODE *item, YYLTYPE *location);
+static NODE *new_list_gen(struct parser_params *parser, NODE *item, const YYLTYPE *location);
 #define new_list(item, location) new_list_gen(parser, item, location)
 
-static NODE *new_str_gen(struct parser_params *parser, VALUE str, YYLTYPE *location);
+static NODE *new_str_gen(struct parser_params *parser, VALUE str, const YYLTYPE *location);
 #define new_str(s,location) new_str_gen(parser, s, location)
 
-static NODE *new_dvar_gen(struct parser_params *parser, ID id, YYLTYPE *location);
+static NODE *new_dvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
 #define new_dvar(id, location) new_dvar_gen(parser, id, location)
 
-static NODE *new_resbody_gen(struct parser_params *parser, NODE *exc_list, NODE *stmt, NODE *rescue, YYLTYPE *location);
+static NODE *new_resbody_gen(struct parser_params *parser, NODE *exc_list, NODE *stmt, NODE *rescue, const YYLTYPE *location);
 #define new_resbody(e,s,r,location) new_resbody_gen(parser, (e),(s),(r),(location))
 
-static NODE *new_errinfo_gen(struct parser_params *parser, YYLTYPE *location);
+static NODE *new_errinfo_gen(struct parser_params *parser, const YYLTYPE *location);
 #define new_errinfo(location) new_errinfo_gen(parser, location)
 
-static NODE *new_call_gen(struct parser_params *parser, NODE *recv, ID mid, NODE *args, YYLTYPE *location);
+static NODE *new_call_gen(struct parser_params *parser, NODE *recv, ID mid, NODE *args, const YYLTYPE *location);
 #define new_call(recv,mid,args,location) new_call_gen(parser, recv,mid,args,location)
 
-static NODE *new_fcall_gen(struct parser_params *parser, ID mid, NODE *args, YYLTYPE *location);
+static NODE *new_fcall_gen(struct parser_params *parser, ID mid, NODE *args, const YYLTYPE *location);
 #define new_fcall(mid,args,location) new_fcall_gen(parser, mid, args, location)
 
-static NODE *new_for_gen(struct parser_params *parser, NODE *var, NODE *iter, NODE *body, YYLTYPE *location);
+static NODE *new_for_gen(struct parser_params *parser, NODE *var, NODE *iter, NODE *body, const YYLTYPE *location);
 #define new_for(var,iter,body,location) new_for_gen(parser, var, iter, body, location)
 
-static NODE *new_gvar_gen(struct parser_params *parser, ID id, YYLTYPE *location);
+static NODE *new_gvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
 #define new_gvar(id, location) new_gvar_gen(parser, id, location)
 
-static NODE *new_lvar_gen(struct parser_params *parser, ID id, YYLTYPE *location);
+static NODE *new_lvar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
 #define new_lvar(id, location) new_lvar_gen(parser, id, location)
 
-static NODE *new_dstr_gen(struct parser_params *parser, VALUE str, YYLTYPE *location);
+static NODE *new_dstr_gen(struct parser_params *parser, VALUE str, const YYLTYPE *location);
 #define new_dstr(s, location) new_dstr_gen(parser, s, location)
 
-static NODE *new_rescue_gen(struct parser_params *parser, NODE *b, NODE *res, NODE *e, YYLTYPE *location);
+static NODE *new_rescue_gen(struct parser_params *parser, NODE *b, NODE *res, NODE *e, const YYLTYPE *location);
 #define new_rescue(b,res,e,location) new_rescue_gen(parser,b,res,e,location)
 
-static NODE *new_undef_gen(struct parser_params *parser, NODE *i, YYLTYPE *location);
+static NODE *new_undef_gen(struct parser_params *parser, NODE *i, const YYLTYPE *location);
 #define new_undef(i, location) new_undef_gen(parser, i, location)
 
-static NODE *new_zarray_gen(struct parser_params *parser, YYLTYPE *location);
+static NODE *new_zarray_gen(struct parser_params *parser, const YYLTYPE *location);
 #define new_zarray(location) new_zarray_gen(parser, location)
 
-static NODE *new_ivar_gen(struct parser_params *parser, ID id, YYLTYPE *location);
+static NODE *new_ivar_gen(struct parser_params *parser, ID id, const YYLTYPE *location);
 #define new_ivar(id, location) new_ivar_gen(parser,id,location)
 
-static NODE *new_postarg_gen(struct parser_params *parser, NODE *i, NODE *v, YYLTYPE *location);
+static NODE *new_postarg_gen(struct parser_params *parser, NODE *i, NODE *v, const YYLTYPE *location);
 #define new_postarg(i,v,location) new_postarg_gen(parser,i,v,location)
 
-static NODE *new_cdecl_gen(struct parser_params *parser, ID v, NODE *val, NODE *path, YYLTYPE *location);
+static NODE *new_cdecl_gen(struct parser_params *parser, ID v, NODE *val, NODE *path, const YYLTYPE *location);
 #define new_cdecl(v,val,path,location) new_cdecl_gen(parser,v,val,path,location)
 
-static NODE *new_scope_gen(struct parser_params *parser, NODE *a, NODE *b, YYLTYPE *location);
+static NODE *new_scope_gen(struct parser_params *parser, NODE *a, NODE *b, const YYLTYPE *location);
 #define new_scope(a,b,location) new_scope_gen(parser,a,b,location)
 
-static NODE *new_begin_gen(struct parser_params *parser, NODE *b, YYLTYPE *location);
+static NODE *new_begin_gen(struct parser_params *parser, NODE *b, const YYLTYPE *location);
 #define new_begin(b,location) new_begin_gen(parser,b,location)
 
-static NODE *new_masgn_gen(struct parser_params *parser, NODE *l, NODE *r, YYLTYPE *location);
+static NODE *new_masgn_gen(struct parser_params *parser, NODE *l, NODE *r, const YYLTYPE *location);
 #define new_masgn(l,r,location) new_masgn_gen(parser,l,r,location)
 
-static NODE *new_xstring_gen(struct parser_params *, NODE *, YYLTYPE *location);
+static NODE *new_xstring_gen(struct parser_params *, NODE *, const YYLTYPE *location);
 #define new_xstring(node, location) new_xstring_gen(parser, node, location)
 #define new_string1(str) (str)
 
-static NODE *new_body_gen(struct parser_params *parser, NODE *param, NODE *stmt, YYLTYPE *location);
+static NODE *new_body_gen(struct parser_params *parser, NODE *param, NODE *stmt, const YYLTYPE *location);
 #define new_brace_body(param, stmt, location) new_body_gen(parser, param, stmt, location)
 #define new_do_body(param, stmt, location) new_body_gen(parser, param, stmt, location)
 
-static NODE *match_op_gen(struct parser_params*,NODE*,NODE*,YYLTYPE*);
+static NODE *match_op_gen(struct parser_params*,NODE*,NODE*,const YYLTYPE*);
 #define match_op(node1,node2,location) match_op_gen(parser, (node1), (node2), (location))
 
 static ID  *local_tbl_gen(struct parser_params*);
@@ -588,7 +588,7 @@ static void reg_fragment_setenc_gen(stru https://github.com/ruby/ruby/blob/trunk/parse.y#L588
 #define reg_fragment_setenc(str,options) reg_fragment_setenc_gen(parser, (str), (options))
 static int reg_fragment_check_gen(struct parser_params*, VALUE, int);
 #define reg_fragment_check(str,options) reg_fragment_check_gen(parser, (str), (options))
-static NODE *reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, YYLTYPE *location);
+static NODE *reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, const YYLTYPE *location);
 #define reg_named_capture_assign(regexp,location) reg_named_capture_assign_gen(parser,(regexp),location)
 
 static NODE *parser_heredoc_dedent(struct parser_params*,NODE*);
@@ -9007,7 +9007,7 @@ parser_warn(struct parser_params *parser https://github.com/ruby/ruby/blob/trunk/parse.y#L9007
 #define parser_warn(node, mesg) parser_warn(parser, (node), (mesg))
 
 static NODE*
-block_append_gen(struct parser_params *parser, NODE *head, NODE *tail, YYLTYPE *location)
+block_append_gen(struct parser_params *parser, NODE *head, NODE *tail, const YYLTYPE *location)
 {
     NODE *end, *h = head, *nd;
 
@@ -9065,7 +9065,7 @@ block_append_gen(struct parser_params *p https://github.com/ruby/ruby/blob/trunk/parse.y#L9065
 
 /* append item to the list */
 static NODE*
-list_append_gen(struct parser_params *parser, NODE *list, NODE *item, YYLTYPE *location)
+list_append_gen(struct parser_params *parser, NODE *list, NODE *item, const YYLTYPE *location)
 {
     NODE *last;
 
@@ -9126,7 +9126,7 @@ literal_concat0(struct parser_params *pa https://github.com/ruby/ruby/blob/trunk/parse.y#L9126
 
 /* concat two string literals */
 static NODE *
-literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, YYLTYPE *location)
+literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail, const YYLTYPE *location)
 {
     enum node_type htype;
     NODE *headlast;
@@ -9217,7 +9217,7 @@ literal_concat_gen(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L9217
 }
 
 static NODE *
-evstr2dstr_gen(struct parser_params *parser, NODE *node, YYLTYPE *location)
+evstr2dstr_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
 {
     if (nd_type(node) == NODE_EVSTR) {
 	node = list_append(new_dstr(STR_NEW0(), location), node, location);
@@ -9226,7 +9226,7 @@ evstr2dstr_gen(struct parser_params *par https://github.com/ruby/ruby/blob/trunk/parse.y#L9226
 }
 
 static NODE *
-new_evstr_gen(struct parser_params *parser, NODE *node, YYLTYPE *location)
+new_evstr_gen(struct parser_params *parser, NODE *node, const YYLTYPE *location)
 {
     NODE *head = node;
     NODE *evstr;
@@ -9244,7 +9244,7 @@ new_evstr_gen(struct parser_params *pars https://github.com/ruby/ruby/blob/trunk/parse.y#L9244
 }
 
 static NODE *
-call_bin_op_gen(struct parser_params *parser, NODE *recv, ID id, NODE *arg1, YYLTYPE *location)
+call_bin_op_gen(struct parser_params *parser, NODE *recv, ID id, NODE *arg1, const YYLTYPE *location)
 {
     NODE *expr;
     value_expr(recv);
@@ -9257,7 +9257,7 @@ call_bin_op_gen(struct parser_params *pa https://github.com/ruby/ruby/blob/trunk/parse.y#L9257
 }
 
 static NODE *
-call_uni_op_gen(struct parser_params *parser, NODE *recv, ID id, YYLTYPE *location)
+call_uni_op_gen(struct parser_params *parser, NODE *recv, ID id, const YYLTYPE *location)
 {
     NODE *opcall;
     value_expr(recv);
@@ -9268,7 +9268,7 @ (... truncated)

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

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