libdaw 0.2.0

A library for Rust for making programmable DAWs
Documentation
1
2
3
4
5
6
7
8
use crate::{metronome::Beat, notation::Rest, parse::IResult};
use nom::{bytes::complete::tag, combinator::opt, sequence::preceded};

pub fn rest(input: &str) -> IResult<&str, Rest> {
    let (input, _) = tag("r")(input)?;
    let (input, length) = opt(preceded(tag(","), Beat::parse))(input)?;
    Ok((input, Rest { length }))
}