OLD | NEW |
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/token.dart'; | 6 import 'package:front_end/src/fasta/scanner/token.dart'; |
7 import 'package:front_end/src/scanner/token.dart' | 7 import 'package:front_end/src/scanner/token.dart' |
8 show BeginToken, Token, TokenType; | 8 show BeginToken, Token, TokenType; |
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 StringToken _makeToken(int charOffset, String text) { | 128 StringToken _makeToken(int charOffset, String text) { |
129 return new StringToken.fromString(null, text, charOffset); | 129 return new StringToken.fromString(null, text, charOffset); |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 /// Concrete implementation of [TokenStreamRewriterTest] in which | 133 /// Concrete implementation of [TokenStreamRewriterTest] in which |
134 /// [Token.previous] values are set to null. | 134 /// [Token.previous] values are set to null. |
135 /// | 135 /// |
136 /// This forces [TokenStreamRewriter] to use its more complex heursitc for | 136 /// This forces [TokenStreamRewriter] to use its more complex heuristic for |
137 /// finding previous tokens. | 137 /// finding previous tokens. |
138 @reflectiveTest | 138 @reflectiveTest |
139 class TokenStreamRewriterTest_NoPrevious extends TokenStreamRewriterTest { | 139 class TokenStreamRewriterTest_NoPrevious extends TokenStreamRewriterTest { |
140 bool get setPrevious => false; | 140 bool get setPrevious => false; |
141 } | 141 } |
142 | 142 |
143 /// Concrete implementation of [TokenStreamRewriterTest] in which | 143 /// Concrete implementation of [TokenStreamRewriterTest] in which |
144 /// [Token.previous] values are set to non-null. | 144 /// [Token.previous] values are set to non-null. |
145 /// | 145 /// |
146 /// Since [TokenStreamRewriter] makes use of [Token.previous] when it can, | 146 /// Since [TokenStreamRewriter] makes use of [Token.previous] when it can, |
147 /// these tests do not exercise the more complex heuristics for finding previous | 147 /// these tests do not exercise the more complex heuristics for finding previous |
148 /// tokens. | 148 /// tokens. |
149 @reflectiveTest | 149 @reflectiveTest |
150 class TokenStreamRewriterTest_UsingPrevious extends TokenStreamRewriterTest { | 150 class TokenStreamRewriterTest_UsingPrevious extends TokenStreamRewriterTest { |
151 bool get setPrevious => true; | 151 bool get setPrevious => true; |
152 } | 152 } |
OLD | NEW |