From 013b0402fc314ccc80606a4abc6f4024df46864c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikuro=E3=81=95=E3=81=84=E3=81=AA?= <10331164+MikuroXina@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:59:24 +0900 Subject: [PATCH] docs: Write docs for bms module (#111) --- src/bms.rs | 15 +++++++++++++++ src/bmson/pulse.rs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/bms.rs b/src/bms.rs index 91fb4e1..236d362 100644 --- a/src/bms.rs +++ b/src/bms.rs @@ -1,4 +1,19 @@ //! The parser module of BMS(.bms/.bme/.bml/.pms) file. +//! +//! This module consists of two phases: lexical analyzing and token parsing. +//! +//! `lex` module provides definitions of BMS tokens and a translator from string into them. It supports major commands as possible, because the BMS specification is not standardized yet. If you found a lack of definition, please tell me by opening an issue (only if not open yet). +//! +//! `parse` module provides definitions of BMS semantic objects and managers of BMS score data. The notes are serializable, but parsed result can't bring back into the BMS format text because of there are randomized syntax in BMS. +//! +//! `time` module provides definition of timing for notes as [`time::Track`] and [`time::ObjTime`]. +//! +//! In detail, our policies are: +//! +//! - Support only UTF-8 (as required `String` to input). +//! - Do not support editing BMS source text. +//! - Do not support commands having ambiguous semantics. +//! - Do not support syntax came from typo (such as `#RONDOM` or `#END IF`). pub mod lex; pub mod parse; diff --git a/src/bmson/pulse.rs b/src/bmson/pulse.rs index 01192e6..270ea4d 100644 --- a/src/bmson/pulse.rs +++ b/src/bmson/pulse.rs @@ -9,7 +9,7 @@ use crate::{ time::{ObjTime, Track}, }; -/// Note position for the chart [`Bmson`]. +/// Note position for the chart [`super::Bmson`]. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub struct PulseNumber(pub u32);