[ruby/prism] (parser) Fix up tokens for empty symbol

https://github.com/ruby/prism/commit/5985ab7687
This commit is contained in:
Kevin Newton 2024-06-12 09:44:28 -04:00
parent c93b70cfdd
commit 24f48382bc
2 changed files with 2 additions and 3 deletions

View File

@ -339,7 +339,7 @@ module Prism
location = Range.new(source_buffer, offset_cache[token.location.start_offset], offset_cache[token.location.start_offset + 1])
end
when :tSYMBEG
if (next_token = lexed[index][0]) && next_token.type != :STRING_CONTENT && next_token.type != :EMBEXPR_BEGIN && next_token.type != :EMBVAR
if (next_token = lexed[index][0]) && next_token.type != :STRING_CONTENT && next_token.type != :EMBEXPR_BEGIN && next_token.type != :EMBVAR && next_token.type != :STRING_END
next_location = token.location.join(next_token.location)
type = :tSYMBOL
value = next_token.value

View File

@ -144,7 +144,6 @@ module Prism
"seattlerb/str_evstr_escape.txt",
"seattlerb/str_newline_hash_line_number.txt",
"seattlerb/str_single_newline.txt",
"seattlerb/symbol_empty.txt",
"seattlerb/symbols_empty_space.txt",
"seattlerb/TestRubyParserShared.txt",
"unparser/corpus/literal/assignment.txt",
@ -247,7 +246,7 @@ module Prism
while expected_index < expected_tokens.length
expected_token = expected_tokens[expected_index]
actual_token = actual_tokens[actual_index]
actual_token = actual_tokens.fetch(actual_index, [])
expected_index += 1
actual_index += 1