OLD | NEW |
| (Empty) |
1 import 'package:yaml/yaml.dart'; | |
2 | |
3 main() { | |
4 const src = """ | |
5 name: linter | |
6 version: 0.0.1 | |
7 author: Dart Team <misc@dartlang.org> | |
8 authors: | |
9 - Bill | |
10 - Ted | |
11 description: Style linter for Dart. | |
12 documentation: | |
13 homepage: https://github.com/dart-lang/linter | |
14 dependencies: | |
15 transmogrify: | |
16 hosted: | |
17 name: transmogrify | |
18 url: http://your-package-server.com | |
19 version: '>=0.4.0 <1.0.0' | |
20 analyzer: '0.24.0-dev.1' | |
21 cli_util: '>=0.0.1 <0.1.0' | |
22 semver: '>=0.2.0 <0.3.0' | |
23 yaml: '>=2.1.2 <3.0.0' | |
24 kittens: | |
25 git: | |
26 url: git://github.com/munificent/kittens.git | |
27 ref: some-branch | |
28 foo: any | |
29 dev_dependencies: | |
30 markdown: '>=0.7.1+2 <0.8.0' | |
31 unittest: '>=0.11.0 <0.12.0' | |
32 """; | |
33 | |
34 YamlMap node = loadYamlNode(src, sourceUrl: null); | |
35 node.nodes.forEach((k, v) { | |
36 if (k is YamlScalar) print(k.span); | |
37 }); | |
38 } | |
OLD | NEW |