@@ -59,13 +59,13 @@ def source(tok)
59
59
60
60
def s0 ( type , source )
61
61
sexp = s ( type )
62
- sexp . loc = source
62
+ sexp . source = source
63
63
sexp
64
64
end
65
65
66
66
def s1 ( type , first , source )
67
67
sexp = s ( type , first )
68
- sexp . loc = source
68
+ sexp . source = source
69
69
sexp
70
70
end
71
71
@@ -123,7 +123,7 @@ def new_const(tok)
123
123
124
124
def new_colon2 ( lhs , tok , name )
125
125
sexp = s ( :colon2 , lhs , value ( name ) . to_sym )
126
- sexp . loc = source ( tok )
126
+ sexp . source = source ( tok )
127
127
sexp
128
128
end
129
129
@@ -137,7 +137,7 @@ def new_sym(tok)
137
137
138
138
def new_alias ( kw , new , old )
139
139
sexp = s ( :alias , new , old )
140
- sexp . loc = source ( kw )
140
+ sexp . source = source ( kw )
141
141
sexp
142
142
end
143
143
@@ -216,25 +216,25 @@ def new_def(kw, recv, name, args, body, end_tok)
216
216
body << s ( :nil ) if body . size == 1
217
217
218
218
sexp = s ( :def , recv , value ( name ) . to_sym , args , body )
219
- sexp . loc = source ( kw )
219
+ sexp . source = source ( kw )
220
220
sexp
221
221
end
222
222
223
223
def new_class ( start , path , sup , body , endt )
224
224
sexp = s ( :class , path , sup , body )
225
- sexp . loc = source ( start )
225
+ sexp . source = source ( start )
226
226
sexp
227
227
end
228
228
229
229
def new_sclass ( kw , expr , body , end_tok )
230
230
sexp = s ( :sclass , expr , body )
231
- sexp . loc = source ( kw )
231
+ sexp . source = source ( kw )
232
232
sexp
233
233
end
234
234
235
235
def new_module ( kw , path , body , end_tok )
236
236
sexp = s ( :module , path , body )
237
- sexp . loc = source ( kw )
237
+ sexp . source = source ( kw )
238
238
sexp
239
239
end
240
240
@@ -247,38 +247,38 @@ def new_iter(args, body)
247
247
248
248
def new_if ( if_tok , expr , stmt , tail )
249
249
sexp = s ( :if , expr , stmt , tail )
250
- sexp . loc = source ( if_tok )
250
+ sexp . source = source ( if_tok )
251
251
sexp
252
252
end
253
253
254
254
def new_while ( kw , test , body )
255
255
sexp = s ( :while , test , body )
256
- sexp . loc = source ( kw )
256
+ sexp . source = source ( kw )
257
257
sexp
258
258
end
259
259
260
260
def new_until ( kw , test , body )
261
261
sexp = s ( :until , test , body )
262
- sexp . loc = source ( kw )
262
+ sexp . source = source ( kw )
263
263
sexp
264
264
end
265
265
266
266
def new_rescue_mod ( kw , expr , resc )
267
267
sexp = s ( :rescue_mod , expr , resc )
268
- sexp . loc = source ( kw )
268
+ sexp . source = source ( kw )
269
269
sexp
270
270
end
271
271
272
272
def new_array ( start , args , finish )
273
273
args ||= [ ]
274
274
sexp = s ( :array , *args )
275
- sexp . loc = source ( start )
275
+ sexp . source = source ( start )
276
276
sexp
277
277
end
278
278
279
279
def new_hash ( open , assocs , close )
280
280
sexp = s ( :hash , *assocs )
281
- sexp . loc = source ( open )
281
+ sexp . source = source ( open )
282
282
sexp
283
283
end
284
284
@@ -372,7 +372,7 @@ def new_block_args(norm, opt, rest, block)
372
372
def new_call ( recv , meth , args = nil )
373
373
args ||= [ ]
374
374
sexp = s ( :call , recv , value ( meth ) . to_sym , s ( :arglist , *args ) )
375
- sexp . loc = source ( meth )
375
+ sexp . source = source ( meth )
376
376
sexp
377
377
end
378
378
@@ -386,25 +386,25 @@ def new_unary_call(op, recv)
386
386
387
387
def new_and ( lhs , tok , rhs )
388
388
sexp = s ( :and , lhs , rhs )
389
- sexp . loc = source ( tok )
389
+ sexp . source = source ( tok )
390
390
sexp
391
391
end
392
392
393
393
def new_or ( lhs , tok , rhs )
394
394
sexp = s ( :or , lhs , rhs )
395
- sexp . loc = source ( tok )
395
+ sexp . source = source ( tok )
396
396
sexp
397
397
end
398
398
399
399
def new_irange ( beg , op , finish )
400
400
sexp = s ( :irange , beg , finish )
401
- sexp . loc = source ( op )
401
+ sexp . source = source ( op )
402
402
sexp
403
403
end
404
404
405
405
def new_erange ( beg , op , finish )
406
406
sexp = s ( :erange , beg , finish )
407
- sexp . loc = source ( op )
407
+ sexp . source = source ( op )
408
408
sexp
409
409
end
410
410
@@ -441,7 +441,7 @@ def new_op_asgn(op, lhs, rhs)
441
441
def new_op_asgn1 ( lhs , args , op , rhs )
442
442
arglist = s ( :arglist , *args )
443
443
sexp = s ( :op_asgn1 , lhs , arglist , value ( op ) , rhs )
444
- sexp . loc = source ( op )
444
+ sexp . source = source ( op )
445
445
sexp
446
446
end
447
447
@@ -510,7 +510,7 @@ def new_gettable(ref)
510
510
raise "Bad new_gettable ref: #{ ref . type } "
511
511
end
512
512
513
- res . loc = ref . loc
513
+ res . source = ref . source
514
514
res
515
515
end
516
516
@@ -535,7 +535,7 @@ def new_var_ref(ref)
535
535
s ( :call , nil , ref [ 1 ] , s ( :arglist ) )
536
536
end
537
537
538
- result . loc = ref . loc
538
+ result . source = ref . source
539
539
result
540
540
else
541
541
raise "Bad var_ref type: #{ ref . type } "
@@ -549,7 +549,7 @@ def new_super(kw, args)
549
549
sexp = s ( :super , s ( :arglist , *args ) )
550
550
end
551
551
552
- sexp . loc = source ( kw )
552
+ sexp . source = source ( kw )
553
553
sexp
554
554
end
555
555
@@ -566,7 +566,7 @@ def new_xstr(start_t, str, end_t)
566
566
when :evstr then str = s ( :dxstr , '' , str )
567
567
end
568
568
569
- str . loc = source ( start_t )
569
+ str . source = source ( start_t )
570
570
571
571
str
572
572
end
0 commit comments