| 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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 name, | 1117 name, |
| 1118 ast.functionExpression(typeParameters, parameters, body))); | 1118 ast.functionExpression(typeParameters, parameters, body))); |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 @override | 1121 @override |
| 1122 void endTopLevelDeclaration(Token token) { | 1122 void endTopLevelDeclaration(Token token) { |
| 1123 debugEvent("TopLevelDeclaration"); | 1123 debugEvent("TopLevelDeclaration"); |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 @override | 1126 @override |
| 1127 void handleInvalidTopLevelDeclaration(Token beginToken, Token endToken) { |
| 1128 // TODO(danrubel): consider creating a AST node |
| 1129 // representing the invalid declaration |
| 1130 // to support code completion, quick fixes, etc. |
| 1131 super.handleInvalidTopLevelDeclaration(beginToken, endToken); |
| 1132 pop(); // comment |
| 1133 } |
| 1134 |
| 1135 @override |
| 1127 void beginCompilationUnit(Token token) { | 1136 void beginCompilationUnit(Token token) { |
| 1128 push(token); | 1137 push(token); |
| 1129 } | 1138 } |
| 1130 | 1139 |
| 1131 @override | 1140 @override |
| 1132 void endCompilationUnit(int count, Token endToken) { | 1141 void endCompilationUnit(int count, Token endToken) { |
| 1133 debugEvent("CompilationUnit"); | 1142 debugEvent("CompilationUnit"); |
| 1134 List<Object> elements = popList(count); | 1143 List<Object> elements = popList(count); |
| 1135 Token beginToken = pop(); | 1144 Token beginToken = pop(); |
| 1136 | 1145 |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2002 } else if (identical('var', s)) { | 2011 } else if (identical('var', s)) { |
| 2003 finalConstOrVarKeyword = token; | 2012 finalConstOrVarKeyword = token; |
| 2004 } else if (identical('covariant', s)) { | 2013 } else if (identical('covariant', s)) { |
| 2005 covariantKeyword = token; | 2014 covariantKeyword = token; |
| 2006 } else { | 2015 } else { |
| 2007 unhandled("$s", "modifier", token.charOffset, null); | 2016 unhandled("$s", "modifier", token.charOffset, null); |
| 2008 } | 2017 } |
| 2009 } | 2018 } |
| 2010 } | 2019 } |
| 2011 } | 2020 } |
| OLD | NEW |