commit | df28edda6846b052d75aea0585b8d8aa250d96f2 | [log] [tgz] |
---|---|---|
author | Natalie Weizenbaum <nweiz@google.com> | Wed Sep 02 13:34:36 2015 -0700 |
committer | Natalie Weizenbaum <nweiz@google.com> | Wed Sep 02 13:34:36 2015 -0700 |
tree | 8db6881444c940dd6fe8bd541a590ab8230887ca | |
parent | fe64750a1491edf46f122666d53a3551730e3171 [diff] |
Improve performance by not doing binary searches. Normally getting the line and column of a SpanScanner or a SourceLocation needs a binary search through all the line endings in the source file. This CL avoids those searches by using an eager SpanScanner which does extra computation to track its current line and column position, and storing the line and column directly on _SimpleKey objects. See #12 R=rnystrom@google.com Review URL: https://codereview.chromium.org//1325133002 .
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)); }