Don't use regular expressions in Loader.

This is based on https://codereview.chromium.org/1325053002. It also
avoids redundant parsing where possible.

Closes #12

R=rnystrom@google.com

Review URL: https://codereview.chromium.org//1329763002 .
6 files changed
tree: 9d36b0e4e994aa1bd39df374077e56f380b494a0
  1. .gitignore
  2. .test_config
  3. CHANGELOG.md
  4. LICENSE
  5. README.md
  6. benchmark/
  7. codereview.settings
  8. lib/
  9. libyaml-license.txt
  10. pubspec.yaml
  11. test/
README.md

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));
}