File tree 3 files changed +7
-1
lines changed
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
6
6
7
7
## [ Unreleased]
8
8
9
+ ### Changed
10
+
11
+ - Correct the pattern for checking if a dynamic symbol can be converted into a label as a hash key.
12
+
9
13
## [ 2.4.1] - 2022-05-10
10
14
11
15
- [ #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)
1388
1388
module HashKeyFormatter
1389
1389
# Formats the keys of a hash literal using labels.
1390
1390
class Labels
1391
- LABEL = /^[@$_A -Za-z]([_A-Za-z0-9]*)?([!_=?A-Za-z0-9 ])?$ /
1391
+ LABEL = /\A [A -Za-z_]( \w *[ \w !? ])?\z /
1392
1392
1393
1393
def format_key ( q , key )
1394
1394
case key
Original file line number Diff line number Diff line change 46
46
{ foo: "bar" }
47
47
%
48
48
{ "foo #{ bar } ": "baz" }
49
+ %
50
+ { "foo=": "baz" }
You can’t perform that action at this time.
0 commit comments