OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'package:front_end/src/fasta/scanner.dart' show Token; | 5 import 'package:front_end/src/fasta/scanner.dart' show Token; |
6 import 'package:front_end/src/fasta/scanner/token_constants.dart' as Tokens | 6 import 'package:front_end/src/fasta/scanner/token_constants.dart' as Tokens |
7 show IDENTIFIER_TOKEN, KEYWORD_TOKEN, PLUS_TOKEN; | 7 show IDENTIFIER_TOKEN, KEYWORD_TOKEN, PLUS_TOKEN; |
8 import '../util/util.dart'; | 8 import '../util/util.dart'; |
9 import 'nodes.dart'; | 9 import 'nodes.dart'; |
10 | 10 |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 write(' '); | 541 write(' '); |
542 visit(node.expression); | 542 visit(node.expression); |
543 } | 543 } |
544 | 544 |
545 visitAwait(Await node) { | 545 visitAwait(Await node) { |
546 write(node.awaitToken.value); | 546 write(node.awaitToken.value); |
547 write(' '); | 547 write(' '); |
548 visit(node.expression); | 548 visit(node.expression); |
549 } | 549 } |
550 | 550 |
551 visitNominalTypeAnnotation(NominalTypeAnnotation node) { | 551 visitTypeAnnotation(TypeAnnotation node) { |
552 visit(node.typeName); | 552 visit(node.typeName); |
553 visit(node.typeArguments); | 553 visit(node.typeArguments); |
554 } | 554 } |
555 | 555 |
556 visitFunctionTypeAnnotation(FunctionTypeAnnotation node) { | |
557 visit(node.returnType); | |
558 write(' Function'); | |
559 visit(node.typeParameters); | |
560 visit(node.formals); | |
561 } | |
562 | |
563 visitTypeVariable(TypeVariable node) { | 556 visitTypeVariable(TypeVariable node) { |
564 visit(node.name); | 557 visit(node.name); |
565 if (node.bound != null) { | 558 if (node.bound != null) { |
566 write(' extends '); | 559 write(' extends '); |
567 visit(node.bound); | 560 visit(node.bound); |
568 } | 561 } |
569 } | 562 } |
570 | 563 |
571 visitVariableDefinitions(VariableDefinitions node) { | 564 visitVariableDefinitions(VariableDefinitions node) { |
572 if (node.metadata != null) { | 565 if (node.metadata != null) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 visit(node.block); | 764 visit(node.block); |
772 } | 765 } |
773 | 766 |
774 visitTypedef(Typedef node) { | 767 visitTypedef(Typedef node) { |
775 addToken(node.typedefKeyword); | 768 addToken(node.typedefKeyword); |
776 if (node.returnType != null) { | 769 if (node.returnType != null) { |
777 visit(node.returnType); | 770 visit(node.returnType); |
778 write(' '); | 771 write(' '); |
779 } | 772 } |
780 visit(node.name); | 773 visit(node.name); |
781 if (node.templateParameters != null) { | 774 if (node.typeParameters != null) { |
782 visit(node.templateParameters); | 775 visit(node.typeParameters); |
783 } | 776 } |
784 visit(node.formals); | 777 visit(node.formals); |
785 write(node.endToken.value); | 778 write(node.endToken.value); |
786 } | 779 } |
787 | 780 |
788 visitLibraryName(LibraryName node) { | 781 visitLibraryName(LibraryName node) { |
789 addToken(node.libraryKeyword); | 782 addToken(node.libraryKeyword); |
790 node.visitChildren(this); | 783 node.visitChildren(this); |
791 write(node.getEndToken().value); | 784 write(node.getEndToken().value); |
792 newline(); | 785 newline(); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 throw 'internal error'; // Should not be called. | 897 throw 'internal error'; // Should not be called. |
905 } | 898 } |
906 | 899 |
907 visitStatement(Statement node) { | 900 visitStatement(Statement node) { |
908 throw 'internal error'; // Should not be called. | 901 throw 'internal error'; // Should not be called. |
909 } | 902 } |
910 | 903 |
911 visitStringNode(StringNode node) { | 904 visitStringNode(StringNode node) { |
912 throw 'internal error'; // Should not be called. | 905 throw 'internal error'; // Should not be called. |
913 } | 906 } |
914 | |
915 visitTypeAnnotation(TypeAnnotation node) { | |
916 throw 'internal error'; // Should not be called. | |
917 } | |
918 } | 907 } |
OLD | NEW |