diff options
Diffstat (limited to 'crates/shirabe-external-packages/src/seld/json_lint')
4 files changed, 45 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs b/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs new file mode 100644 index 0000000..9e35396 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct DuplicateKeyException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for DuplicateKeyException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for DuplicateKeyException {} diff --git a/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs b/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs new file mode 100644 index 0000000..6deb13c --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs @@ -0,0 +1,16 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct JsonParser; + +impl JsonParser { + pub const DETECT_KEY_CONFLICTS: u32 = 1; + + pub fn new() -> Self { + todo!() + } + + pub fn parse(&self, json: &str, flags: u32) -> anyhow::Result<PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/seld/json_lint/mod.rs b/crates/shirabe-external-packages/src/seld/json_lint/mod.rs new file mode 100644 index 0000000..fef5a26 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/mod.rs @@ -0,0 +1,3 @@ +pub mod duplicate_key_exception; +pub mod json_parser; +pub mod parsing_exception; diff --git a/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs b/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs new file mode 100644 index 0000000..3ec6b6b --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct ParsingException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for ParsingException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for ParsingException {} |
