Skip to content

Commit

Permalink
a few fixes to fully integrate 3.4 grammar (#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
iliabylich committed Jan 15, 2024
1 parent a3f7dc5 commit 7340bc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/parser/ruby34.y
Expand Up @@ -3116,7 +3116,7 @@ require 'parser'
---- inner
def version
33
34
end
def default_encoding
Expand Down
5 changes: 3 additions & 2 deletions test/test_parser.rb
Expand Up @@ -33,6 +33,7 @@ def parser_for_ruby_version(version)
SINCE_3_1 = SINCE_3_0 - %w(3.0)
SINCE_3_2 = SINCE_3_1 - %w(3.1)
SINCE_3_3 = SINCE_3_2 - %w(3.2)
SINCE_3_4 = SINCE_3_3 - %w(3.3)

# Guidelines for test naming:
# * Test structure follows structure of AST_FORMAT.md.
Expand Down Expand Up @@ -9218,7 +9219,7 @@ def test_pattern_matching_hash_with_heredoc_keys
# diagnostic error because of the wrong lvar name
assert_diagnoses(
[:error, :lvar_name, { name: "a\n" }],
%Q{case nil; in "\#{ <<-HERE }":;\na\nHERE\nelse\nend},
"case nil; in \"\#{ <<-HERE }\":;\na\nHERE\nelse\nend",
%q{ ~~~~~~~ location},
SINCE_2_7
)
Expand Down Expand Up @@ -10600,7 +10601,7 @@ def test_parser_drops_truncated_parts_of_squiggly_heredoc
s(:dstr,
s(:begin),
s(:str, "\n")),
%q{<<~HERE! #{}!HERE}.gsub('!', "\n"),
"<<~HERE\n \#{}\nHERE",
%q{},
SINCE_2_3)
end
Expand Down

0 comments on commit 7340bc3

Please sign in to comment.