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

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

Issue 2837473002: merge fasta.PrecedenceInfo into analyzer.TokenType (Closed)
Patch Set: Created 3 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) 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/precedence.dart'; 5 import 'package:front_end/src/fasta/scanner/precedence.dart';
6 import 'package:front_end/src/fasta/scanner/string_scanner.dart'; 6 import 'package:front_end/src/fasta/scanner/string_scanner.dart';
7 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; 7 import 'package:front_end/src/fasta/scanner/token.dart' as fasta;
8 import 'package:front_end/src/scanner/token.dart'; 8 import 'package:front_end/src/scanner/token.dart';
9 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; 10 import 'package:test_reflective_loader/test_reflective_loader.dart';
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 void assertInfo(check(String source, fasta.Token token), 100 void assertInfo(check(String source, fasta.Token token),
101 {bool includeLazyAssignmentOperators: true}) { 101 {bool includeLazyAssignmentOperators: true}) {
102 void assertLexeme(String source) { 102 void assertLexeme(String source) {
103 if (source == null || source.isEmpty) return; 103 if (source == null || source.isEmpty) return;
104 var scanner = new StringScanner(source, includeComments: true); 104 var scanner = new StringScanner(source, includeComments: true);
105 var token = scanner.tokenize(); 105 var token = scanner.tokenize();
106 check(source, token); 106 check(source, token);
107 } 107 }
108 108
109 for (PrecedenceInfo info in PrecedenceInfo.all) { 109 for (TokenType info in TokenType.all) {
110 assertLexeme(info.value); 110 assertLexeme(info.value);
111 } 111 }
112 for (TokenType tt in allTokenTypes) { 112 for (TokenType tt in allTokenTypes) {
113 assertLexeme(tt.lexeme); 113 assertLexeme(tt.lexeme);
114 } 114 }
115 assertLexeme('1.0'); // DOUBLE 115 assertLexeme('1.0'); // DOUBLE
116 assertLexeme('0xA'); // HEXADECIMAL 116 assertLexeme('0xA'); // HEXADECIMAL
117 assertLexeme('1'); // INT 117 assertLexeme('1'); // INT
118 assertLexeme('var'); // KEYWORD 118 assertLexeme('var'); // KEYWORD
119 assertLexeme('#!/'); // SCRIPT_TAG 119 assertLexeme('#!/'); // SCRIPT_TAG
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 assertLexeme('var', TokenType.KEYWORD); 505 assertLexeme('var', TokenType.KEYWORD);
506 assertLexeme('#!/', TokenType.SCRIPT_TAG); 506 assertLexeme('#!/', TokenType.SCRIPT_TAG);
507 assertLexeme('"foo"', TokenType.STRING); 507 assertLexeme('"foo"', TokenType.STRING);
508 508
509 expect(STRING_INTERPOLATION_INFO, 509 expect(STRING_INTERPOLATION_INFO,
510 same(TokenType.STRING_INTERPOLATION_EXPRESSION)); 510 same(TokenType.STRING_INTERPOLATION_EXPRESSION));
511 expect(STRING_INTERPOLATION_IDENTIFIER_INFO, 511 expect(STRING_INTERPOLATION_IDENTIFIER_INFO,
512 same(TokenType.STRING_INTERPOLATION_IDENTIFIER)); 512 same(TokenType.STRING_INTERPOLATION_IDENTIFIER));
513 } 513 }
514 } 514 }
OLDNEW
« pkg/compiler/lib/src/resolution/enum_creator.dart ('K') | « pkg/front_end/lib/src/scanner/token.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698