diff options
-rw-r--r-- | lib/prism/translation/parser/lexer.rb | 2 | ||||
-rw-r--r-- | test/prism/ruby/parser_test.rb | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index 9d7caae0ba..8191bd19c5 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -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 diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index a5cf919ae5..879e866ef5 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -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 |