OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:front_end/src/fasta/errors.dart'; | 5 import 'package:front_end/src/fasta/errors.dart'; |
6 import 'package:front_end/src/fasta/parser/identifier_context.dart'; | 6 import 'package:front_end/src/fasta/parser/identifier_context.dart'; |
7 import 'package:front_end/src/fasta/parser/parser.dart'; | 7 import 'package:front_end/src/fasta/parser/parser.dart'; |
8 import 'package:front_end/src/fasta/scanner/token.dart'; | 8 import 'package:front_end/src/fasta/scanner/token.dart'; |
9 import 'package:front_end/src/fasta/source/stack_listener.dart'; | 9 import 'package:front_end/src/fasta/source/stack_listener.dart'; |
10 | 10 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 @override | 157 @override |
158 void beginMetadata(Token token) { | 158 void beginMetadata(Token token) { |
159 inMetadata = true; | 159 inMetadata = true; |
160 } | 160 } |
161 | 161 |
162 @override | 162 @override |
163 void beginMetadataStar(Token token) { | 163 void beginMetadataStar(Token token) { |
164 debugEvent("beginMetadataStar"); | 164 debugEvent("beginMetadataStar"); |
165 if (token.precedingComments != null) { | 165 if (token.precedingComments != null) { |
166 push(new Comment(token.precedingComments)); | 166 push(new Comment(token.precedingCommentTokens)); |
167 } else { | 167 } else { |
168 push(NullValue.Comments); | 168 push(NullValue.Comments); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 @override | 172 @override |
173 void endArguments(int count, Token beginToken, Token endToken) { | 173 void endArguments(int count, Token beginToken, Token endToken) { |
174 debugEvent("Arguments"); | 174 debugEvent("Arguments"); |
175 push(popList(count)); | 175 push(popList(count)); |
176 } | 176 } |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 382 } |
383 | 383 |
384 @override | 384 @override |
385 void handleFunctionBodySkipped(Token token, bool isExpressionBody) { | 385 void handleFunctionBodySkipped(Token token, bool isExpressionBody) { |
386 if (isExpressionBody) pop(); | 386 if (isExpressionBody) pop(); |
387 push(NullValue.FunctionBody); | 387 push(NullValue.FunctionBody); |
388 } | 388 } |
389 | 389 |
390 void handleIdentifier(Token token, IdentifierContext context) { | 390 void handleIdentifier(Token token, IdentifierContext context) { |
391 if (context == IdentifierContext.enumValueDeclaration) { | 391 if (context == IdentifierContext.enumValueDeclaration) { |
392 var comment = new Comment(token.precedingComments); | 392 var comment = new Comment(token.precedingCommentTokens); |
393 push(new EnumConstantDeclaration(comment, null, token.lexeme)); | 393 push(new EnumConstantDeclaration(comment, null, token.lexeme)); |
394 } else { | 394 } else { |
395 push(token.lexeme); | 395 push(token.lexeme); |
396 } | 396 } |
397 } | 397 } |
398 | 398 |
399 void handleLiteralInt(Token token) { | 399 void handleLiteralInt(Token token) { |
400 debugEvent("LiteralInt"); | 400 debugEvent("LiteralInt"); |
401 push(new IntegerLiteral(int.parse(token.lexeme))); | 401 push(new IntegerLiteral(int.parse(token.lexeme))); |
402 } | 402 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 final String name; | 463 final String name; |
464 | 464 |
465 final List<TypeName> typeArguments; | 465 final List<TypeName> typeArguments; |
466 | 466 |
467 TypeName(this.name, this.typeArguments); | 467 TypeName(this.name, this.typeArguments); |
468 } | 468 } |
469 | 469 |
470 /// "Mini AST" representation of an expression which summary code generation | 470 /// "Mini AST" representation of an expression which summary code generation |
471 /// need not be concerned about. | 471 /// need not be concerned about. |
472 class UnknownExpression extends Expression {} | 472 class UnknownExpression extends Expression {} |
OLD | NEW |