| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |