gd_lilypond¶
Reads notation into a music model. Never runs Scheme, external programs or file I/O. Includes are lexical and require an explicit caller-supplied policy callback.
Re-exports
- pub use gd_score::Error
- pub use gd_score::ErrorKind
- pub use gd_score::FileId
- pub use gd_score::Severity
- pub use gd_score::Span
Structs
- pub struct gd_lilypond::Command¶
-
One command in the versioned Guidedog notation profile.
Fields
- pub name: &'static str¶
-
Name without its backslash.
- pub phase: u8¶
-
GDS phase that introduces the construct, or zero for refused commands.
- pub status: CommandStatus¶
-
Explicit current support status.
- pub struct gd_lilypond::Failed¶
-
A failed parse or interpretation that keeps enough source to place its diagnostic.
Fields
- pub files: SourceFiles¶
-
Every file read before the failure.
Trait Implementations
- impl std::fmt::Display for Failed
-
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
- impl std::error::Error for Failed
- pub struct gd_lilypond::SourceFile¶
-
Retained input text. The name is resolved by the adapter, not by this library.
Fields
- pub struct gd_lilypond::SourceFiles¶
-
Sources indexed by FileId; file zero is the directive’s supplied source.
Fields
- pub files: Vec<SourceFile>¶
-
Files in first-read order, including files that caused an error.
Implementations
- impl SourceFiles
-
- pub fn file(&self, id: FileId) -> Option<&SourceFile>¶
-
Borrows one file, returning None for an unknown identifier.
- pub struct gd_lilypond::Limits¶
-
Bounds for one load, including includes, variable expansion and repeats.
Fields
- pub source_bytes: usize¶
-
Source bytes, charging repeated includes each time.
- pub depth: usize¶
-
Recursive syntax and expansion depth.
- pub files: usize¶
-
Included source files, excluding the main source.
- pub work: usize¶
-
Token and syntax-node visits, including expansions.
- pub events: usize¶
-
Rhythmic and notation events after expansion.
- pub memory_bytes: usize¶
-
Conservative allocation allowance for expanded notation, including copied text.
Trait Implementations
- pub struct gd_lilypond::Expr¶
-
A syntax node in a flat arena. Children own indices, never recursive boxes.
Fields
- pub struct gd_lilypond::Syntax¶
-
Parsed input and its original files. It contains no engraving decisions.
Fields
- pub files: SourceFiles¶
-
Original file text retained for reports.
Implementations
- pub struct gd_lilypond::SyntaxId(pub u32)¶
-
An index into the syntax arena.
- pub struct gd_lilypond::Token¶
-
A notation token with no inferred musical meaning.
Fields
- pub struct gd_lilypond::IncludeRequest<'a>¶
-
An include name and the file in which it appeared.
Fields
- pub name: &'a str¶
-
Name written in the include command.
- pub struct gd_lilypond::IncludedFile¶
-
Source text returned by a confined caller-supplied include reader.
Fields
- pub struct gd_lilypond::IncludeRefusal¶
-
A caller’s refusal to read an included file.
Fields
- pub struct gd_lilypond::Options<'a>¶
-
Reader bounds and explicit file policy. The default refuses filesystem includes.
Fields
- pub include: Option<&'a mut Include<'a>>¶
-
Caller-owned include reader, borrowed only during parsing.
- pub reserve: Option<&'a dyn Fn(usize) -> bool>¶
-
Reserves the complete conservative reader allowance before expansion.
Trait Implementations
- impl fmt::Debug for Options<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct gd_lilypond::Loaded¶
-
A successful load, including retained files and nonfatal diagnostics.
Fields
- pub score: gd_score::Score¶
-
Reader-independent music model.
- pub files: SourceFiles¶
-
All files read, indexed by FileId.
Enums
- pub enum gd_lilypond::CommandStatus¶
-
The explicitly implemented, planned or refused status of a notation command.
Variants
- Implemented¶
-
Fully read and interpreted by the current implementation.
- Planned¶
-
Listed in the GDS, but not yet implemented; always diagnosed as unsupported.
- Ignored¶
-
Metadata accepted without producing marks.
- Refused¶
-
Engraver programming or constructs outside the profile.
- pub enum gd_lilypond::ExprKind¶
-
Structural grouping before pitch, duration or context interpretation.
Variants
- pub enum gd_lilypond::TokenKind¶
-
Lexical categories; numeric values are checked during interpretation.
Variants
- Symbol(char)¶
-
A single punctuation character, including octave marks and Scheme introducers.
- SimultaneousStart¶
-
A pair of opening angle brackets.
- SimultaneousEnd¶
-
A pair of closing angle brackets.
Functions
- pub fn gd_lilypond::command(name: &str) -> Option<&'static Command>¶
-
Borrows a command descriptor, or returns None for a spelling outside the table.
- pub fn gd_lilypond::error_report(error: &Error, files: &SourceFiles) -> gd_report::Report¶
-
Borrows a shared diagnostic and retained source to create an owned report. Missing file identifiers produce an unplaced report rather than a panic.
- pub fn gd_lilypond::interpret_syntax(syntax: &Syntax, limits: &Limits) -> Result<Loaded, Failed>¶
-
Interprets a borrowed syntax arena under explicit expansion and event bounds. Returns a separate score and retained source, or the first placed diagnostic.
- pub fn gd_lilypond::parse_lilypond(source: &str, name: &str, options: &mut Options<'_>) -> Result<Syntax, Failed>¶
-
Parses borrowed notation into a bounded syntax arena without interpreting music. Includes use the explicit callback; failures retain every source read so far.
- pub fn gd_lilypond::load_score(source: &str, name: &str, options: &mut Options<'_>) -> Result<Loaded, Failed>¶
-
Parses and interprets borrowed source under the supplied bounds and include policy. Returns an owned score or a diagnostic with all files read before the failure.
Type Aliases
- pub type gd_lilypond::Include<'a> = dyn FnMut(IncludeRequest<'_>) -> Result<IncludedFile, IncludeRefusal> + 'a¶
-
Decides a lexical include. Called synchronously; never stored after a load.
Constants