|
55 | 55 | [:whitespace, " "], |
56 | 56 | [:open_hash, "{"], |
57 | 57 | [:number, "1"], |
| 58 | + ([:whitespace, " "] if hash34?), |
58 | 59 | [:refers, "=>"], |
| 60 | + ([:whitespace, " "] if hash34?), |
59 | 61 | [:number, "3"], |
60 | 62 | [:close_hash, "}"], |
61 | 63 | [:object_description, ":each"], |
62 | 64 | [:close_object, ">"], |
63 | | - ] |
| 65 | + ].compact |
64 | 66 | end |
65 | 67 |
|
66 | 68 | please do check({1=>3}.each.map) |
|
75 | 77 | [:whitespace, " "], |
76 | 78 | [:open_hash, "{"], |
77 | 79 | [:number, "1"], |
| 80 | + ([:whitespace, " "] if hash34?), |
78 | 81 | [:refers, "=>"], |
| 82 | + ([:whitespace, " "] if hash34?), |
79 | 83 | [:number, "3"], |
80 | 84 | [:close_hash, "}"], |
81 | 85 | [:object_description, ":each"], |
82 | 86 | [:close_object, ">"], |
83 | 87 | [:object_description, RubyEngine.truffle? ? ":collect" : ":map"], |
84 | 88 | [:close_object, ">"], |
85 | | - ] |
| 89 | + ].compact |
86 | 90 | end |
87 | 91 |
|
88 | 92 | please do check [2,Set[{1=>2}],4].map |
|
102 | 106 | [:open_set, "{"], |
103 | 107 | [:open_hash, "{"], |
104 | 108 | [:number, "1"], |
| 109 | + ([:whitespace, " "] if hash34?), |
105 | 110 | [:refers, "=>"], |
| 111 | + ([:whitespace, " "] if hash34?), |
106 | 112 | [:number, "2"], |
107 | 113 | [:close_hash, "}"], |
108 | 114 | [:close_set, "}"], |
|
113 | 119 | [:close_array, "]"], |
114 | 120 | [:object_description, ":map"], |
115 | 121 | [:close_object, ">"], |
116 | | - ] |
| 122 | + ].compact |
117 | 123 | end |
118 | 124 |
|
119 | 125 | please do check Wirb::Tokenizer.run('[2,3,4]') |
|
131 | 137 | [:close_string, "\""], |
132 | 138 | [:object_description, ")"], |
133 | 139 | [:close_object, ">"], |
134 | | - ] |
| 140 | + ].compact |
135 | 141 | end |
136 | 142 |
|
137 | 143 | please do check [{1=>2},Wirb::Tokenizer.run('2'),Set[2,3],[3,4],[5,6].each].map |
|
143 | 149 | [:open_array, "["], |
144 | 150 | [:open_hash, "{"], |
145 | 151 | [:number, "1"], |
| 152 | + ([:whitespace, " "] if hash34?), |
146 | 153 | [:refers, "=>"], |
| 154 | + ([:whitespace, " "] if hash34?), |
147 | 155 | [:number, "2"], |
148 | 156 | [:close_hash, "}"], |
149 | 157 | [:comma, ","], |
|
199 | 207 | [:close_array, "]"], |
200 | 208 | [:object_description, ":map"], |
201 | 209 | [:close_object, ">"], |
202 | | - ] |
| 210 | + ].compact |
203 | 211 | end |
204 | 212 | else # is rbx |
205 | 213 | please do check [2,3,4].each |
|
0 commit comments