OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library fasta.analyzer.ast_builder; | 5 library fasta.analyzer.ast_builder; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; | 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; |
9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; | 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; |
10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; | 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; |
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 SimpleIdentifier name = pop(); | 1516 SimpleIdentifier name = pop(); |
1517 push(ast.variableDeclaration(name, assignment, initializer)); | 1517 push(ast.variableDeclaration(name, assignment, initializer)); |
1518 } | 1518 } |
1519 | 1519 |
1520 @override | 1520 @override |
1521 void endNamedFunctionExpression(Token endToken) { | 1521 void endNamedFunctionExpression(Token endToken) { |
1522 logEvent("NamedFunctionExpression"); | 1522 logEvent("NamedFunctionExpression"); |
1523 } | 1523 } |
1524 | 1524 |
1525 @override | 1525 @override |
1526 void endFunctionDeclaration(Token endToken) { | 1526 void endLocalFunctionDeclaration(Token token) { |
1527 debugEvent("FunctionDeclaration"); | 1527 debugEvent("LocalFunctionDeclaration"); |
1528 FunctionBody body = pop(); | 1528 FunctionBody body = pop(); |
1529 pop(); // constructor initializers | 1529 pop(); // constructor initializers |
1530 pop(); // separator before constructor initializers | 1530 pop(); // separator before constructor initializers |
1531 FormalParameterList parameters = pop(); | 1531 FormalParameterList parameters = pop(); |
1532 TypeParameterList typeParameters = pop(); | 1532 TypeParameterList typeParameters = pop(); |
1533 FunctionExpression functionExpression = | 1533 FunctionExpression functionExpression = |
1534 ast.functionExpression(typeParameters, parameters, body); | 1534 ast.functionExpression(typeParameters, parameters, body); |
1535 SimpleIdentifier name = pop(); | 1535 SimpleIdentifier name = pop(); |
1536 TypeAnnotation returnType = pop(); | 1536 TypeAnnotation returnType = pop(); |
1537 pop(); // modifiers | 1537 pop(); // modifiers |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1992 } else if (identical('var', s)) { | 1992 } else if (identical('var', s)) { |
1993 finalConstOrVarKeyword = token; | 1993 finalConstOrVarKeyword = token; |
1994 } else if (identical('covariant', s)) { | 1994 } else if (identical('covariant', s)) { |
1995 covariantKeyword = token; | 1995 covariantKeyword = token; |
1996 } else { | 1996 } else { |
1997 unhandled("$s", "modifier", token.charOffset, null); | 1997 unhandled("$s", "modifier", token.charOffset, null); |
1998 } | 1998 } |
1999 } | 1999 } |
2000 } | 2000 } |
2001 } | 2001 } |
OLD | NEW |