perl-corpus 0.13.3

Test corpus management and generators for Perl parsers
Documentation
1
2
3
4
5
6
7
8
use crate::metadata::{self, Section};
use anyhow::{Context, Result};
use std::{fs, path::Path};

pub fn parse_file(path: &Path) -> Result<Vec<Section>> {
    let text = fs::read_to_string(path).with_context(|| format!("reading {}", path.display()))?;
    Ok(metadata::parser::parse_sections(&text, path))
}