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

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

Issue 2624283003: Revert "Add support for generic function type syntax, part 1" (TBR) (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
346 R visitHideCombinator(HideCombinator node) => visitCombinator(node); 339 R visitHideCombinator(HideCombinator node) => visitCombinator(node);
347 340
348 R visitIdentifier(Identifier node) => visitExpression(node); 341 R visitIdentifier(Identifier node) => visitExpression(node);
349 342
350 @override 343 @override
351 R visitIfStatement(IfStatement node) => visitStatement(node); 344 R visitIfStatement(IfStatement node) => visitStatement(node);
352 345
353 @override 346 @override
354 R visitImplementsClause(ImplementsClause node) => visitNode(node); 347 R visitImplementsClause(ImplementsClause node) => visitNode(node);
355 348
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 521
529 @override 522 @override
530 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => 523 R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
531 visitCompilationUnitMember(node); 524 visitCompilationUnitMember(node);
532 525
533 @override 526 @override
534 R visitTryStatement(TryStatement node) => visitStatement(node); 527 R visitTryStatement(TryStatement node) => visitStatement(node);
535 528
536 R visitTypeAlias(TypeAlias node) => visitNamedCompilationUnitMember(node); 529 R visitTypeAlias(TypeAlias node) => visitNamedCompilationUnitMember(node);
537 530
538 R visitTypeAnnotation(TypeAnnotation node) => visitNode(node);
539
540 @override 531 @override
541 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node); 532 R visitTypeArgumentList(TypeArgumentList node) => visitNode(node);
542 533
543 R visitTypedLiteral(TypedLiteral node) => visitLiteral(node); 534 R visitTypedLiteral(TypedLiteral node) => visitLiteral(node);
544 535
545 @override 536 @override
546 R visitTypeName(TypeName node) => visitNode(node); 537 R visitTypeName(TypeName node) => visitNode(node);
547 538
548 @override 539 @override
549 R visitTypeParameter(TypeParameter node) => visitNode(node); 540 R visitTypeParameter(TypeParameter node) => visitNode(node);
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 return null; 873 return null;
883 } 874 }
884 875
885 @override 876 @override
886 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 877 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
887 node.visitChildren(this); 878 node.visitChildren(this);
888 return null; 879 return null;
889 } 880 }
890 881
891 @override 882 @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
904 R visitHideCombinator(HideCombinator node) { 883 R visitHideCombinator(HideCombinator node) {
905 node.visitChildren(this); 884 node.visitChildren(this);
906 return null; 885 return null;
907 } 886 }
908 887
909 @override 888 @override
910 R visitIfStatement(IfStatement node) { 889 R visitIfStatement(IfStatement node) {
911 node.visitChildren(this); 890 node.visitChildren(this);
912 return null; 891 return null;
913 } 892 }
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 null; 1391 null;
1413 1392
1414 @override 1393 @override
1415 R visitFunctionTypeAlias(FunctionTypeAlias node) => null; 1394 R visitFunctionTypeAlias(FunctionTypeAlias node) => null;
1416 1395
1417 @override 1396 @override
1418 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => 1397 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
1419 null; 1398 null;
1420 1399
1421 @override 1400 @override
1422 R visitGenericFunctionType(GenericFunctionType node) => null;
1423
1424 @override
1425 R visitGenericTypeAlias(GenericTypeAlias node) => null;
1426
1427 @override
1428 R visitHideCombinator(HideCombinator node) => null; 1401 R visitHideCombinator(HideCombinator node) => null;
1429 1402
1430 @override 1403 @override
1431 R visitIfStatement(IfStatement node) => null; 1404 R visitIfStatement(IfStatement node) => null;
1432 1405
1433 @override 1406 @override
1434 R visitImplementsClause(ImplementsClause node) => null; 1407 R visitImplementsClause(ImplementsClause node) => null;
1435 1408
1436 @override 1409 @override
1437 R visitImportDirective(ImportDirective node) => null; 1410 R visitImportDirective(ImportDirective node) => null;
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 _throw(node); 1736 _throw(node);
1764 1737
1765 @override 1738 @override
1766 R visitFunctionTypeAlias(FunctionTypeAlias node) => _throw(node); 1739 R visitFunctionTypeAlias(FunctionTypeAlias node) => _throw(node);
1767 1740
1768 @override 1741 @override
1769 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => 1742 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
1770 _throw(node); 1743 _throw(node);
1771 1744
1772 @override 1745 @override
1773 R visitGenericFunctionType(GenericFunctionType node) => _throw(node);
1774
1775 @override
1776 R visitGenericTypeAlias(GenericTypeAlias node) => _throw(node);
1777
1778 @override
1779 R visitHideCombinator(HideCombinator node) => _throw(node); 1746 R visitHideCombinator(HideCombinator node) => _throw(node);
1780 1747
1781 @override 1748 @override
1782 R visitIfStatement(IfStatement node) => _throw(node); 1749 R visitIfStatement(IfStatement node) => _throw(node);
1783 1750
1784 @override 1751 @override
1785 R visitImplementsClause(ImplementsClause node) => _throw(node); 1752 R visitImplementsClause(ImplementsClause node) => _throw(node);
1786 1753
1787 @override 1754 @override
1788 R visitImportDirective(ImportDirective node) => _throw(node); 1755 R visitImportDirective(ImportDirective node) => _throw(node);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 1914
1948 @override 1915 @override
1949 R visitVariableDeclarationStatement(VariableDeclarationStatement node) => 1916 R visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
1950 _throw(node); 1917 _throw(node);
1951 1918
1952 @override 1919 @override
1953 R visitWhileStatement(WhileStatement node) => _throw(node); 1920 R visitWhileStatement(WhileStatement node) => _throw(node);
1954 1921
1955 @override 1922 @override
1956 R visitWithClause(WithClause node) => _throw(node); 1923 R visitWithClause(WithClause node) => _throw(node);
1924
1957 @override 1925 @override
1958 R visitYieldStatement(YieldStatement node) => _throw(node); 1926 R visitYieldStatement(YieldStatement node) => _throw(node);
1959 1927
1960 R _throw(AstNode node) { 1928 R _throw(AstNode node) {
1961 throw new Exception('Missing implementation of visit${node.runtimeType}'); 1929 throw new Exception('Missing implementation of visit${node.runtimeType}');
1962 } 1930 }
1963 } 1931 }
1964 1932
1965 /** 1933 /**
1966 * An AST visitor that captures visit call timings. 1934 * An AST visitor that captures visit call timings.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 2347
2380 @override 2348 @override
2381 T visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 2349 T visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
2382 stopwatch.start(); 2350 stopwatch.start();
2383 T result = _baseVisitor.visitFunctionTypedFormalParameter(node); 2351 T result = _baseVisitor.visitFunctionTypedFormalParameter(node);
2384 stopwatch.stop(); 2352 stopwatch.stop();
2385 return result; 2353 return result;
2386 } 2354 }
2387 2355
2388 @override 2356 @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
2405 T visitHideCombinator(HideCombinator node) { 2357 T visitHideCombinator(HideCombinator node) {
2406 stopwatch.start(); 2358 stopwatch.start();
2407 T result = _baseVisitor.visitHideCombinator(node); 2359 T result = _baseVisitor.visitHideCombinator(node);
2408 stopwatch.stop(); 2360 stopwatch.stop();
2409 return result; 2361 return result;
2410 } 2362 }
2411 2363
2412 @override 2364 @override
2413 T visitIfStatement(IfStatement node) { 2365 T visitIfStatement(IfStatement node) {
2414 stopwatch.start(); 2366 stopwatch.start();
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
3037 visitNode(node); 2989 visitNode(node);
3038 2990
3039 @override 2991 @override
3040 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitNode(node); 2992 R visitFunctionTypeAlias(FunctionTypeAlias node) => visitNode(node);
3041 2993
3042 @override 2994 @override
3043 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => 2995 R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
3044 visitNode(node); 2996 visitNode(node);
3045 2997
3046 @override 2998 @override
3047 R visitGenericFunctionType(GenericFunctionType node) => visitNode(node);
3048
3049 @override
3050 R visitGenericTypeAlias(GenericTypeAlias node) => visitNode(node);
3051
3052 @override
3053 R visitHideCombinator(HideCombinator node) => visitNode(node); 2999 R visitHideCombinator(HideCombinator node) => visitNode(node);
3054 3000
3055 @override 3001 @override
3056 R visitIfStatement(IfStatement node) => visitNode(node); 3002 R visitIfStatement(IfStatement node) => visitNode(node);
3057 3003
3058 @override 3004 @override
3059 R visitImplementsClause(ImplementsClause node) => visitNode(node); 3005 R visitImplementsClause(ImplementsClause node) => visitNode(node);
3060 3006
3061 @override 3007 @override
3062 R visitImportDirective(ImportDirective node) => visitNode(node); 3008 R visitImportDirective(ImportDirective node) => visitNode(node);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
3255 * Initialize a newly created visitor to help the [outerVisitor]. 3201 * Initialize a newly created visitor to help the [outerVisitor].
3256 */ 3202 */
3257 _BreadthFirstChildVisitor(this.outerVisitor); 3203 _BreadthFirstChildVisitor(this.outerVisitor);
3258 3204
3259 @override 3205 @override
3260 Object visitNode(AstNode node) { 3206 Object visitNode(AstNode node) {
3261 outerVisitor._queue.add(node); 3207 outerVisitor._queue.add(node);
3262 return null; 3208 return null;
3263 } 3209 }
3264 } 3210 }
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