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 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 void endPart(Token partKeyword, Token semicolon) { | 1155 void endPart(Token partKeyword, Token semicolon) { |
1156 debugEvent("Part"); | 1156 debugEvent("Part"); |
1157 StringLiteral uri = pop(); | 1157 StringLiteral uri = pop(); |
1158 List<Annotation> metadata = pop(); | 1158 List<Annotation> metadata = pop(); |
1159 Comment comment = pop(); | 1159 Comment comment = pop(); |
1160 push(ast.partDirective(comment, metadata, toAnalyzerToken(partKeyword), uri, | 1160 push(ast.partDirective(comment, metadata, toAnalyzerToken(partKeyword), uri, |
1161 toAnalyzerToken(semicolon))); | 1161 toAnalyzerToken(semicolon))); |
1162 } | 1162 } |
1163 | 1163 |
1164 @override | 1164 @override |
1165 void endPartOf(Token partKeyword, Token semicolon) { | 1165 void endPartOf(Token partKeyword, Token semicolon, bool hasName) { |
1166 debugEvent("PartOf"); | 1166 debugEvent("PartOf"); |
1167 List<SimpleIdentifier> libraryName = pop(); | 1167 List<SimpleIdentifier> libraryName = pop(); |
1168 var name = ast.libraryIdentifier(libraryName); | 1168 var name = ast.libraryIdentifier(libraryName); |
1169 StringLiteral uri = null; // TODO(paulberry) | 1169 StringLiteral uri = null; // TODO(paulberry) |
1170 // TODO(paulberry,ahe): seems hacky. It would be nice if the parser passed | 1170 // TODO(paulberry,ahe): seems hacky. It would be nice if the parser passed |
1171 // in a reference to the "of" keyword. | 1171 // in a reference to the "of" keyword. |
1172 var ofKeyword = partKeyword.next; | 1172 var ofKeyword = partKeyword.next; |
1173 List<Annotation> metadata = pop(); | 1173 List<Annotation> metadata = pop(); |
1174 Comment comment = pop(); | 1174 Comment comment = pop(); |
1175 push(ast.partOfDirective(comment, metadata, toAnalyzerToken(partKeyword), | 1175 push(ast.partOfDirective(comment, metadata, toAnalyzerToken(partKeyword), |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 } else if (identical('static', s)) { | 1589 } else if (identical('static', s)) { |
1590 staticKeyword = token; | 1590 staticKeyword = token; |
1591 } else if (identical('var', s)) { | 1591 } else if (identical('var', s)) { |
1592 finalConstOrVarKeyword = token; | 1592 finalConstOrVarKeyword = token; |
1593 } else { | 1593 } else { |
1594 internalError('Unhandled modifier: $s'); | 1594 internalError('Unhandled modifier: $s'); |
1595 } | 1595 } |
1596 } | 1596 } |
1597 } | 1597 } |
1598 } | 1598 } |
OLD | NEW |