Skip to content

Commit 984f82f

Browse files
committed
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.
1 parent 5b93b3a commit 984f82f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/yard/parser/ruby/legacy/ruby_lex.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ def identify_gvar
978978
end
979979

980980
def identify_identifier
981-
token = ""
981+
token = String.new(encoding: Encoding::UTF_8)
982982
token.concat getc if peek(0) =~ /[$@]/
983983
token.concat getc if peek(0) == "@"
984984

0 commit comments

Comments
 (0)