| 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; |
| 11 import 'package:analyzer/dart/element/element.dart' show Element; | 11 import 'package:analyzer/dart/element/element.dart' show Element; |
| 12 import 'package:front_end/src/fasta/parser/parser.dart' | 12 import '../parser/parser.dart' show FormalParameterType; |
| 13 show FormalParameterType; | 13 import '../scanner/token.dart' show BeginGroupToken, Token; |
| 14 import 'package:front_end/src/fasta/scanner/token.dart' | |
| 15 show BeginGroupToken, Token; | |
| 16 import 'package:kernel/ast.dart' show AsyncMarker; | 14 import 'package:kernel/ast.dart' show AsyncMarker; |
| 17 | 15 |
| 18 import '../errors.dart' show internalError; | 16 import '../errors.dart' show internalError; |
| 19 import '../kernel/kernel_builder.dart' | 17 import '../kernel/kernel_builder.dart' |
| 20 show Builder, KernelLibraryBuilder, ProcedureBuilder; | 18 show Builder, KernelLibraryBuilder, ProcedureBuilder; |
| 21 import '../parser/identifier_context.dart' show IdentifierContext; | 19 import '../parser/identifier_context.dart' show IdentifierContext; |
| 22 import '../quote.dart'; | 20 import '../quote.dart'; |
| 23 import '../source/outline_builder.dart' show asyncMarkerFromTokens; | 21 import '../source/outline_builder.dart' show asyncMarkerFromTokens; |
| 24 import '../source/scope_listener.dart' | 22 import '../source/scope_listener.dart' |
| 25 show JumpTargetKind, NullValue, Scope, ScopeListener; | 23 show JumpTargetKind, NullValue, Scope, ScopeListener; |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 } else { | 1165 } else { |
| 1168 // TODO(scheglov): Report error. | 1166 // TODO(scheglov): Report error. |
| 1169 internalError("Invalid modifier ($value). Report an error."); | 1167 internalError("Invalid modifier ($value). Report an error."); |
| 1170 } | 1168 } |
| 1171 } | 1169 } |
| 1172 | 1170 |
| 1173 List<Annotation> metadata = pop(); | 1171 List<Annotation> metadata = pop(); |
| 1174 // TODO(paulberry): capture doc comments. See dartbug.com/28851. | 1172 // TODO(paulberry): capture doc comments. See dartbug.com/28851. |
| 1175 Comment comment = null; | 1173 Comment comment = null; |
| 1176 Token period; | 1174 Token period; |
| 1177 void unnamedConstructor(SimpleIdentifier returnType, SimpleIdentifier name)
{ | 1175 void unnamedConstructor( |
| 1176 SimpleIdentifier returnType, SimpleIdentifier name) { |
| 1178 push(ast.constructorDeclaration( | 1177 push(ast.constructorDeclaration( |
| 1179 comment, | 1178 comment, |
| 1180 metadata, | 1179 metadata, |
| 1181 toAnalyzerToken(externalKeyword), | 1180 toAnalyzerToken(externalKeyword), |
| 1182 toAnalyzerToken(constKeyword), | 1181 toAnalyzerToken(constKeyword), |
| 1183 toAnalyzerToken(factoryKeyword), | 1182 toAnalyzerToken(factoryKeyword), |
| 1184 returnType, | 1183 returnType, |
| 1185 toAnalyzerToken(period), | 1184 toAnalyzerToken(period), |
| 1186 name, | 1185 name, |
| 1187 parameters, | 1186 parameters, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 } | 1396 } |
| 1398 | 1397 |
| 1399 /// Data structure placed on the stack to represent the keyword "operator" | 1398 /// Data structure placed on the stack to represent the keyword "operator" |
| 1400 /// followed by a token. | 1399 /// followed by a token. |
| 1401 class _OperatorName { | 1400 class _OperatorName { |
| 1402 final Token operatorKeyword; | 1401 final Token operatorKeyword; |
| 1403 final SimpleIdentifier name; | 1402 final SimpleIdentifier name; |
| 1404 | 1403 |
| 1405 _OperatorName(this.operatorKeyword, this.name); | 1404 _OperatorName(this.operatorKeyword, this.name); |
| 1406 } | 1405 } |
| OLD | NEW |