pikopiko 0.1.0

MML parser, compiler and chiptune player for games, with diagnostics designed for tools and AI.
Documentation
//! `basic` 音源のデモ曲(`songs/basic/`)の検査。
//!
//! デモ曲は使う人が書き方を真似る見本なので、文法を変えたときに診断が出るように
//! なっていないか、マイコン向けのイベント列バイナリにできるかをここで見張る。

const DEMOS: [&str; 1] = [include_str!("../songs/basic/demo_hard_bounce.mml")];

#[test]
fn demos_compile_without_diagnostics() {
    for src in DEMOS {
        let (song, diags) = pikopiko::synth::compile(src);
        assert!(diags.is_empty(), "{diags:?}");
        assert_eq!(song.unwrap().synth.name, "basic");
    }
}

#[test]
fn demos_encode_to_binary() {
    for src in DEMOS {
        let (song, _) = pikopiko::synth::compile(src);
        let song = song.unwrap();
        let bin = pikopiko::export::binary::encode(&song).expect("イベント列バイナリにできる");
        assert!(!bin.is_empty());
    }
}