Skip to content

Commit 3c4851c

Browse files
authored
Merge pull request #3342 from Earlopain/parser-translator-qw-array
2 parents f5ae6d2 + 83f995e commit 3c4851c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

lib/prism/translation/parser/lexer.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ def to_a
384384
if (next_token = lexed[index][0]) && next_token.type != :STRING_CONTENT && next_token.type != :STRING_END
385385
type = :tBACK_REF2
386386
end
387+
when :tSYMBOLS_BEG, :tQSYMBOLS_BEG, :tWORDS_BEG, :tQWORDS_BEG
388+
if (next_token = lexed[index][0]) && next_token.type == :WORDS_SEP
389+
index += 1
390+
end
387391
end
388392

389393
tokens << [type, [value, location]]

test/prism/ruby/parser_test.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ class ParserTest < TestCase
116116
"seattlerb/heredoc_with_carriage_return_escapes.txt",
117117
"seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt",
118118
"seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt",
119-
"seattlerb/interpolated_symbol_array_line_breaks.txt",
120-
"seattlerb/interpolated_word_array_line_breaks.txt",
121119
"seattlerb/module_comments.txt",
122-
"seattlerb/non_interpolated_symbol_array_line_breaks.txt",
123-
"seattlerb/non_interpolated_word_array_line_breaks.txt",
124120
"seattlerb/parse_line_block_inline_comment_leading_newlines.txt",
125121
"seattlerb/parse_line_block_inline_comment.txt",
126122
"seattlerb/parse_line_block_inline_multiline_comment.txt",
@@ -129,17 +125,14 @@ class ParserTest < TestCase
129125
"seattlerb/parse_line_multiline_str_literal_n.txt",
130126
"seattlerb/parse_line_str_with_newline_escape.txt",
131127
"seattlerb/pct_w_heredoc_interp_nested.txt",
132-
"seattlerb/qsymbols_empty_space.txt",
133128
"seattlerb/qw_escape_term.txt",
134-
"seattlerb/qWords_space.txt",
135129
"seattlerb/read_escape_unicode_curlies.txt",
136130
"seattlerb/read_escape_unicode_h4.txt",
137131
"seattlerb/required_kwarg_no_value.txt",
138132
"seattlerb/slashy_newlines_within_string.txt",
139133
"seattlerb/str_double_escaped_newline.txt",
140134
"seattlerb/str_evstr_escape.txt",
141135
"seattlerb/str_newline_hash_line_number.txt",
142-
"seattlerb/symbols_empty_space.txt",
143136
"seattlerb/TestRubyParserShared.txt",
144137
"unparser/corpus/literal/assignment.txt",
145138
"unparser/corpus/literal/dstr.txt",
@@ -152,7 +145,6 @@ class ParserTest < TestCase
152145
"whitequark/dedenting_heredoc.txt",
153146
"whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt",
154147
"whitequark/forward_arg_with_open_args.txt",
155-
"whitequark/interp_digit_var.txt",
156148
"whitequark/lbrace_arg_after_command_args.txt",
157149
"whitequark/multiple_pattern_matches.txt",
158150
"whitequark/newline_in_hash_argument.txt",

0 commit comments

Comments
 (0)