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

Side by Side Diff: pkg/front_end/test/fasta/parser/token_stream_rewriter_test.dart

Issue 2748583002: fix missed rename fasta.Token.value --> lexeme (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | 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/parser/token_stream_rewriter.dart'; 5 import 'package:front_end/src/fasta/parser/token_stream_rewriter.dart';
6 import 'package:front_end/src/fasta/scanner/precedence.dart'; 6 import 'package:front_end/src/fasta/scanner/precedence.dart';
7 import 'package:front_end/src/fasta/scanner/token.dart'; 7 import 'package:front_end/src/fasta/scanner/token.dart';
8 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; 9 import 'package:test_reflective_loader/test_reflective_loader.dart';
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 /// token stream. 103 /// token stream.
104 /// 104 ///
105 /// The EOF token is returned. 105 /// The EOF token is returned.
106 Token _link(Iterable<Token> tokens) { 106 Token _link(Iterable<Token> tokens) {
107 Token head = new SymbolToken(EOF_INFO, -1); 107 Token head = new SymbolToken(EOF_INFO, -1);
108 for (var token in tokens) { 108 for (var token in tokens) {
109 head.next = token; 109 head.next = token;
110 if (setPrevious) token.previousToken = head; 110 if (setPrevious) token.previousToken = head;
111 head = token; 111 head = token;
112 } 112 }
113 int eofOffset = head.charOffset + head.value.length; 113 int eofOffset = head.charOffset + head.lexeme.length;
114 if (eofOffset < 0) eofOffset = 0; 114 if (eofOffset < 0) eofOffset = 0;
115 Token eof = new SymbolToken(EOF_INFO, eofOffset); 115 Token eof = new SymbolToken(EOF_INFO, eofOffset);
116 head.next = eof; 116 head.next = eof;
117 if (setPrevious) eof.previousToken = head; 117 if (setPrevious) eof.previousToken = head;
118 return eof; 118 return eof;
119 } 119 }
120 120
121 BeginGroupToken _makeBeginGroupToken(int charOffset) { 121 BeginGroupToken _makeBeginGroupToken(int charOffset) {
122 return new BeginGroupToken(OPEN_PAREN_INFO, charOffset); 122 return new BeginGroupToken(OPEN_PAREN_INFO, charOffset);
123 } 123 }
(...skipping 16 matching lines...) Expand all
140 /// Concrete implementation of [TokenStreamRewriterTest] in which 140 /// Concrete implementation of [TokenStreamRewriterTest] in which
141 /// [Token.previousToken] values are set to non-null. 141 /// [Token.previousToken] values are set to non-null.
142 /// 142 ///
143 /// Since [TokenStreamRewriter] makes use of [Token.previousToken] when it can, 143 /// Since [TokenStreamRewriter] makes use of [Token.previousToken] when it can,
144 /// these tests do not exercise the more complex heuristics for finding previous 144 /// these tests do not exercise the more complex heuristics for finding previous
145 /// tokens. 145 /// tokens.
146 @reflectiveTest 146 @reflectiveTest
147 class TokenStreamRewriterTest_UsingPrevious extends TokenStreamRewriterTest { 147 class TokenStreamRewriterTest_UsingPrevious extends TokenStreamRewriterTest {
148 bool get setPrevious => true; 148 bool get setPrevious => true;
149 } 149 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698