aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/seld/json_lint.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-29 01:30:42 +0900
committernsfisis <nsfisis@gmail.com>2026-06-29 01:31:37 +0900
commit1036b7e33a4360df8b99f81ef03492fee8328bd0 (patch)
treed963d6f83674884dabbd20fd60c5c8f75c661347 /crates/shirabe-external-packages/src/seld/json_lint.rs
parent9be0f98f71fe8071ab839ac1036b4064ac3172b4 (diff)
downloadphp-shirabe-1036b7e33a4360df8b99f81ef03492fee8328bd0.tar.gz
php-shirabe-1036b7e33a4360df8b99f81ef03492fee8328bd0.tar.zst
php-shirabe-1036b7e33a4360df8b99f81ef03492fee8328bd0.zip
refactor(json): replace seld/jsonlint with serde_json
Validate JSON syntax with serde_json's parse errors in JsonFile, and detect duplicate keys in ConfigValidator with a hand-written serde visitor, dropping the now-unused JsonParser/Lexer/DuplicateKeyException ports. ParsingException is kept as the thrown error type and downcast signal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/seld/json_lint.rs')
-rw-r--r--crates/shirabe-external-packages/src/seld/json_lint.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/crates/shirabe-external-packages/src/seld/json_lint.rs b/crates/shirabe-external-packages/src/seld/json_lint.rs
index 8027cb2..2165c8f 100644
--- a/crates/shirabe-external-packages/src/seld/json_lint.rs
+++ b/crates/shirabe-external-packages/src/seld/json_lint.rs
@@ -1,9 +1,15 @@
-pub mod duplicate_key_exception;
-pub mod json_parser;
-pub mod lexer;
+//! Partial port of seld/jsonlint.
+//!
+//! The parser, lexer, and duplicate-key exception (`JsonParser`, `Lexer`,
+//! `DuplicateKeyException`) are intentionally not ported: JSON syntax validation now relies on
+//! serde_json, and duplicate-key detection is done with a hand-written serde visitor, so
+//! jsonlint's own parsing machinery is no longer needed.
+//!
+//! `ParsingException` is kept because it is the exception type thrown for invalid JSON and is
+//! matched (via downcast) across the codebase as an error-kind signal; it also carries detail
+//! such as the error line. Porting it keeps both the thrown exception class and the information
+//! it carries unchanged.
+
pub mod parsing_exception;
-pub use duplicate_key_exception::*;
-pub use json_parser::*;
-pub use lexer::*;
pub use parsing_exception::*;