summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2025-07-22 09:06:02 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2025-07-22 09:07:04 +0900
commit7dbd9c26361719a45fa39838f46a76d67dc3c2e9 (patch)
tree595c114810c0c8de90da6f0f3abd9a9bb16ad931
parenta495e6a44ce8cff17461b250e32ab63e409a642d (diff)
Revert "[ruby/prism] Clear flags on interpolated strings"
This reverts commit a495e6a44ce8cff17461b250e32ab63e409a642d. This break extension builds: ``` /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:321:in 'String#replace': can't modify frozen String: "$(SDKROOT)$(prefix)/include" (FrozenError) from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:321:in 'RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:314:in 'block in RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'String#gsub' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:307:in 'RbConfig.expand' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:325:in 'block in <module:RbConfig>' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:324:in 'Hash#each_value' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:324:in '<module:RbConfig>' from /Users/hsbt/Documents/github.com/ruby/ruby/rbconfig.rb:11:in '<top (required)>' from ./ext/extmk.rb:42:in 'Kernel#require' from ./ext/extmk.rb:42:in '<main>' make[1]: *** [ext/configure-ext.mk:70: ext/json/exts.mk] Error 1 ```
-rw-r--r--prism/prism.c4
-rw-r--r--test/prism/result/static_literals_test.rb5
2 files changed, 0 insertions, 9 deletions
diff --git a/prism/prism.c b/prism/prism.c
index a40e0ebeb0..85647020d8 100644
--- a/prism/prism.c
+++ b/prism/prism.c
@@ -5279,10 +5279,6 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_
switch (PM_NODE_TYPE(part)) {
case PM_STRING_NODE:
- // If inner string is not frozen, clear flags for this string
- if (!PM_NODE_FLAG_P(part, PM_STRING_FLAGS_FROZEN)) {
- CLEAR_FLAGS(node);
- }
part->flags = (pm_node_flags_t) ((part->flags | PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN) & ~PM_STRING_FLAGS_MUTABLE);
break;
case PM_INTERPOLATED_STRING_NODE:
diff --git a/test/prism/result/static_literals_test.rb b/test/prism/result/static_literals_test.rb
index cc07027916..dcfc692897 100644
--- a/test/prism/result/static_literals_test.rb
+++ b/test/prism/result/static_literals_test.rb
@@ -4,11 +4,6 @@ require_relative "../test_helper"
module Prism
class StaticLiteralsTest < TestCase
- def test_concatenanted_string_literal_is_not_static
- node = Prism.parse_statement("'a' 'b'")
- refute_predicate node, :static_literal?
- end
-
def test_static_literals
assert_warning("1")
assert_warning("0xA", "10", "10")