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

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

Issue 1917203002: Remove more type casts (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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) 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.parser; 5 library analyzer.src.generated.parser;
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 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 // 1825 //
1826 if (identical(oldNode, originalStructure)) { 1826 if (identical(oldNode, originalStructure)) {
1827 // We ended up re-parsing the whole structure, so there's no need for a 1827 // We ended up re-parsing the whole structure, so there's no need for a
1828 // copy. 1828 // copy.
1829 ResolutionCopier.copyResolutionData(oldNode, newNode); 1829 ResolutionCopier.copyResolutionData(oldNode, newNode);
1830 return newNode; 1830 return newNode;
1831 } 1831 }
1832 ResolutionCopier.copyResolutionData(oldNode, newNode); 1832 ResolutionCopier.copyResolutionData(oldNode, newNode);
1833 IncrementalAstCloner cloner = 1833 IncrementalAstCloner cloner =
1834 new IncrementalAstCloner(oldNode, newNode, _tokenMap); 1834 new IncrementalAstCloner(oldNode, newNode, _tokenMap);
1835 return originalStructure.accept(cloner) as AstNode; 1835 return originalStructure.accept(cloner);
1836 } 1836 }
1837 1837
1838 /** 1838 /**
1839 * Return the first (non-EOF) token in the token stream containing the 1839 * Return the first (non-EOF) token in the token stream containing the
1840 * [firstToken]. 1840 * [firstToken].
1841 */ 1841 */
1842 Token _findFirstToken(Token firstToken) { 1842 Token _findFirstToken(Token firstToken) {
1843 while (firstToken.type != TokenType.EOF) { 1843 while (firstToken.type != TokenType.EOF) {
1844 firstToken = firstToken.previous; 1844 firstToken = firstToken.previous;
1845 } 1845 }
(...skipping 8126 matching lines...) Expand 10 before | Expand all | Expand 10 after
9972 */ 9972 */
9973 const ParserErrorCode(String name, String message, [String correction]) 9973 const ParserErrorCode(String name, String message, [String correction])
9974 : super(name, message, correction); 9974 : super(name, message, correction);
9975 9975
9976 @override 9976 @override
9977 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; 9977 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
9978 9978
9979 @override 9979 @override
9980 ErrorType get type => ErrorType.SYNTACTIC_ERROR; 9980 ErrorType get type => ErrorType.SYNTACTIC_ERROR;
9981 } 9981 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698