| 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 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1760 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { | 1760 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { |
| 1761 debugEvent("Metadata"); | 1761 debugEvent("Metadata"); |
| 1762 MethodInvocation invocation = pop(); | 1762 MethodInvocation invocation = pop(); |
| 1763 SimpleIdentifier constructorName = periodBeforeName != null ? pop() : null; | 1763 SimpleIdentifier constructorName = periodBeforeName != null ? pop() : null; |
| 1764 pop(); // Type arguments, not allowed. | 1764 pop(); // Type arguments, not allowed. |
| 1765 Identifier name = pop(); | 1765 Identifier name = pop(); |
| 1766 push(ast.annotation(beginToken, name, periodBeforeName, constructorName, | 1766 push(ast.annotation(beginToken, name, periodBeforeName, constructorName, |
| 1767 invocation?.argumentList)); | 1767 invocation?.argumentList)); |
| 1768 } | 1768 } |
| 1769 | 1769 |
| 1770 @override |
| 1771 void endMetadataStar(int count, bool forParameter) { |
| 1772 debugEvent("MetadataStar"); |
| 1773 push(popList(count) ?? NullValue.Metadata); |
| 1774 } |
| 1775 |
| 1770 ParameterKind _toAnalyzerParameterKind(FormalParameterKind type) { | 1776 ParameterKind _toAnalyzerParameterKind(FormalParameterKind type) { |
| 1771 if (type == FormalParameterKind.optionalPositional) { | 1777 if (type == FormalParameterKind.optionalPositional) { |
| 1772 return ParameterKind.POSITIONAL; | 1778 return ParameterKind.POSITIONAL; |
| 1773 } else if (type == FormalParameterKind.optionalNamed) { | 1779 } else if (type == FormalParameterKind.optionalNamed) { |
| 1774 return ParameterKind.NAMED; | 1780 return ParameterKind.NAMED; |
| 1775 } else { | 1781 } else { |
| 1776 return ParameterKind.REQUIRED; | 1782 return ParameterKind.REQUIRED; |
| 1777 } | 1783 } |
| 1778 } | 1784 } |
| 1779 | 1785 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2002 } else if (identical('var', s)) { | 2008 } else if (identical('var', s)) { |
| 2003 finalConstOrVarKeyword = token; | 2009 finalConstOrVarKeyword = token; |
| 2004 } else if (identical('covariant', s)) { | 2010 } else if (identical('covariant', s)) { |
| 2005 covariantKeyword = token; | 2011 covariantKeyword = token; |
| 2006 } else { | 2012 } else { |
| 2007 unhandled("$s", "modifier", token.charOffset, null); | 2013 unhandled("$s", "modifier", token.charOffset, null); |
| 2008 } | 2014 } |
| 2009 } | 2015 } |
| 2010 } | 2016 } |
| 2011 } | 2017 } |
| OLD | NEW |