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:
parent
db738c5eb3
commit
26a606db55
5 changed files with 406 additions and 93 deletions
13
src/error.rs
13
src/error.rs
|
|
@ -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),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue