derpscfg 0.8.0

A brief, incomplete, and mostly wrong derive implementation for scfg
Documentation
//! Example demonstrating the default attribute
#![allow(unused_crate_dependencies)]
use std::net::Ipv4Addr;

use derpscfg::prelude::*;

#[derive(Debug, Derpscfg)]
pub struct Listen {
    // Parameters can also have default value.
    #[scfg(param, default=String::from("http"))]
    pub ltype: String,
    // If the type does not implement `Default`, an expression has to be provided.
    #[scfg(default=Ipv4Addr::new(127,0,0,1))]
    pub address: Ipv4Addr,
    // If no expression is provided, the type's default value is used (here, 0u16).
    #[scfg(default)]
    pub port: u16,
}

#[derive(Debug, Derpscfg)]
pub struct Config {
    pub listen: Listen,
}

#[derive(Debug, Derpscfg)]
pub struct Wrapper {
    pub config: Config,
}

fn main() {
    static SCFG_DOC: &str = r#"
config {
	listen {
    # all fields have default values, so this works
	}
}
"#;

    let demo = derpscfg::parse::<Wrapper>(SCFG_DOC).unwrap();
    println!("{demo:?}");
}