Skip to content

Commit

Permalink
Suppress "literal string will be frozen" warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 22, 2024
1 parent 8d84132 commit b5faf7c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/gettext/tools/parser/ruby.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=begin
parser/ruby.rb - parser for ruby script
Copyright (C) 2013-2021 Sutou Kouhei <[email protected]>
Copyright (C) 2013-2024 Sutou Kouhei <[email protected]>
Copyright (C) 2003-2009 Masao Mutoh
Copyright (C) 2005 speakillof
Copyright (C) 2001,2002 Yasushi Shoji, Masao Mutoh
Expand Down Expand Up @@ -36,7 +36,7 @@ def initialize(*args)
@current_po_entry_nth_attribute = 0
@use_comment = false
@comment_tag = nil
@last_comment = ""
@last_comment = +""
@reset_comment = false
@string_mark_stack = []
@string_stack = []
Expand Down Expand Up @@ -86,7 +86,7 @@ def process_on_ident(token, po)
end
if @current_po_entry
@current_po_entry.add_comment(@last_comment) unless @last_comment.empty?
@last_comment = ""
@last_comment = +""
@current_po_entry.references << "#{filename}:#{lineno}"
@current_po_entry_nth_attribute = 0
end
Expand All @@ -104,7 +104,7 @@ def process_on_const(token, po)
end

def process_on_comment(token, po)
@last_comment = "" if @reset_comment
@last_comment = +"" if @reset_comment
@reset_comment = false
if @last_comment.empty?
content = token.gsub(/\A#\s*/, "").chomp
Expand Down Expand Up @@ -133,7 +133,7 @@ def process_on_tstring_beg(token, po)
else
@string_mark_stack << token
end
@string_stack << ""
@string_stack << +""
po
end

Expand Down Expand Up @@ -192,7 +192,7 @@ def process_on_heredoc_beg(token, po)
else
@string_mark_stack << "\""
end
@string_stack << ""
@string_stack << +""
po
end

Expand All @@ -202,7 +202,7 @@ def process_on_heredoc_end(token, po)

def process_on_regexp_beg(token, po)
@string_mark_stack << "\""
@string_stack << ""
@string_stack << +""
po
end

Expand Down Expand Up @@ -245,38 +245,38 @@ def process_on_nl(token, po)
def process_on_symbeg(token, po)
if token.start_with?("%s") or [":'", ":\""].include?(token)
@string_mark_stack << ":"
@string_stack << ""
@string_stack << +""
end
po
end

def process_on_backtick(token, po)
@string_mark_stack << "`"
@string_stack << ""
@string_stack << +""
po
end

def process_on_symbols_beg(token, po)
@string_mark_stack << "\""
@string_stack << ""
@string_stack << +""
po
end

def process_on_qsymbols_beg(token, po)
@string_mark_stack << token
@string_stack << ""
@string_stack << +""
po
end

def process_on_words_beg(token, po)
@string_mark_stack << "\""
@string_stack << ""
@string_stack << +""
po
end

def process_on_qwords_beg(token, po)
@string_mark_stack << token
@string_stack << ""
@string_stack << +""
po
end

Expand Down

0 comments on commit b5faf7c

Please sign in to comment.