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' show Token, TokenType; | 10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType; |
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 | 1523 |
1524 @override | 1524 @override |
1525 void endNamedFunctionExpression(Token endToken) { | 1525 void endNamedFunctionExpression(Token endToken) { |
1526 logEvent("NamedFunctionExpression"); | 1526 logEvent("NamedFunctionExpression"); |
1527 } | 1527 } |
1528 | 1528 |
1529 @override | 1529 @override |
1530 void endLocalFunctionDeclaration(Token token) { | 1530 void endLocalFunctionDeclaration(Token token) { |
1531 debugEvent("LocalFunctionDeclaration"); | 1531 debugEvent("LocalFunctionDeclaration"); |
1532 FunctionBody body = pop(); | 1532 FunctionBody body = pop(); |
1533 pop(); // constructor initializers | 1533 if (isFullAst) { |
1534 pop(); // separator before constructor initializers | 1534 pop(); // constructor initializers |
| 1535 pop(); // separator before constructor initializers |
| 1536 } |
1535 FormalParameterList parameters = pop(); | 1537 FormalParameterList parameters = pop(); |
1536 SimpleIdentifier name = pop(); | 1538 SimpleIdentifier name = pop(); |
1537 TypeAnnotation returnType = pop(); | 1539 TypeAnnotation returnType = pop(); |
1538 pop(); // modifiers | 1540 pop(); // modifiers |
1539 TypeParameterList typeParameters = pop(); | 1541 TypeParameterList typeParameters = pop(); |
1540 FunctionExpression functionExpression = | 1542 FunctionExpression functionExpression = |
1541 ast.functionExpression(typeParameters, parameters, body); | 1543 ast.functionExpression(typeParameters, parameters, body); |
1542 push(ast.functionDeclarationStatement(ast.functionDeclaration( | 1544 push(ast.functionDeclarationStatement(ast.functionDeclaration( |
1543 null, null, null, returnType, null, name, functionExpression))); | 1545 null, null, null, returnType, null, name, functionExpression))); |
1544 } | 1546 } |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2002 } else if (identical('var', s)) { | 2004 } else if (identical('var', s)) { |
2003 finalConstOrVarKeyword = token; | 2005 finalConstOrVarKeyword = token; |
2004 } else if (identical('covariant', s)) { | 2006 } else if (identical('covariant', s)) { |
2005 covariantKeyword = token; | 2007 covariantKeyword = token; |
2006 } else { | 2008 } else { |
2007 unhandled("$s", "modifier", token.charOffset, null); | 2009 unhandled("$s", "modifier", token.charOffset, null); |
2008 } | 2010 } |
2009 } | 2011 } |
2010 } | 2012 } |
2011 } | 2013 } |
OLD | NEW |