Skip to content

Commit

Permalink
Merge pull request #3342 from Earlopain/parser-translator-qw-array
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton authored Dec 23, 2024
2 parents f5ae6d2 + 83f995e commit 3c4851c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 4 additions & 0 deletions lib/prism/translation/parser/lexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ def to_a
if (next_token = lexed[index][0]) && next_token.type != :STRING_CONTENT && next_token.type != :STRING_END
type = :tBACK_REF2
end
when :tSYMBOLS_BEG, :tQSYMBOLS_BEG, :tWORDS_BEG, :tQWORDS_BEG
if (next_token = lexed[index][0]) && next_token.type == :WORDS_SEP
index += 1
end
end

tokens << [type, [value, location]]
Expand Down
8 changes: 0 additions & 8 deletions test/prism/ruby/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ class ParserTest < TestCase
"seattlerb/heredoc_with_carriage_return_escapes.txt",
"seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt",
"seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt",
"seattlerb/interpolated_symbol_array_line_breaks.txt",
"seattlerb/interpolated_word_array_line_breaks.txt",
"seattlerb/module_comments.txt",
"seattlerb/non_interpolated_symbol_array_line_breaks.txt",
"seattlerb/non_interpolated_word_array_line_breaks.txt",
"seattlerb/parse_line_block_inline_comment_leading_newlines.txt",
"seattlerb/parse_line_block_inline_comment.txt",
"seattlerb/parse_line_block_inline_multiline_comment.txt",
Expand All @@ -129,17 +125,14 @@ class ParserTest < TestCase
"seattlerb/parse_line_multiline_str_literal_n.txt",
"seattlerb/parse_line_str_with_newline_escape.txt",
"seattlerb/pct_w_heredoc_interp_nested.txt",
"seattlerb/qsymbols_empty_space.txt",
"seattlerb/qw_escape_term.txt",
"seattlerb/qWords_space.txt",
"seattlerb/read_escape_unicode_curlies.txt",
"seattlerb/read_escape_unicode_h4.txt",
"seattlerb/required_kwarg_no_value.txt",
"seattlerb/slashy_newlines_within_string.txt",
"seattlerb/str_double_escaped_newline.txt",
"seattlerb/str_evstr_escape.txt",
"seattlerb/str_newline_hash_line_number.txt",
"seattlerb/symbols_empty_space.txt",
"seattlerb/TestRubyParserShared.txt",
"unparser/corpus/literal/assignment.txt",
"unparser/corpus/literal/dstr.txt",
Expand All @@ -152,7 +145,6 @@ class ParserTest < TestCase
"whitequark/dedenting_heredoc.txt",
"whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt",
"whitequark/forward_arg_with_open_args.txt",
"whitequark/interp_digit_var.txt",
"whitequark/lbrace_arg_after_command_args.txt",
"whitequark/multiple_pattern_matches.txt",
"whitequark/newline_in_hash_argument.txt",
Expand Down

0 comments on commit 3c4851c

Please sign in to comment.