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

Side by Side Diff: tests/compiler/dart2js/annotated_code_helper.dart

Issue 2999003002: Add more tested features to closure_test (Closed)
Patch Set: Updated cf. comments. Created 3 years, 4 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 const int _LF = 0x0A; 5 const int _LF = 0x0A;
6 const int _CR = 0x0D; 6 const int _CR = 0x0D;
7 const int _LBRACE = 0x7B; 7 const int _LBRACE = 0x7B;
8 8
9 const Pattern atBraceStart = '@{'; 9 const Pattern atBraceStart = '@{';
10 const Pattern braceEnd = '}'; 10 const Pattern braceEnd = '}';
11 11
12 final Pattern commentStart = new RegExp(r' */\*'); 12 final Pattern commentStart = new RegExp(r'/\*');
13 final Pattern commentEnd = new RegExp(r'\*/ *'); 13 final Pattern commentEnd = new RegExp(r'\*/ *');
14 14
15 class Annotation { 15 class Annotation {
16 /// 1-based line number of the annotation. 16 /// 1-based line number of the annotation.
17 final int lineNo; 17 final int lineNo;
18 18
19 /// 1-based column number of the annotation. 19 /// 1-based column number of the annotation.
20 final int columnNo; 20 final int columnNo;
21 21
22 /// 0-based character offset of the annotation within the source text. 22 /// 0-based character offset of the annotation within the source text.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 int offset = 0; 161 int offset = 0;
162 for (Annotation annotation in list) { 162 for (Annotation annotation in list) {
163 sb.write(sourceCode.substring(offset, annotation.offset)); 163 sb.write(sourceCode.substring(offset, annotation.offset));
164 sb.write('@{${annotation.text}}'); 164 sb.write('@{${annotation.text}}');
165 offset = annotation.offset; 165 offset = annotation.offset;
166 } 166 }
167 sb.write(sourceCode.substring(offset)); 167 sb.write(sourceCode.substring(offset));
168 return sb.toString(); 168 return sb.toString();
169 } 169 }
170 } 170 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure.dart ('k') | tests/compiler/dart2js/closure/closure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698