summaryrefslogtreecommitdiffstats
path: root/src/file/format/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/file/format/mod.rs')
-rw-r--r--src/file/format/mod.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/file/format/mod.rs b/src/file/format/mod.rs
index bbd62a2..53bacf6 100644
--- a/src/file/format/mod.rs
+++ b/src/file/format/mod.rs
@@ -25,6 +25,9 @@ mod ini;
#[cfg(feature = "ron")]
mod ron;
+#[cfg(feature = "json5")]
+mod json5;
+
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub enum FileFormat {
/// TOML (parsed with toml)
@@ -42,6 +45,7 @@ pub enum FileFormat {
/// HJSON (parsed with serde_hjson)
#[cfg(feature = "hjson")]
Hjson,
+
/// INI (parsed with rust_ini)
#[cfg(feature = "ini")]
Ini,
@@ -49,6 +53,10 @@ pub enum FileFormat {
/// RON (parsed with ron)
#[cfg(feature = "ron")]
Ron,
+
+ /// JSON5 (parsed with json5)
+ #[cfg(feature = "json5")]
+ Json5,
}
lazy_static! {
@@ -75,6 +83,9 @@ lazy_static! {
#[cfg(feature = "ron")]
formats.insert(FileFormat::Ron, vec!["ron"]);
+ #[cfg(feature = "json5")]
+ formats.insert(FileFormat::Json5, vec!["json5"]);
+
formats
};
}
@@ -115,6 +126,9 @@ impl FileFormat {
#[cfg(feature = "ron")]
FileFormat::Ron => ron::parse(uri, text),
+
+ #[cfg(feature = "json5")]
+ FileFormat::Json5 => json5::parse(uri, text),
}
}
}