File tree Expand file tree Collapse file tree 3 files changed +2
-52
lines changed
Expand file tree Collapse file tree 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
846846 $ tokens ->consumeTokenType (Lexer::TOKEN_COLON );
847847 $ value = $ this ->parse ($ tokens );
848848
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- }
854849 $ tokens ->dropSavePoint ();
855850
856851 return $ this ->enrichWithAttributes (
Original file line number Diff line number Diff line change @@ -162,51 +162,6 @@ public function provideParseData(): array
162162 ),
163163 ]),
164164 ],
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- ],
210165 [
211166 'array{
212167 /* a is also for aardvark */
Original file line number Diff line number Diff line change @@ -664,7 +664,7 @@ public function enterNode(Node $node)
664664
665665 };
666666
667- $ addSingleLineCommentsToMultilineArrayShape = new class extends AbstractNodeVisitor {
667+ $ addCommentsToMultilineArrayShape = new class extends AbstractNodeVisitor {
668668
669669 public function enterNode (Node $ node )
670670 {
@@ -725,7 +725,7 @@ public function enterNode(Node $node)
725725 * e: string
726726 * }
727727 */ ' ,
728- $ addSingleLineCommentsToMultilineArrayShape ,
728+ $ addCommentsToMultilineArrayShape ,
729729 ];
730730
731731
You can’t perform that action at this time.
0 commit comments