commit | 1da95e4ee9898ef658444bdd94cced1b5be856b5 | [log] [tgz] |
---|---|---|
author | Dénes Almási <dalmasi@google.com> | Wed Oct 05 17:56:39 2016 +0100 |
committer | Natalie Weizenbaum <nweiz@google.com> | Thu Oct 06 13:20:08 2016 -0700 |
tree | b9dd178e621d0554a8fdf9475f45c34f648ec0f4 | |
parent | 64e02096dbe9cc85ae4f3c841ec904bf64d9800d [diff] |
Do not try to fetch more tokens if the stream end is encountered.
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)); }