1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-04 11:04:07 +02:00

some entity parsing

This commit is contained in:
Robin Appelman 2022-02-21 22:08:23 +01:00
commit 26a606db55
5 changed files with 406 additions and 93 deletions

View file

@ -1,4 +1,5 @@
use crate::data::*;
use std::num::{ParseFloatError, ParseIntError};
use thiserror::Error;
#[derive(Debug, Error)]
@ -76,3 +77,15 @@ pub enum ValidationError {
size: usize,
},
}
#[derive(Debug, Error)]
pub enum EntityParseError {
#[error("no such property: {0}")]
NoSuchProperty(&'static str),
#[error("wrong number of elements")]
ElementCount,
#[error(transparent)]
Float(#[from] ParseFloatError),
#[error(transparent)]
Int(#[from] ParseIntError),
}