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

Unified Diff: pkg/yaml/lib/src/yaml_node_wrapper.dart

Issue 689513002: Rewrite the pkg/yaml parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/yaml/lib/src/yaml_node.dart ('k') | pkg/yaml/lib/yaml.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/yaml/lib/src/yaml_node_wrapper.dart
diff --git a/pkg/yaml/lib/src/yaml_node_wrapper.dart b/pkg/yaml/lib/src/yaml_node_wrapper.dart
index d000dcb8e6e5952e9e3294b6442a772663849873..be96ba4d532a22fe1d6fe476e4f694d28be90d1d 100644
--- a/pkg/yaml/lib/src/yaml_node_wrapper.dart
+++ b/pkg/yaml/lib/src/yaml_node_wrapper.dart
@@ -10,12 +10,15 @@ import 'package:collection/collection.dart' as pkg_collection;
import 'package:source_span/source_span.dart';
import 'null_span.dart';
+import 'style.dart';
import 'yaml_node.dart';
/// A wrapper that makes a normal Dart map behave like a [YamlMap].
class YamlMapWrapper extends MapBase
with pkg_collection.UnmodifiableMapMixin
implements YamlMap {
+ final CollectionStyle style = CollectionStyle.ANY;
+
final Map _dartMap;
final SourceSpan span;
@@ -55,8 +58,8 @@ class _YamlMapNodes extends MapBase<dynamic, YamlNode>
final SourceSpan _span;
- Iterable get keys =>
- _dartMap.keys.map((key) => new YamlScalar.internal(key, _span));
+ Iterable get keys => _dartMap.keys.map((key) =>
+ new YamlScalar.internal(key, _span, ScalarStyle.ANY));
_YamlMapNodes(this._dartMap, this._span);
@@ -76,6 +79,8 @@ class _YamlMapNodes extends MapBase<dynamic, YamlNode>
// TODO(nweiz): Use UnmodifiableListMixin when issue 18970 is fixed.
/// A wrapper that makes a normal Dart list behave like a [YamlList].
class YamlListWrapper extends ListBase implements YamlList {
+ final CollectionStyle style = CollectionStyle.ANY;
+
final List _dartList;
final SourceSpan span;
@@ -146,5 +151,5 @@ class _YamlListNodes extends ListBase<YamlNode> {
YamlNode _nodeForValue(value, SourceSpan span) {
if (value is Map) return new YamlMapWrapper._(value, span);
if (value is List) return new YamlListWrapper._(value, span);
- return new YamlScalar.internal(value, span);
+ return new YamlScalar.internal(value, span, ScalarStyle.ANY);
}
« no previous file with comments | « pkg/yaml/lib/src/yaml_node.dart ('k') | pkg/yaml/lib/yaml.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698