rookie_yaml 0.1.0
rookie_yaml: ^0.1.0 copied to clipboard
A customizable YAML parser that can parse both json and yaml.
example/main.dart
import 'package:rookie_yaml/src/parser/yaml_parser.dart';
void main(List<String> args) {
const yaml = '''
plain
---
"double quoted"
---
'single quoted'
---
> # Comment
folded
---
| # Comment
literal
---
flow: {
flow: map
flow: [sequence]
}
block:
block: map
block:
- sequence
''';
final docs = YamlParser.ofString(yaml).parseDocuments(); // Parse documents
// [parseNodes] maps the docs parsed as below.
print(docs.map((d) => d.root));
}