#![warn(missing_docs)]
#![no_std]
#![feature(doc_cfg)]
macro_rules! code_name { () => { "sj" }}
macro_rules! version { () => { "2.0.3" }}
pub const NAME: &str = "SJ";
pub const CODE_NAME: &str = code_name!();
pub const ID: &str = concat!(
"d1e51da8-8e4e9fc1-6d3f9d7e-c135be7d-a1cdeb80-6920a8dd-d18e7fc6-3e1d2013-",
"208af671-7371879e-1b7a8d84-2613ca10-dfeea565-302e82c4-53dd84e8-f31d9ead",
);
pub const VERSION: &str = version!();
pub const RELEASE_DATE: (u16, u8, u8) = (2025, 3, 21);
pub const TAG: &str = concat!(code_name!(), "::d1e51da8::", version!());
extern crate alloc;
#[cfg(feature="std")]
extern crate std;
macro_rules! e {
($s: literal) => {
$crate::Error::new(line!(), module_path!(), Some(alloc::borrow::Cow::Borrowed($s)))
};
}
macro_rules! err {
($($arg: tt)*) => {
$crate::Error::new(line!(), module_path!(), Some(alloc::borrow::Cow::Owned(alloc::format!($($arg)*))))
};
}
#[test]
fn test_macro_err() {
use alloc::borrow::Cow;
macro_rules! s_test { () => { "test" }}
fn eq(first: Error, second: Error) -> bool {
first.line() == second.line() && first.module_path() == second.module_path() && first.msg() == second.msg()
}
assert!(eq(err!("{s:?}", s=s_test!()), Error::new(line!(), module_path!(), Some(Cow::Owned(alloc::format!("{:?}", s_test!()))))));
let some = "===";
assert_eq!(err!("{some}").msg(), Error::new(line!(), module_path!(), Some(Cow::Borrowed(some))).msg());
}
mod bytes;
mod error;
mod json;
mod map;
mod map_kind;
mod number;
mod parser;
pub use self::{
error::*,
json::*,
map::*,
map_kind::*,
number::*,
};
#[cfg(feature="std")]
#[doc(cfg(feature="std"))]
pub use self::parser::*;
pub mod version_info;
pub type Result<T> = core::result::Result<T, Error>;
#[cfg(feature="std")]
#[doc(cfg(feature="std"))]
pub type IoResult<T> = core::result::Result<T, std::io::Error>;
#[test]
fn test_crate_version() {
assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
}