Fix an infinite loop bug.
Merge pull request #19 from denesalmasi/yaml

The yaml scanner hung in an infinite loop when trying to scan this
string: "{" (a single opening brace).

_fetchMoreTokens kept growing the token list with a STREAM_END token ad
infinitum.
tree: fd87bea54c2175a19c17752d1a7004417dff5d76
  1. .analysis_options
  2. .gitignore
  3. .test_config
  4. CHANGELOG.md
  5. LICENSE
  6. README.md
  7. benchmark/
  8. codereview.settings
  9. lib/
  10. libyaml-license.txt
  11. pubspec.yaml
  12. 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));
}