[PRISM] Respect string encoding override in array literals
Fixes `TestZlibGzipReader#test_gets2`, `Psych_Unit_Tests#test_spec_explicit_families`, and many failures in `test_unicode_normalize.rb`.
This commit is contained in:
parent
770b5499a5
commit
8d33be9833
@ -405,7 +405,7 @@ pm_static_literal_value(const pm_node_t *node, const pm_scope_node_t *scope_node
|
|||||||
return INT2FIX(source_line);
|
return INT2FIX(source_line);
|
||||||
}
|
}
|
||||||
case PM_STRING_NODE:
|
case PM_STRING_NODE:
|
||||||
return parse_string(&((pm_string_node_t *) node)->unescaped, parser);
|
return parse_string_encoded(node, &((pm_string_node_t *)node)->unescaped, parser);
|
||||||
case PM_SYMBOL_NODE:
|
case PM_SYMBOL_NODE:
|
||||||
return ID2SYM(parse_string_symbol((pm_symbol_node_t *)node, parser));
|
return ID2SYM(parse_string_symbol((pm_symbol_node_t *)node, parser));
|
||||||
case PM_TRUE_NODE:
|
case PM_TRUE_NODE:
|
||||||
|
@ -834,6 +834,13 @@ module Prism
|
|||||||
|
|
||||||
# Test keyword splat inside of array
|
# Test keyword splat inside of array
|
||||||
assert_prism_eval("[**{x: 'hello'}]")
|
assert_prism_eval("[**{x: 'hello'}]")
|
||||||
|
|
||||||
|
# Test UTF-8 string array literal in a US-ASCII file
|
||||||
|
assert_prism_eval(<<~'RUBY', raw: true)
|
||||||
|
# -*- coding: us-ascii -*-
|
||||||
|
# frozen_string_literal: true
|
||||||
|
%W"\u{1f44b} \u{1f409}"
|
||||||
|
RUBY
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_AssocNode
|
def test_AssocNode
|
||||||
|
Loading…
x
Reference in New Issue
Block a user