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

Side by Side Diff: pkg/front_end/test/token_test.dart

Issue 2899043006: cleanup fasta token classes (Closed)
Patch Set: Created 3 years, 6 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/front_end/test/subpackage_relationships_test.dart ('k') | no next file » | 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) 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/scanner/string_scanner.dart'; 5 import 'package:front_end/src/fasta/scanner/string_scanner.dart';
6 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; 6 import 'package:front_end/src/fasta/scanner/token.dart' as fasta;
7 import 'package:front_end/src/scanner/token.dart'; 7 import 'package:front_end/src/scanner/token.dart';
8 import 'package:front_end/src/scanner/errors.dart' as analyzer; 8 import 'package:front_end/src/scanner/errors.dart' as analyzer;
9 import 'package:front_end/src/scanner/reader.dart' as analyzer; 9 import 'package:front_end/src/scanner/reader.dart' as analyzer;
10 import 'package:front_end/src/scanner/scanner.dart' as analyzer; 10 import 'package:front_end/src/scanner/scanner.dart' as analyzer;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 var token2 = analyzerScanner.tokenize(); 97 var token2 = analyzerScanner.tokenize();
98 98
99 bool stringTokenFound = false; 99 bool stringTokenFound = false;
100 bool keywordTokenFound = false; 100 bool keywordTokenFound = false;
101 bool symbolTokenFound = false; 101 bool symbolTokenFound = false;
102 bool beginGroupTokenFound = false; 102 bool beginGroupTokenFound = false;
103 103
104 while (!token1.isEof) { 104 while (!token1.isEof) {
105 if (token1 is fasta.StringToken) stringTokenFound = true; 105 if (token1 is fasta.StringToken) stringTokenFound = true;
106 if (token1 is KeywordToken) keywordTokenFound = true; 106 if (token1 is KeywordToken) keywordTokenFound = true;
107 if (token1 is fasta.SymbolToken) symbolTokenFound = true; 107 if (token1.type == TokenType.OPEN_PAREN) symbolTokenFound = true;
108 if (token1 is fasta.BeginGroupToken) beginGroupTokenFound = true; 108 if (token1 is BeginToken) beginGroupTokenFound = true;
109 109
110 var copy1 = token1.copy(); 110 var copy1 = token1.copy();
111 expect(copy1, isNotNull); 111 expect(copy1, isNotNull);
112 112
113 var copy2 = token2.copy(); 113 var copy2 = token2.copy();
114 expect(copy2, isNotNull); 114 expect(copy2, isNotNull);
115 115
116 assertCopiedToken(copy1, copy2); 116 assertCopiedToken(copy1, copy2);
117 117
118 token1 = token1.next; 118 token1 = token1.next;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 class TestScanner extends analyzer.Scanner { 213 class TestScanner extends analyzer.Scanner {
214 TestScanner(analyzer.CharacterReader reader) : super.create(reader); 214 TestScanner(analyzer.CharacterReader reader) : super.create(reader);
215 215
216 @override 216 @override
217 void reportError( 217 void reportError(
218 analyzer.ScannerErrorCode errorCode, int offset, List<Object> arguments) { 218 analyzer.ScannerErrorCode errorCode, int offset, List<Object> arguments) {
219 fail('Unexpected error $errorCode while scanning offset $offset\n' 219 fail('Unexpected error $errorCode while scanning offset $offset\n'
220 ' arguments: $arguments'); 220 ' arguments: $arguments');
221 } 221 }
222 } 222 }
OLDNEW
« no previous file with comments | « pkg/front_end/test/subpackage_relationships_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698