Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: pkg/compiler/lib/src/parser/element_listener.dart

Issue 2978073002: Add closeBraceTokenFor and use it instead of BeginToken. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.parser.element_listener; 5 library dart2js.parser.element_listener;
6 6
7 import 'package:front_end/src/fasta/fasta_codes.dart' show Message; 7 import 'package:front_end/src/fasta/fasta_codes.dart' show Message;
8 8
9 import 'package:front_end/src/fasta/fasta_codes.dart' as codes; 9 import 'package:front_end/src/fasta/fasta_codes.dart' as codes;
10 10
(...skipping 17 matching lines...) Expand all
28 import '../string_validator.dart' show StringValidator; 28 import '../string_validator.dart' show StringValidator;
29 import 'package:front_end/src/fasta/scanner.dart' 29 import 'package:front_end/src/fasta/scanner.dart'
30 show ErrorToken, StringToken, Token; 30 show ErrorToken, StringToken, Token;
31 import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN; 31 import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN;
32 import '../tree/tree.dart'; 32 import '../tree/tree.dart';
33 import '../util/util.dart' show Link, LinkBuilder; 33 import '../util/util.dart' show Link, LinkBuilder;
34 import 'package:front_end/src/fasta/parser.dart' 34 import 'package:front_end/src/fasta/parser.dart'
35 show Listener, ParserError, optional; 35 show Listener, ParserError, optional;
36 import 'package:front_end/src/fasta/parser/identifier_context.dart' 36 import 'package:front_end/src/fasta/parser/identifier_context.dart'
37 show IdentifierContext; 37 show IdentifierContext;
38 import 'package:front_end/src/scanner/token.dart' 38 import 'package:front_end/src/scanner/token.dart' show KeywordToken, TokenType;
39 show BeginToken, KeywordToken, TokenType;
40 import 'partial_elements.dart' 39 import 'partial_elements.dart'
41 show 40 show
42 PartialClassElement, 41 PartialClassElement,
43 PartialElement, 42 PartialElement,
44 PartialFieldList, 43 PartialFieldList,
45 PartialFunctionElement, 44 PartialFunctionElement,
46 PartialMetadataAnnotation, 45 PartialMetadataAnnotation,
47 PartialTypedefElement; 46 PartialTypedefElement;
48 47
49 const bool VERBOSE = false; 48 const bool VERBOSE = false;
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 } 478 }
480 479
481 @override 480 @override
482 void endFunctionType(Token functionToken, Token endToken) { 481 void endFunctionType(Token functionToken, Token endToken) {
483 popNode(); // Return type. 482 popNode(); // Return type.
484 popNode(); // Type parameters. 483 popNode(); // Type parameters.
485 pushNode(null); 484 pushNode(null);
486 } 485 }
487 486
488 @override 487 @override
489 void handleParenthesizedExpression(BeginToken token) { 488 void handleParenthesizedExpression(Token token) {
490 Expression expression = popNode(); 489 Expression expression = popNode();
491 pushNode(new ParenthesizedExpression(expression, token)); 490 pushNode(new ParenthesizedExpression(expression, token));
492 } 491 }
493 492
494 @override 493 @override
495 void handleModifier(Token token) { 494 void handleModifier(Token token) {
496 pushNode(new Identifier(token)); 495 pushNode(new Identifier(token));
497 } 496 }
498 497
499 @override 498 @override
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 memberErrors = memberErrors.tail.prepend(true); 943 memberErrors = memberErrors.tail.prepend(true);
945 } 944 }
946 reporter.reportErrorMessage(spannable, errorCode, arguments); 945 reporter.reportErrorMessage(spannable, errorCode, arguments);
947 } 946 }
948 947
949 void reportErrorFromToken(Token token, MessageKind errorCode, 948 void reportErrorFromToken(Token token, MessageKind errorCode,
950 [Map arguments = const {}]) { 949 [Map arguments = const {}]) {
951 reportError(reporter.spanFromToken(token), errorCode, arguments); 950 reportError(reporter.spanFromToken(token), errorCode, arguments);
952 } 951 }
953 } 952 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_listener.dart ('k') | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698