@@ -374,6 +374,7 @@ def on_BEGIN(statements)
374374
375375 start_char = find_next_statement_start ( lbrace . location . end_char )
376376 statements . bind (
377+ self ,
377378 start_char ,
378379 start_char - line_counts [ lbrace . location . start_line - 1 ] . start ,
379380 rbrace . location . start_char ,
@@ -412,6 +413,7 @@ def on_END(statements)
412413
413414 start_char = find_next_statement_start ( lbrace . location . end_char )
414415 statements . bind (
416+ self ,
415417 start_char ,
416418 start_char - line_counts [ lbrace . location . start_line - 1 ] . start ,
417419 rbrace . location . start_char ,
@@ -849,6 +851,7 @@ def on_begin(bodystmt)
849851 end
850852
851853 bodystmt . bind (
854+ self ,
852855 find_next_statement_start ( keyword . location . end_char ) ,
853856 keyword . location . end_column ,
854857 end_location . end_char ,
@@ -961,7 +964,6 @@ def on_bodystmt(statements, rescue_clause, else_clause, ensure_clause)
961964 unless statements . is_a? ( Statements )
962965 statements =
963966 Statements . new (
964- self ,
965967 body : [ statements ] ,
966968 location : statements . location
967969 )
@@ -991,6 +993,7 @@ def on_brace_block(block_var, statements)
991993
992994 start_char = find_next_statement_start ( location . end_char )
993995 statements . bind (
996+ self ,
994997 start_char ,
995998 start_char - line_counts [ location . start_line - 1 ] . start ,
996999 rbrace . location . start_char ,
@@ -1098,6 +1101,7 @@ def on_class(constant, superclass, bodystmt)
10981101 start_char = find_next_statement_start ( location . end_char )
10991102
11001103 bodystmt . bind (
1104+ self ,
11011105 start_char ,
11021106 start_char - line_counts [ location . start_line - 1 ] . start ,
11031107 ending . location . start_char ,
@@ -1307,6 +1311,7 @@ def on_def(name, params, bodystmt)
13071311 start_char = find_next_statement_start ( params . location . end_char )
13081312
13091313 bodystmt . bind (
1314+ self ,
13101315 start_char ,
13111316 start_char - line_counts [ params . location . start_line - 1 ] . start ,
13121317 ending . location . start_char ,
@@ -1395,6 +1400,7 @@ def on_defs(target, operator, name, params, bodystmt)
13951400 start_char = find_next_statement_start ( params . location . end_char )
13961401
13971402 bodystmt . bind (
1403+ self ,
13981404 start_char ,
13991405 start_char - line_counts [ params . location . start_line - 1 ] . start ,
14001406 ending . location . start_char ,
@@ -1434,6 +1440,7 @@ def on_do_block(block_var, bodystmt)
14341440 start_char = find_next_statement_start ( location . end_char )
14351441
14361442 bodystmt . bind (
1443+ self ,
14371444 start_char ,
14381445 start_char - line_counts [ location . start_line - 1 ] . start ,
14391446 ending . location . start_char ,
@@ -1529,6 +1536,7 @@ def on_else(statements)
15291536
15301537 start_char = find_next_statement_start ( keyword . location . end_char )
15311538 statements . bind (
1539+ self ,
15321540 start_char ,
15331541 start_char - line_counts [ keyword . location . start_line - 1 ] . start ,
15341542 ending . location . start_char ,
@@ -1554,6 +1562,7 @@ def on_elsif(predicate, statements, consequent)
15541562
15551563 start_char = find_next_statement_start ( predicate . location . end_char )
15561564 statements . bind (
1565+ self ,
15571566 start_char ,
15581567 start_char - line_counts [ predicate . location . start_line - 1 ] . start ,
15591568 ending . location . start_char ,
@@ -1677,6 +1686,7 @@ def on_ensure(statements)
16771686 ending = find_keyword ( :end )
16781687 start_char = find_next_statement_start ( keyword . location . end_char )
16791688 statements . bind (
1689+ self ,
16801690 start_char ,
16811691 start_char - line_counts [ keyword . location . start_line - 1 ] . start ,
16821692 ending . location . start_char ,
@@ -1817,6 +1827,7 @@ def on_for(index, collection, statements)
18171827 find_next_statement_start ( ( delimiter || collection ) . location . end_char )
18181828
18191829 statements . bind (
1830+ self ,
18201831 start_char ,
18211832 start_char -
18221833 line_counts [ ( delimiter || collection ) . location . end_line - 1 ] . start ,
@@ -2036,6 +2047,7 @@ def on_if(predicate, statements, consequent)
20362047 start_char =
20372048 find_next_statement_start ( ( keyword || predicate ) . location . end_char )
20382049 statements . bind (
2050+ self ,
20392051 start_char ,
20402052 start_char - line_counts [ predicate . location . end_line - 1 ] . start ,
20412053 ending . location . start_char ,
@@ -2068,8 +2080,7 @@ def on_if_mod(predicate, statement)
20682080
20692081 IfNode . new (
20702082 predicate : predicate ,
2071- statements :
2072- Statements . new ( self , body : [ statement ] , location : statement . location ) ,
2083+ statements : Statements . new ( body : [ statement ] , location : statement . location ) ,
20732084 consequent : nil ,
20742085 location : statement . location . to ( predicate . location )
20752086 )
@@ -2121,6 +2132,7 @@ def on_in(pattern, statements, consequent)
21212132 start_char =
21222133 find_next_statement_start ( ( token || statements_start ) . location . end_char )
21232134 statements . bind (
2135+ self ,
21242136 start_char ,
21252137 start_char -
21262138 line_counts [ statements_start . location . start_line - 1 ] . start ,
@@ -2303,6 +2315,7 @@ def on_lambda(params, statements)
23032315
23042316 start_char = find_next_statement_start ( opening . location . end_char )
23052317 statements . bind (
2318+ self ,
23062319 start_char ,
23072320 start_char - line_counts [ opening . location . end_line - 1 ] . start ,
23082321 closing . location . start_char ,
@@ -2587,6 +2600,7 @@ def on_module(constant, bodystmt)
25872600 start_char = find_next_statement_start ( constant . location . end_char )
25882601
25892602 bodystmt . bind (
2603+ self ,
25902604 start_char ,
25912605 start_char - line_counts [ constant . location . start_line - 1 ] . start ,
25922606 ending . location . start_char ,
@@ -2863,7 +2877,7 @@ def on_program(statements)
28632877 )
28642878
28652879 statements . body << @__end__ if @__end__
2866- statements . bind ( 0 , 0 , source . length , last_column )
2880+ statements . bind ( self , 0 , 0 , source . length , last_column )
28672881
28682882 program = Program . new ( statements : statements , location : location )
28692883 attach_comments ( program , @comments )
@@ -3197,6 +3211,7 @@ def on_rescue(exceptions, variable, statements, consequent)
31973211 last_node = variable || exceptions || keyword
31983212 start_char = find_next_statement_start ( last_node . end_char )
31993213 statements . bind (
3214+ self ,
32003215 start_char ,
32013216 start_char - line_counts [ last_node . location . start_line - 1 ] . start ,
32023217 char_pos ,
@@ -3315,6 +3330,7 @@ def on_sclass(target, bodystmt)
33153330 start_char = find_next_statement_start ( target . location . end_char )
33163331
33173332 bodystmt . bind (
3333+ self ,
33183334 start_char ,
33193335 start_char - line_counts [ target . location . start_line - 1 ] . start ,
33203336 ending . location . start_char ,
@@ -3369,7 +3385,6 @@ def on_stmts_add(statements, statement)
33693385 end
33703386
33713387 Statements . new (
3372- self ,
33733388 body : statements . body << statement ,
33743389 location : location
33753390 )
@@ -3379,7 +3394,6 @@ def on_stmts_add(statements, statement)
33793394 # on_stmts_new: () -> Statements
33803395 def on_stmts_new
33813396 Statements . new (
3382- self ,
33833397 body : [ ] ,
33843398 location :
33853399 Location . fixed ( line : lineno , char : char_pos , column : current_column )
@@ -3444,6 +3458,7 @@ def on_string_embexpr(statements)
34443458 embexpr_end = consume_token ( EmbExprEnd )
34453459
34463460 statements . bind (
3461+ self ,
34473462 embexpr_beg . location . end_char ,
34483463 embexpr_beg . location . end_column ,
34493464 embexpr_end . location . start_char ,
@@ -3794,6 +3809,7 @@ def on_unless(predicate, statements, consequent)
37943809 start_char =
37953810 find_next_statement_start ( ( keyword || predicate ) . location . end_char )
37963811 statements . bind (
3812+ self ,
37973813 start_char ,
37983814 start_char - line_counts [ predicate . location . end_line - 1 ] . start ,
37993815 ending . location . start_char ,
@@ -3816,7 +3832,7 @@ def on_unless_mod(predicate, statement)
38163832 UnlessNode . new (
38173833 predicate : predicate ,
38183834 statements :
3819- Statements . new ( self , body : [ statement ] , location : statement . location ) ,
3835+ Statements . new ( body : [ statement ] , location : statement . location ) ,
38203836 consequent : nil ,
38213837 location : statement . location . to ( predicate . location )
38223838 )
@@ -3839,6 +3855,7 @@ def on_until(predicate, statements)
38393855 find_next_statement_start ( ( delimiter || predicate ) . location . end_char )
38403856
38413857 statements . bind (
3858+ self ,
38423859 start_char ,
38433860 start_char - line_counts [ predicate . location . end_line - 1 ] . start ,
38443861 ending . location . start_char ,
@@ -3860,7 +3877,7 @@ def on_until_mod(predicate, statement)
38603877 UntilNode . new (
38613878 predicate : predicate ,
38623879 statements :
3863- Statements . new ( self , body : [ statement ] , location : statement . location ) ,
3880+ Statements . new ( body : [ statement ] , location : statement . location ) ,
38643881 location : statement . location . to ( predicate . location )
38653882 )
38663883 end
@@ -3935,6 +3952,7 @@ def on_when(arguments, statements, consequent)
39353952 find_next_statement_start ( ( token || statements_start ) . location . end_char )
39363953
39373954 statements . bind (
3955+ self ,
39383956 start_char ,
39393957 start_char -
39403958 line_counts [ statements_start . location . start_line - 1 ] . start ,
@@ -3967,6 +3985,7 @@ def on_while(predicate, statements)
39673985 find_next_statement_start ( ( delimiter || predicate ) . location . end_char )
39683986
39693987 statements . bind (
3988+ self ,
39703989 start_char ,
39713990 start_char - line_counts [ predicate . location . end_line - 1 ] . start ,
39723991 ending . location . start_char ,
@@ -3988,7 +4007,7 @@ def on_while_mod(predicate, statement)
39884007 WhileNode . new (
39894008 predicate : predicate ,
39904009 statements :
3991- Statements . new ( self , body : [ statement ] , location : statement . location ) ,
4010+ Statements . new ( body : [ statement ] , location : statement . location ) ,
39924011 location : statement . location . to ( predicate . location )
39934012 )
39944013 end
0 commit comments