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

Side by Side Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 2842213003: new TokenType and Keyword API (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « pkg/analyzer/lib/src/fasta/token_utils.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.generated.error_verifier; 5 library analyzer.src.generated.error_verifier;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 * Verify that the given [identifier] is not a keyword, and generates the 2618 * Verify that the given [identifier] is not a keyword, and generates the
2619 * given [errorCode] on the identifier if it is a keyword. 2619 * given [errorCode] on the identifier if it is a keyword.
2620 * 2620 *
2621 * See [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME], 2621 * See [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME],
2622 * [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME], and 2622 * [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME], and
2623 * [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]. 2623 * [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME].
2624 */ 2624 */
2625 void _checkForBuiltInIdentifierAsName( 2625 void _checkForBuiltInIdentifierAsName(
2626 SimpleIdentifier identifier, ErrorCode errorCode) { 2626 SimpleIdentifier identifier, ErrorCode errorCode) {
2627 Token token = identifier.token; 2627 Token token = identifier.token;
2628 if (token.type == TokenType.KEYWORD && token.keyword?.isPseudo != true) { 2628 if (token.type.isKeyword && token.keyword?.isPseudo != true) {
2629 _errorReporter 2629 _errorReporter
2630 .reportErrorForNode(errorCode, identifier, [identifier.name]); 2630 .reportErrorForNode(errorCode, identifier, [identifier.name]);
2631 } 2631 }
2632 } 2632 }
2633 2633
2634 /** 2634 /**
2635 * Verify that the given [switchCase] is terminated with 'break', 'continue', 2635 * Verify that the given [switchCase] is terminated with 'break', 'continue',
2636 * 'return' or 'throw'. 2636 * 'return' or 'throw'.
2637 * 2637 *
2638 * see [StaticWarningCode.CASE_BLOCK_NOT_TERMINATED]. 2638 * see [StaticWarningCode.CASE_BLOCK_NOT_TERMINATED].
(...skipping 4490 matching lines...) Expand 10 before | Expand all | Expand 10 after
7129 class _InvocationCollector extends RecursiveAstVisitor { 7129 class _InvocationCollector extends RecursiveAstVisitor {
7130 final List<String> superCalls = <String>[]; 7130 final List<String> superCalls = <String>[];
7131 7131
7132 @override 7132 @override
7133 visitMethodInvocation(MethodInvocation node) { 7133 visitMethodInvocation(MethodInvocation node) {
7134 if (node.target is SuperExpression) { 7134 if (node.target is SuperExpression) {
7135 superCalls.add(node.methodName.name); 7135 superCalls.add(node.methodName.name);
7136 } 7136 }
7137 } 7137 }
7138 } 7138 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/fasta/token_utils.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698