Skip to content

Commit 044ba76

Browse files
hsbtk0kubun
authored andcommitted
Revert "[ruby/prism] Clear flags on interpolated strings"
This reverts commit a495e6a. 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 ```
1 parent d51a24e commit 044ba76

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

prism/prism.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5279,10 +5279,6 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_
52795279

52805280
switch (PM_NODE_TYPE(part)) {
52815281
case PM_STRING_NODE:
5282-
// If inner string is not frozen, clear flags for this string
5283-
if (!PM_NODE_FLAG_P(part, PM_STRING_FLAGS_FROZEN)) {
5284-
CLEAR_FLAGS(node);
5285-
}
52865282
part->flags = (pm_node_flags_t) ((part->flags | PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN) & ~PM_STRING_FLAGS_MUTABLE);
52875283
break;
52885284
case PM_INTERPOLATED_STRING_NODE:

test/prism/result/static_literals_test.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44

55
module Prism
66
class StaticLiteralsTest < TestCase
7-
def test_concatenanted_string_literal_is_not_static
8-
node = Prism.parse_statement("'a' 'b'")
9-
refute_predicate node, :static_literal?
10-
end
11-
127
def test_static_literals
138
assert_warning("1")
149
assert_warning("0xA", "10", "10")

0 commit comments

Comments
 (0)