1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
//! A Rust library for parsing and formatting JASN (Just Another Serialization Notation).
//!
//! JASN is a human-readable data serialization format similar to JSON but with explicit integer and binary types.
//!
//! # Features
//! 1. **Explicit Integer Types**: Distinguish between integers and floats (2 vs 2.0).
//! 2. **Binary Data**: Support for base64 and hex-encoded binary data
//! 3. **Timestamps**: ISO8601/RFC3339 timestamps with `ts"..."` syntax
//! 4. Permissive syntax, similar to JSON5
//!
//! # JASN Syntax
//!
//! A comprehensive example showing all supported value types:
//!
//! ```jasn
//! {
//! /* Comments are supported */
//! null_value: null,
//!
//! /* Booleans */
//! bool_true: true,
//! bool_false: false,
//!
//! /* Integers (explicit type, no decimal point) */
//! integer: 42,
//! negative: -123,
//! hex: 0xFF,
//! binary: 0b1010,
//! octal: 0o755,
//! with_underscores: 1_000_000,
//!
//! /* Floats (always have decimal point or exponent) */
//! float: 3.14,
//! scientific: 1.5e10,
//! special_inf: inf,
//! special_neg_inf: -inf,
//! special_nan: nan,
//!
//! /* Strings (double or single quotes) */
//! string_double: "Hello, World!",
//! string_single: 'Hello, World!',
//! string_unicode: "Hello \u4E16\u754C", /* Unicode escapes */
//!
//! /* Binary data */
//! binary_hex: hex"48656c6c6f", /* Hex encoding */
//! binary_base64: b64"SGVsbG8gV29ybGQ=", /* Base64 encoding */
//!
//! /* Timestamps (RFC3339/ISO8601) */
//! timestamp: ts"2024-01-15T12:30:45Z",
//! timestamp_offset: ts"2024-01-15T12:30:45-05:00",
//!
//! /* Lists */
//! list: [1, 2, 3, "mixed", true, null],
//! nested_list: [[1, 2], [3, 4]],
//!
//! /* Maps (objects) */
//! map: {
//! unquoted_key: "value",
//! "quoted key": "also works",
//! nested: { a: 1, b: 2 },
//! },
//!
//! /* Trailing commas allowed */
//! trailing: [1, 2, 3,],
//! }
//! ```
//!
//! # Usage
//!
//! ## AST Manipulation (no serde required)
//!
//! ```
//! use jasn::{parse, format_pretty};
//!
//! let jasn_text = r#"{ name: "Alice", age: 30 }"#;
//! let value = parse(jasn_text).unwrap();
//! println!("{}", format_pretty(&value));
//!
//! // For custom formatting:
//! let opts = jasn::formatter::Options::pretty()
//! .with_indent("\t");
//! println!("{}", jasn::formatter::format_with_opts(&value, &opts));
//! ```
//!
//! ## Serde Integration (default feature)
//!
//! ```
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Serialize, Deserialize)]
//! struct Person {
//! name: String,
//! age: u32,
//! }
//!
//! let person = Person { name: "Alice".into(), age: 30 };
//! let jasn_text = jasn::to_string_pretty(&person).unwrap();
//! let parsed: Person = jasn::from_str(&jasn_text).unwrap();
//! ```
//!
//! # Features
//!
//! - `serde` (default): Enable serde serialization/deserialization support
//!
//! # Grammar
//!
//! For the complete grammar specification, see the [`grammar`] module.
//!
//! > **Note:** The specification is still under active development and may be subject to change.
// Re-export core types
pub use ;
pub use parse;
pub use ;
pub use ;
pub use ;
/// Complete grammar specification for JASN.
///