Skip to content

Commit 241d016

Browse files
committed
Fix opening loc for an empty symbol
1 parent 0adb234 commit 241d016

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/prism.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14205,7 +14205,6 @@ parse_strings(pm_parser_t *parser, pm_node_t *current) {
1420514205
// If we get here, then we have an end of a label immediately
1420614206
// after a start. In that case we'll create an empty symbol
1420714207
// node.
14208-
pm_token_t opening = not_provided(parser);
1420914208
pm_token_t content = parse_strings_empty_content(parser->previous.start);
1421014209
pm_symbol_node_t *symbol = pm_symbol_node_create(parser, &opening, &content, &parser->previous);
1421114210

test/prism/location_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def test_ArrayPatternNode
4343
end
4444

4545
def test_AssocNode
46+
assert_location(AssocNode, "{ '': 1 }", 2...7) { |node| node.elements.first }
4647
assert_location(AssocNode, "{ foo: :bar }", 2...11) { |node| node.elements.first }
4748
assert_location(AssocNode, "{ :foo => :bar }", 2...14) { |node| node.elements.first }
4849
assert_location(AssocNode, "foo(bar: :baz)", 4...13) { |node| node.arguments.arguments.first.elements.first }

0 commit comments

Comments
 (0)