Skip to content

Commit 09595a3

Browse files
committed
Recursive !include parsing
1 parent 5e5c01e commit 09595a3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

examples/include_file_tag.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ impl<'a> yaml::YamlScalarParser for IncludeParser<'a> {
2929
return Some(match File::open(self.root.join(value)){
3030
Ok(mut f) => {
3131
let _ = f.read_to_string(&mut content);
32-
match yaml::YamlLoader::load_from_str(&content.to_owned()) {
32+
let mut loader = yaml::YamlLoader::new();
33+
loader.register_scalar_parser(self);
34+
match loader.parse_from_str(&content.to_owned()) {
3335
Ok(mut docs) => docs.pop().unwrap(),
3436
Err(_) => yaml::Yaml::BadValue
3537
}

0 commit comments

Comments
 (0)