Skip to main content

mnk_vmf/
lib.rs

1//! # mnk-vmf
2//!
3//! A fast parser for Valve Map Format (VMF) files used in Source engine.
4//!
5//! This crate provides efficient parsing of VMF files into a strongly-typed AST, with support
6//! for all major VMF constructs including worlds, entities, solids, displacements, and more.
7//!
8//! ## Quick Start
9//!
10//! ```ignore
11//! use mnk_vmf::VMF;
12//!
13//! let vmf = VMF::open("mymap.vmf")?;
14//! let data = vmf.parse()?;
15//!
16//! for block in data {
17//!     match block {
18//!         mnk_vmf::VMFValue::World(world) => {
19//!             println!("World has {} solids", world.solids.len());
20//!         }
21//!         mnk_vmf::VMFValue::Entity(entity) => {
22//!             println!("Entity: {}", entity.classname);
23//!         }
24//!         _ => {}
25//!     }
26//! }
27//! ```
28//!
29//! ## Features
30//!
31//! - **Fast parsing**: Uses Chumsky parser combinators for efficient token-based parsing
32//! - **Complete VMF support**: Handles versioninfo, visgroups, worlds, entities, solids, displacements, cameras, and more
33//! - **Strong typing**: All VMF constructs are represented as Rust types with proper error handling
34//!
35//! ## Modules
36//!
37//! - [`vmf`]: Main entry point for loading and parsing VMF files
38//! - [`types`]: All VMF data types (World, Entity, Solid, etc.)
39//! - [`parser`]: Low-level parsing utilities and traits
40
41mod error;
42mod parser;
43pub mod types;
44pub mod vmf;
45
46pub use parser::util;
47pub use parser::Parser;
48pub use vmf::*;