@@ -1093,7 +1093,16 @@ class AstNodeVisitor extends ThrowingAstVisitor<Piece> with PieceFactory {
1093
1093
1094
1094
@override
1095
1095
Piece visitIndexExpression (IndexExpression node) {
1096
- throw UnimplementedError ();
1096
+ // TODO(tall): Allow splitting before and/or after the `[` when method
1097
+ // chain formatting is fully implemented. For now, we just output the code
1098
+ // so that tests of other language features that contain index expressions
1099
+ // can run.
1100
+ return buildPiece ((b) {
1101
+ b.visit (node.target);
1102
+ b.token (node.leftBracket);
1103
+ b.visit (node.index);
1104
+ b.token (node.rightBracket);
1105
+ });
1097
1106
}
1098
1107
1099
1108
@override
@@ -1403,12 +1412,22 @@ class AstNodeVisitor extends ThrowingAstVisitor<Piece> with PieceFactory {
1403
1412
1404
1413
@override
1405
1414
Piece visitPostfixExpression (PostfixExpression node) {
1406
- throw UnimplementedError ();
1415
+ return buildPiece ((b) {
1416
+ b.visit (node.operand);
1417
+ b.token (node.operator );
1418
+ });
1407
1419
}
1408
1420
1409
1421
@override
1410
1422
Piece visitPrefixedIdentifier (PrefixedIdentifier node) {
1411
- throw UnimplementedError ();
1423
+ // TODO(tall): Allow splitting before the `.` when method chain formatting
1424
+ // is fully implemented. For now, we just output the code so that tests
1425
+ // of other language features that contain prefixed identifiers can run.
1426
+ return buildPiece ((b) {
1427
+ b.visit (node.prefix);
1428
+ b.token (node.period);
1429
+ b.visit (node.identifier);
1430
+ });
1412
1431
}
1413
1432
1414
1433
@override
@@ -1429,7 +1448,14 @@ class AstNodeVisitor extends ThrowingAstVisitor<Piece> with PieceFactory {
1429
1448
1430
1449
@override
1431
1450
Piece visitPropertyAccess (PropertyAccess node) {
1432
- throw UnimplementedError ();
1451
+ // TODO(tall): Allow splitting before the `.` when method chain formatting
1452
+ // is fully implemented. For now, we just output the code so that tests
1453
+ // of other language features that contain property accesses can run.
1454
+ return buildPiece ((b) {
1455
+ b.visit (node.target);
1456
+ b.token (node.operator );
1457
+ b.visit (node.propertyName);
1458
+ });
1433
1459
}
1434
1460
1435
1461
@override
0 commit comments