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

Side by Side Diff: lib/src/yaml_node.dart

Issue 1329183002: Fix source spans for scalars. (Closed) Base URL: git@github.com:dart-lang/yaml@master
Patch Set: Created 5 years, 3 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 yaml.yaml_node; 5 library yaml.yaml_node;
6 6
7 import 'dart:collection' as collection; 7 import 'dart:collection' as collection;
8 8
9 import 'package:collection/collection.dart'; 9 import 'package:collection/collection.dart';
10 import 'package:source_span/source_span.dart'; 10 import 'package:source_span/source_span.dart';
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 /// 159 ///
160 /// [sourceUrl] may be either a [String], a [Uri], or `null`. 160 /// [sourceUrl] may be either a [String], a [Uri], or `null`.
161 YamlScalar.wrap(this.value, {sourceUrl}) 161 YamlScalar.wrap(this.value, {sourceUrl})
162 : style = ScalarStyle.ANY { 162 : style = ScalarStyle.ANY {
163 _span = new NullSpan(sourceUrl); 163 _span = new NullSpan(sourceUrl);
164 } 164 }
165 165
166 /// Users of the library should not use this constructor. 166 /// Users of the library should not use this constructor.
167 YamlScalar.internal(this.value, ScalarEvent scalar) 167 YamlScalar.internal(this.value, ScalarEvent scalar)
168 : style = scalar.style { 168 : style = scalar.style {
169 _span = span; 169 _span = scalar.span;
170 } 170 }
171 171
172 /// Users of the library should not use this constructor. 172 /// Users of the library should not use this constructor.
173 YamlScalar.internalWithSpan(this.value, SourceSpan span) 173 YamlScalar.internalWithSpan(this.value, SourceSpan span)
174 : style = ScalarStyle.ANY { 174 : style = ScalarStyle.ANY {
175 _span = span; 175 _span = span;
176 } 176 }
177 177
178 String toString() => value.toString(); 178 String toString() => value.toString();
179 } 179 }
180 180
181 /// Sets the source span of a [YamlNode]. 181 /// Sets the source span of a [YamlNode].
182 /// 182 ///
183 /// This method is not exposed publicly. 183 /// This method is not exposed publicly.
184 void setSpan(YamlNode node, SourceSpan span) { 184 void setSpan(YamlNode node, SourceSpan span) {
185 node._span = span; 185 node._span = span;
186 } 186 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698