File tree 3 files changed +2
-52
lines changed
3 files changed +2
-52
lines changed Original file line number Diff line number Diff line change @@ -846,11 +846,6 @@ private function parseArrayShapeItem(TokenIterator $tokens): Ast\Type\ArrayShape
846
846
$ tokens ->consumeTokenType (Lexer::TOKEN_COLON );
847
847
$ value = $ this ->parse ($ tokens );
848
848
849
- // parse comment to the right of the item
850
- if ($ tokens ->currentTokenType () === Lexer::TOKEN_COMMENT ) {
851
- $ comments [] = new Ast \Comment ($ tokens ->currentTokenValue (), $ tokens ->currentTokenLine (), $ tokens ->currentTokenIndex ());
852
- $ tokens ->next ();
853
- }
854
849
$ tokens ->dropSavePoint ();
855
850
856
851
return $ this ->enrichWithAttributes (
Original file line number Diff line number Diff line change @@ -162,51 +162,6 @@ public function provideParseData(): array
162
162
),
163
163
]),
164
164
],
165
- [
166
- 'array{
167
- a: int, // a is for after,
168
- } ' ,
169
- new ArrayShapeNode ([
170
- new ArrayShapeItemNode (
171
- new IdentifierTypeNode ('a ' ),
172
- false ,
173
- new IdentifierTypeNode ('int ' )
174
- ),
175
- ]),
176
- ],
177
- [
178
- 'array{
179
- // you can never have
180
- a: int, // too many comments
181
- } ' ,
182
- new ArrayShapeNode ([
183
- new ArrayShapeItemNode (
184
- new IdentifierTypeNode ('a ' ),
185
- false ,
186
- new IdentifierTypeNode ('int ' )
187
- ),
188
- ]),
189
- ],
190
- [
191
- 'array{
192
- a: int, // a is for after,
193
- b: string, /* b is for banana,
194
- * which is good to know
195
- */
196
- } ' ,
197
- new ArrayShapeNode ([
198
- new ArrayShapeItemNode (
199
- new IdentifierTypeNode ('a ' ),
200
- false ,
201
- new IdentifierTypeNode ('int ' )
202
- ),
203
- new ArrayShapeItemNode (
204
- new IdentifierTypeNode ('b ' ),
205
- false ,
206
- new IdentifierTypeNode ('string ' )
207
- ),
208
- ]),
209
- ],
210
165
[
211
166
'array{
212
167
/* a is also for aardvark */
Original file line number Diff line number Diff line change @@ -664,7 +664,7 @@ public function enterNode(Node $node)
664
664
665
665
};
666
666
667
- $ addSingleLineCommentsToMultilineArrayShape = new class extends AbstractNodeVisitor {
667
+ $ addCommentsToMultilineArrayShape = new class extends AbstractNodeVisitor {
668
668
669
669
public function enterNode (Node $ node )
670
670
{
@@ -725,7 +725,7 @@ public function enterNode(Node $node)
725
725
* e: string
726
726
* }
727
727
*/ ' ,
728
- $ addSingleLineCommentsToMultilineArrayShape ,
728
+ $ addCommentsToMultilineArrayShape ,
729
729
];
730
730
731
731
You can’t perform that action at this time.
0 commit comments