commit | a0ecc9820f28d01736805d0d72c2b25bd0d2633a | [log] [tgz] |
---|---|---|
author | Kevin Moore <kevmoo@google.com> | Tue Apr 09 16:59:12 2019 -0700 |
committer | Kevin Moore <kevmoo@google.com> | Tue Apr 09 16:59:12 2019 -0700 |
tree | 98838254eb3799377d9484d7cff5c52614f550b0 | |
parent | aa6b82cb13ade03f55e06b9fbe47f11a0ec92102 [diff] |
Revert "Improve the YamlScalar.span values with trailing whitespace" This reverts commit aa6b82cb13ade03f55e06b9fbe47f11a0ec92102. https://github.com/dart-lang/yaml/issues/51 only seems to affect JSON-encoded source files. Not worth this hack.
A parser for YAML.
Use loadYaml
to load a single document, or loadYamlStream
to load a stream of documents. For example:
import 'package:yaml/yaml.dart'; main() { var doc = loadYaml("YAML: YAML Ain't Markup Language"); print(doc['YAML']); }
This library currently doesn't support dumping to YAML. You should use json.encode
from dart:convert
instead:
import 'dart:convert'; import 'package:yaml/yaml.dart'; main() { var doc = loadYaml("YAML: YAML Ain't Markup Language"); print(json.encode(doc)); }