lib/ruby_parser.yy in ruby_parser-3.8.0 vs lib/ruby_parser.yy in ruby_parser-3.8.1

- old
+ new

@@ -471,18 +471,30 @@ } | primary_value tDOT tIDENTIFIER { result = s(:attrasgn, val[0], :"#{val[2]}=") } +#if defined(RUBY23) + | primary_value tLONELY tIDENTIFIER + { + result = s(:attrasgnx, val[0], :"#{val[2]}=") + } +#endif | primary_value tCOLON2 tIDENTIFIER { result = s(:attrasgn, val[0], :"#{val[2]}=") } | primary_value tDOT tCONSTANT { result = s(:attrasgn, val[0], :"#{val[2]}=") } +#if defined(RUBY23) + | primary_value tLONELY tCONSTANT + { + result = s(:attrasgnx, val[0], :"#{val[2]}=") + } +#endif | primary_value tCOLON2 tCONSTANT { if (self.in_def || self.in_single > 0) then debug20 7 yyerror "dynamic constant assignment" @@ -524,22 +536,24 @@ #if defined(RUBY23) | primary_value tLONELY tIDENTIFIER { result = s(:safe_attrasgn, val[0], :"#{val[2]}=") } - | primary_value tLONELY tCONSTANT - { - result = s(:safe_attrasgn, val[0], :"#{val[2]}=") - } #endif | primary_value tCOLON2 tIDENTIFIER { result = s(:attrasgn, val[0], :"#{val[2]}=") } | primary_value tDOT tCONSTANT # REFACTOR? { result = s(:attrasgn, val[0], :"#{val[2]}=") } +#if defined(RUBY23) + | primary_value tLONELY tCONSTANT + { + result = s(:safe_attrasgn, val[0], :"#{val[2]}=") + } +#endif | primary_value tCOLON2 tCONSTANT { if (self.in_def || self.in_single > 0) then debug20 10 yyerror "dynamic constant assignment"