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 library sourcemap.html_parts; | 5 library sourcemap.html_parts; |
6 | 6 |
7 import 'sourcemap_html_helper.dart'; | 7 import 'sourcemap_html_helper.dart'; |
8 | 8 |
9 class Annotation { | 9 class Annotation { |
10 final id; | 10 final id; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 LineDataFunction getLineData}) { | 118 LineDataFunction getLineData}) { |
119 return new HtmlPrintContext( | 119 return new HtmlPrintContext( |
120 lineNoWidth: lineNoWidth ?? this.lineNoWidth, | 120 lineNoWidth: lineNoWidth ?? this.lineNoWidth, |
121 usePre: usePre ?? this.usePre, | 121 usePre: usePre ?? this.usePre, |
122 includeAnnotation: includeAnnotation ?? this.includeAnnotation, | 122 includeAnnotation: includeAnnotation ?? this.includeAnnotation, |
123 getAnnotationData: getAnnotationData ?? this.getAnnotationData, | 123 getAnnotationData: getAnnotationData ?? this.getAnnotationData, |
124 getLineData: getLineData ?? this.getLineData); | 124 getLineData: getLineData ?? this.getLineData); |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 enum HtmlPartKind { CODE, LINE, CONST, NEWLINE, TEXT, TAG, LINE_NUMBER, } | 128 enum HtmlPartKind { |
| 129 CODE, |
| 130 LINE, |
| 131 CONST, |
| 132 NEWLINE, |
| 133 TEXT, |
| 134 TAG, |
| 135 LINE_NUMBER, |
| 136 } |
129 | 137 |
130 abstract class HtmlPart { | 138 abstract class HtmlPart { |
131 void printHtmlOn(StringBuffer buffer, HtmlPrintContext context); | 139 void printHtmlOn(StringBuffer buffer, HtmlPrintContext context); |
132 | 140 |
133 HtmlPartKind get kind; | 141 HtmlPartKind get kind; |
134 | 142 |
135 toJson(JsonStrategy strategy); | 143 toJson(JsonStrategy strategy); |
136 | 144 |
137 static HtmlPart fromJson(json, JsonStrategy strategy) { | 145 static HtmlPart fromJson(json, JsonStrategy strategy) { |
138 if (json is String) { | 146 if (json is String) { |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 482 |
475 Annotation decodeAnnotation(Map json) { | 483 Annotation decodeAnnotation(Map json) { |
476 return new Annotation(json['id'], json['codeOffset'], json['title'], | 484 return new Annotation(json['id'], json['codeOffset'], json['title'], |
477 data: json['data']); | 485 data: json['data']); |
478 } | 486 } |
479 | 487 |
480 encodeLineAnnotation(lineAnnotation) => lineAnnotation; | 488 encodeLineAnnotation(lineAnnotation) => lineAnnotation; |
481 | 489 |
482 decodeLineAnnotation(json) => json; | 490 decodeLineAnnotation(json) => json; |
483 } | 491 } |
OLD | NEW |