File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66
77## [ Unreleased]
88
9+ ### Changed
10+
11+ - Correct the pattern for checking if a dynamic symbol can be converted into a label as a hash key.
12+
913## [ 2.4.1] - 2022-05-10
1014
1115- [ #73 ] ( https://github.com/ruby-syntax-tree/syntax_tree/pull/73 ) - Fix nested hash patterns from accidentally adding a ` then ` to their output.
Original file line number Diff line number Diff line change @@ -1388,7 +1388,7 @@ def format(q)
13881388 module HashKeyFormatter
13891389 # Formats the keys of a hash literal using labels.
13901390 class Labels
1391- LABEL = /^[@$_A -Za-z]([_A-Za-z0-9]*)?([!_=?A-Za-z0-9 ])?$ /
1391+ LABEL = /\A [A -Za-z_]( \w *[ \w !? ])?\z /
13921392
13931393 def format_key ( q , key )
13941394 case key
Original file line number Diff line number Diff line change 4646{ foo: "bar" }
4747%
4848{ "foo #{ bar } ": "baz" }
49+ %
50+ { "foo=": "baz" }
You can’t perform that action at this time.
0 commit comments