From 984f82f5036e802c0ea731430e2435be515bc20b Mon Sep 17 00:00:00 2001 From: viralpraxis Date: Thu, 11 Sep 2025 00:26:00 +0400 Subject: [PATCH] Fix frozen string literal mutation There's a warning ```shell ruby_lex.rb:987: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information ``` which will lead to an error when frozen strings literals (MRI 3.5?) will be frozen by default. --- lib/yard/parser/ruby/legacy/ruby_lex.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yard/parser/ruby/legacy/ruby_lex.rb b/lib/yard/parser/ruby/legacy/ruby_lex.rb index 40f805ff0..2f139d0d5 100644 --- a/lib/yard/parser/ruby/legacy/ruby_lex.rb +++ b/lib/yard/parser/ruby/legacy/ruby_lex.rb @@ -978,7 +978,7 @@ def identify_gvar end def identify_identifier - token = "" + token = String.new(encoding: Encoding::UTF_8) token.concat getc if peek(0) =~ /[$@]/ token.concat getc if peek(0) == "@"