Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: pkg/analyzer/lib/dart/ast/visitor.dart

Issue 2622303006: Reapply "Add support for generic function type syntax, part 1" (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/dart/ast/resolution_map.dart ('k') | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /** 5 /**
6 * Defines AST visitors that support useful patterns for visiting the nodes in 6 * Defines AST visitors that support useful patterns for visiting the nodes in
7 * an [AST structure](ast.dart). 7 * an [AST structure](ast.dart).
8 * 8 *
9 * Dart is an evolving language, and the AST structure must evolved with it. 9 * Dart is an evolving language, and the AST structure must evolved with it.
10 * When the AST structure changes, the visitor interface will sometimes change 10 * When the AST structure changes, the visitor interface will sometimes change
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 visitInvocationExpression(node); 329 visitInvocationExpression(node);
330 330
331 @override 331 @override
332 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitTypeAlias(node); 332 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitTypeAlias(node);
333 333
334 @override 334 @override
335 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => 335 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
336 visitNormalFormalParameter(node); 336 visitNormalFormalParameter(node);
337 337
338 @override 338 @override
339 R visitGenericFunctionType(GenericFunctionType node) =>
340 visitTypeAnnotation(node);
341
342 @override
343 R visitGenericTypeAlias(GenericTypeAlias node) => visitTypeAlias(node);
344
345 @override
339 R visitHideCombinator(HideCombinator node) => visitCombinator(node); 346 R visitHideCombinator(HideCombinator node) => visitCombinator(node);
340 347
341 R visitIdentifier(Identifier node) => visitExpression(node); 348 R visitIdentifier(Identifier node) => visitExpression(node);
342 349
343 @override 350 @override
344 R visitIfStatement(IfStatement node) => visitStatement(node); 351 R visitIfStatement(IfStatement node) => visitStatement(node);
345 352
346 @override 353 @override
347 R visitImplementsClause(ImplementsClause node) => visitNode(node); 354 R visitImplementsClause(ImplementsClause node) => visitNode(node);
348 355
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 528
522 @override 529 @override
523 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => 530 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
524 visitCompilationUnitMember(node); 531 visitCompilationUnitMember(node);
525 532
526 @override 533 @override
527 R visitTryStatement(TryStatement node) => visitStatement(node); 534 R visitTryStatement(TryStatement node) => visitStatement(node);
528 535
529 R visitTypeAlias(TypeAlias node) => visitNamedCompilationUnitMember(node); 536 R visitTypeAlias(TypeAlias node) => visitNamedCompilationUnitMember(node);
530 537
538 R visitTypeAnnotation(TypeAnnotation node) => visitNode(node);
539
531 @override 540 @override
532 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node); 541 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node);
533 542
534 R visitTypedLiteral(TypedLiteral node) => visitLiteral(node); 543 R visitTypedLiteral(TypedLiteral node) => visitLiteral(node);
535 544
536 @override 545 @override
537 R visitTypeName(TypeName node) => visitNode(node); 546 R visitTypeName(TypeName node) => visitNode(node);
538 547
539 @override 548 @override
540 R visitTypeParameter(TypeParameter node) => visitNode(node); 549 R visitTypeParameter(TypeParameter node) => visitNode(node);
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 return null; 882 return null;
874 } 883 }
875 884
876 @override 885 @override
877 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 886 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
878 node.visitChildren(this); 887 node.visitChildren(this);
879 return null; 888 return null;
880 } 889 }
881 890
882 @override 891 @override
892 R visitGenericFunctionType(GenericFunctionType node) {
893 node.visitChildren(this);
894 return null;
895 }
896
897 @override
898 R visitGenericTypeAlias(GenericTypeAlias node) {
899 node.visitChildren(this);
900 return null;
901 }
902
903 @override
883 R visitHideCombinator(HideCombinator node) { 904 R visitHideCombinator(HideCombinator node) {
884 node.visitChildren(this); 905 node.visitChildren(this);
885 return null; 906 return null;
886 } 907 }
887 908
888 @override 909 @override
889 R visitIfStatement(IfStatement node) { 910 R visitIfStatement(IfStatement node) {
890 node.visitChildren(this); 911 node.visitChildren(this);
891 return null; 912 return null;
892 } 913 }
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 null; 1412 null;
1392 1413
1393 @override 1414 @override
1394 R visitFunctionTypeAlias(FunctionTypeAlias node) => null; 1415 R visitFunctionTypeAlias(FunctionTypeAlias node) => null;
1395 1416
1396 @override 1417 @override
1397 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => 1418 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
1398 null; 1419 null;
1399 1420
1400 @override 1421 @override
1422 R visitGenericFunctionType(GenericFunctionType node) => null;
1423
1424 @override
1425 R visitGenericTypeAlias(GenericTypeAlias node) => null;
1426
1427 @override
1401 R visitHideCombinator(HideCombinator node) => null; 1428 R visitHideCombinator(HideCombinator node) => null;
1402 1429
1403 @override 1430 @override
1404 R visitIfStatement(IfStatement node) => null; 1431 R visitIfStatement(IfStatement node) => null;
1405 1432
1406 @override 1433 @override
1407 R visitImplementsClause(ImplementsClause node) => null; 1434 R visitImplementsClause(ImplementsClause node) => null;
1408 1435
1409 @override 1436 @override
1410 R visitImportDirective(ImportDirective node) => null; 1437 R visitImportDirective(ImportDirective node) => null;
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 _throw(node); 1763 _throw(node);
1737 1764
1738 @override 1765 @override
1739 R visitFunctionTypeAlias(FunctionTypeAlias node) => _throw(node); 1766 R visitFunctionTypeAlias(FunctionTypeAlias node) => _throw(node);
1740 1767
1741 @override 1768 @override
1742 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => 1769 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
1743 _throw(node); 1770 _throw(node);
1744 1771
1745 @override 1772 @override
1773 R visitGenericFunctionType(GenericFunctionType node) => _throw(node);
1774
1775 @override
1776 R visitGenericTypeAlias(GenericTypeAlias node) => _throw(node);
1777
1778 @override
1746 R visitHideCombinator(HideCombinator node) => _throw(node); 1779 R visitHideCombinator(HideCombinator node) => _throw(node);
1747 1780
1748 @override 1781 @override
1749 R visitIfStatement(IfStatement node) => _throw(node); 1782 R visitIfStatement(IfStatement node) => _throw(node);
1750 1783
1751 @override 1784 @override
1752 R visitImplementsClause(ImplementsClause node) => _throw(node); 1785 R visitImplementsClause(ImplementsClause node) => _throw(node);
1753 1786
1754 @override 1787 @override
1755 R visitImportDirective(ImportDirective node) => _throw(node); 1788 R visitImportDirective(ImportDirective node) => _throw(node);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 1947
1915 @override 1948 @override
1916 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => 1949 R visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
1917 _throw(node); 1950 _throw(node);
1918 1951
1919 @override 1952 @override
1920 R visitWhileStatement(WhileStatement node) => _throw(node); 1953 R visitWhileStatement(WhileStatement node) => _throw(node);
1921 1954
1922 @override 1955 @override
1923 R visitWithClause(WithClause node) => _throw(node); 1956 R visitWithClause(WithClause node) => _throw(node);
1924
1925 @override 1957 @override
1926 R visitYieldStatement(YieldStatement node) => _throw(node); 1958 R visitYieldStatement(YieldStatement node) => _throw(node);
1927 1959
1928 R _throw(AstNode node) { 1960 R _throw(AstNode node) {
1929 throw new Exception('Missing implementation of visit${node.runtimeType}'); 1961 throw new Exception('Missing implementation of visit${node.runtimeType}');
1930 } 1962 }
1931 } 1963 }
1932 1964
1933 /** 1965 /**
1934 * An AST visitor that captures visit call timings. 1966 * An AST visitor that captures visit call timings.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 2379
2348 @override 2380 @override
2349 T visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 2381 T visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
2350 stopwatch.start(); 2382 stopwatch.start();
2351 T result = _baseVisitor.visitFunctionTypedFormalParameter(node); 2383 T result = _baseVisitor.visitFunctionTypedFormalParameter(node);
2352 stopwatch.stop(); 2384 stopwatch.stop();
2353 return result; 2385 return result;
2354 } 2386 }
2355 2387
2356 @override 2388 @override
2389 T visitGenericFunctionType(GenericFunctionType node) {
2390 stopwatch.start();
2391 T result = _baseVisitor.visitGenericFunctionType(node);
2392 stopwatch.stop();
2393 return result;
2394 }
2395
2396 @override
2397 T visitGenericTypeAlias(GenericTypeAlias node) {
2398 stopwatch.start();
2399 T result = _baseVisitor.visitGenericTypeAlias(node);
2400 stopwatch.stop();
2401 return result;
2402 }
2403
2404 @override
2357 T visitHideCombinator(HideCombinator node) { 2405 T visitHideCombinator(HideCombinator node) {
2358 stopwatch.start(); 2406 stopwatch.start();
2359 T result = _baseVisitor.visitHideCombinator(node); 2407 T result = _baseVisitor.visitHideCombinator(node);
2360 stopwatch.stop(); 2408 stopwatch.stop();
2361 return result; 2409 return result;
2362 } 2410 }
2363 2411
2364 @override 2412 @override
2365 T visitIfStatement(IfStatement node) { 2413 T visitIfStatement(IfStatement node) {
2366 stopwatch.start(); 2414 stopwatch.start();
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 visitNode(node); 3037 visitNode(node);
2990 3038
2991 @override 3039 @override
2992 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitNode(node); 3040 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitNode(node);
2993 3041
2994 @override 3042 @override
2995 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => 3043 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
2996 visitNode(node); 3044 visitNode(node);
2997 3045
2998 @override 3046 @override
3047 R visitGenericFunctionType(GenericFunctionType node) => visitNode(node);
3048
3049 @override
3050 R visitGenericTypeAlias(GenericTypeAlias node) => visitNode(node);
3051
3052 @override
2999 R visitHideCombinator(HideCombinator node) => visitNode(node); 3053 R visitHideCombinator(HideCombinator node) => visitNode(node);
3000 3054
3001 @override 3055 @override
3002 R visitIfStatement(IfStatement node) => visitNode(node); 3056 R visitIfStatement(IfStatement node) => visitNode(node);
3003 3057
3004 @override 3058 @override
3005 R visitImplementsClause(ImplementsClause node) => visitNode(node); 3059 R visitImplementsClause(ImplementsClause node) => visitNode(node);
3006 3060
3007 @override 3061 @override
3008 R visitImportDirective(ImportDirective node) => visitNode(node); 3062 R visitImportDirective(ImportDirective node) => visitNode(node);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
3201 * Initialize a newly created visitor to help the [outerVisitor]. 3255 * Initialize a newly created visitor to help the [outerVisitor].
3202 */ 3256 */
3203 _BreadthFirstChildVisitor(this.outerVisitor); 3257 _BreadthFirstChildVisitor(this.outerVisitor);
3204 3258
3205 @override 3259 @override
3206 Object visitNode(AstNode node) { 3260 Object visitNode(AstNode node) {
3207 outerVisitor._queue.add(node); 3261 outerVisitor._queue.add(node);
3208 return null; 3262 return null;
3209 } 3263 }
3210 } 3264 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/dart/ast/resolution_map.dart ('k') | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698