From 027fe270a27f88ab6759512fbf27a8c162f7d2d8 Mon Sep 17 00:00:00 2001 From: dece Date: Sun, 24 May 2020 16:11:41 +0200 Subject: [PATCH] parsers: rename to formats --- src/{parsers => formats}/bhd.rs | 0 src/{parsers => formats}/bhf.rs | 8 ++++---- src/{parsers => formats}/bnd.rs | 2 +- src/{parsers => formats}/common.rs | 0 src/{parsers => formats}/dat.rs | 2 +- src/{parsers => formats}/dcx.rs | 0 src/{parsers => formats}/errors.rs | 0 src/{parsers => formats}/param.rs | 4 ++-- src/{parsers => formats}/paramdef.rs | 2 +- src/lib.rs | 2 +- src/unpackers/bhd.rs | 2 +- src/unpackers/bhf.rs | 2 +- src/unpackers/bnd.rs | 2 +- src/unpackers/dat.rs | 2 +- src/unpackers/dcx.rs | 2 +- src/unpackers/param.rs | 4 ++-- src/unpackers/paramdef.rs | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) rename src/{parsers => formats}/bhd.rs (100%) rename src/{parsers => formats}/bhf.rs (94%) rename src/{parsers => formats}/bnd.rs (98%) rename src/{parsers => formats}/common.rs (100%) rename src/{parsers => formats}/dat.rs (96%) rename src/{parsers => formats}/dcx.rs (100%) rename src/{parsers => formats}/errors.rs (100%) rename src/{parsers => formats}/param.rs (99%) rename src/{parsers => formats}/paramdef.rs (99%) diff --git a/src/parsers/bhd.rs b/src/formats/bhd.rs similarity index 100% rename from src/parsers/bhd.rs rename to src/formats/bhd.rs diff --git a/src/parsers/bhf.rs b/src/formats/bhf.rs similarity index 94% rename from src/parsers/bhf.rs rename to src/formats/bhf.rs index 18ab7e6..50e2164 100644 --- a/src/parsers/bhf.rs +++ b/src/formats/bhf.rs @@ -4,8 +4,8 @@ use nom::multi::count; use nom::number::complete::*; use nom::sequence::tuple; -use crate::parsers::bnd::{BinderOptions, format, use_be}; -use crate::parsers::common::{sjis_to_string, take_cstring}; +use crate::formats::bnd::{BinderOptions, format, use_be}; +use crate::formats::common::{sjis_to_string, take_cstring}; #[derive(Debug)] pub struct BhfHeader { @@ -22,10 +22,10 @@ pub struct BhfHeader { } impl BinderOptions for BhfHeader { - /// See `parsers::bnd::format` function. + /// See `formats::bnd::format` function. fn format(&self) -> u8 { format(self.endianness, self.raw_format) } - /// See `parsers::bnd::use_be` function. + /// See `formats::bnd::use_be` function. fn use_be(&self) -> bool { use_be(self.endianness, self.format()) } } diff --git a/src/parsers/bnd.rs b/src/formats/bnd.rs similarity index 98% rename from src/parsers/bnd.rs rename to src/formats/bnd.rs index 837afa7..62219cb 100644 --- a/src/parsers/bnd.rs +++ b/src/formats/bnd.rs @@ -5,7 +5,7 @@ use nom::number::complete::*; use nom::sequence::tuple; use crate::utils::bin::has_flag; -use crate::parsers::common::{sjis_to_string, take_cstring}; +use crate::formats::common::{sjis_to_string, take_cstring}; const FORMAT_BE: u8 = 0b00000001; const FORMAT_HAS_ID: u8 = 0b00000010; diff --git a/src/parsers/common.rs b/src/formats/common.rs similarity index 100% rename from src/parsers/common.rs rename to src/formats/common.rs diff --git a/src/parsers/dat.rs b/src/formats/dat.rs similarity index 96% rename from src/parsers/dat.rs rename to src/formats/dat.rs index 9ad9112..e5918f3 100644 --- a/src/parsers/dat.rs +++ b/src/formats/dat.rs @@ -3,7 +3,7 @@ use nom::multi::count; use nom::number::complete::*; use nom::sequence::tuple; -use crate::parsers::common::take_cstring_from; +use crate::formats::common::take_cstring_from; #[derive(Debug)] pub struct DatHeader { diff --git a/src/parsers/dcx.rs b/src/formats/dcx.rs similarity index 100% rename from src/parsers/dcx.rs rename to src/formats/dcx.rs diff --git a/src/parsers/errors.rs b/src/formats/errors.rs similarity index 100% rename from src/parsers/errors.rs rename to src/formats/errors.rs diff --git a/src/parsers/param.rs b/src/formats/param.rs similarity index 99% rename from src/parsers/param.rs rename to src/formats/param.rs index 9b9de19..a4ea403 100644 --- a/src/parsers/param.rs +++ b/src/formats/param.rs @@ -6,8 +6,8 @@ use nom::multi::count; use nom::number::complete::*; use nom::sequence::tuple; -use crate::parsers::common::{sjis_to_string, take_cstring, take_cstring_from, VarSizeInt}; -use crate::parsers::paramdef; +use crate::formats::common::{sjis_to_string, take_cstring, take_cstring_from, VarSizeInt}; +use crate::formats::paramdef; use crate::utils::bin::{has_flag, mask}; use crate::utils::str as utils_str; diff --git a/src/parsers/paramdef.rs b/src/formats/paramdef.rs similarity index 99% rename from src/parsers/paramdef.rs rename to src/formats/paramdef.rs index 6747c3b..7a7c4af 100644 --- a/src/parsers/paramdef.rs +++ b/src/formats/paramdef.rs @@ -5,7 +5,7 @@ use nom::multi::count; use nom::number::complete::*; use nom::sequence::tuple; -use crate::parsers::common::{sjis_to_string_lossy, take_cstring, take_cstring_from, VarSizeInt}; +use crate::formats::common::{sjis_to_string_lossy, take_cstring, take_cstring_from, VarSizeInt}; use crate::utils::str as utils_str; #[derive(Debug)] diff --git a/src/lib.rs b/src/lib.rs index d379805..aa304e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ #![allow(non_snake_case)] pub mod name_hashes; -pub mod parsers { +pub mod formats { pub mod bhd; pub mod bhf; pub mod bnd; diff --git a/src/unpackers/bhd.rs b/src/unpackers/bhd.rs index 0987e2f..2b74f58 100644 --- a/src/unpackers/bhd.rs +++ b/src/unpackers/bhd.rs @@ -6,7 +6,7 @@ use std::path; use nom::Err::{Error as NomError, Failure as NomFailure}; use crate::name_hashes; -use crate::parsers::bhd; +use crate::formats::bhd; use crate::unpackers::errors::UnpackError; use crate::utils::fs as utils_fs; diff --git a/src/unpackers/bhf.rs b/src/unpackers/bhf.rs index 85af384..59eb393 100644 --- a/src/unpackers/bhf.rs +++ b/src/unpackers/bhf.rs @@ -4,7 +4,7 @@ use std::path; use nom::Err::{Error as NomError, Failure as NomFailure}; -use crate::parsers::bhf; +use crate::formats::bhf; use crate::unpackers::errors::UnpackError; use crate::utils::fs as utils_fs; diff --git a/src/unpackers/bnd.rs b/src/unpackers/bnd.rs index 831a53d..03a524e 100644 --- a/src/unpackers/bnd.rs +++ b/src/unpackers/bnd.rs @@ -4,7 +4,7 @@ use std::path; use nom::Err::{Error as NomError, Failure as NomFailure}; -use crate::parsers::bnd; +use crate::formats::bnd; use crate::unpackers::dcx::load_dcx; use crate::unpackers::errors::UnpackError; use crate::utils::fs as utils_fs; diff --git a/src/unpackers/dat.rs b/src/unpackers/dat.rs index 53d2d89..48443fd 100644 --- a/src/unpackers/dat.rs +++ b/src/unpackers/dat.rs @@ -4,7 +4,7 @@ use std::path; use nom::Err::{Error as NomError, Failure as NomFailure}; -use crate::parsers::dat; +use crate::formats::dat; use crate::unpackers::errors::UnpackError; use crate::utils::fs as utils_fs; diff --git a/src/unpackers/dcx.rs b/src/unpackers/dcx.rs index 5fa313d..422f50b 100644 --- a/src/unpackers/dcx.rs +++ b/src/unpackers/dcx.rs @@ -5,7 +5,7 @@ use std::path; use flate2::read::ZlibDecoder; use nom::Err::{Error as NomError, Failure as NomFailure}; -use crate::parsers::dcx; +use crate::formats::dcx; use crate::unpackers::errors::UnpackError; use crate::utils::fs as utils_fs; diff --git a/src/unpackers/param.rs b/src/unpackers/param.rs index 12c4c4c..4719928 100644 --- a/src/unpackers/param.rs +++ b/src/unpackers/param.rs @@ -2,8 +2,8 @@ use std::path; use nom::Err::{Error as NomError, Failure as NomFailure}; -use crate::parsers::param; -use crate::parsers::paramdef; +use crate::formats::param; +use crate::formats::paramdef; use crate::unpackers::errors::UnpackError; use crate::utils::fs as utils_fs; diff --git a/src/unpackers/paramdef.rs b/src/unpackers/paramdef.rs index 8ced473..3276aec 100644 --- a/src/unpackers/paramdef.rs +++ b/src/unpackers/paramdef.rs @@ -2,7 +2,7 @@ use std::path; use nom::Err::{Error as NomError, Failure as NomFailure}; -use crate::parsers::paramdef; +use crate::formats::paramdef; use crate::unpackers::errors::UnpackError; use crate::utils::fs as utils_fs;