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
//! BarkML - A declarative configuration language
//!
//! BarkML is a declarative configuration format inspired by TOML, HCL, and other configuration languages.
//! It was created initially to be used with operational tools and generative tooling. The language
//! defaults to UTF-8 parsing and supports self-referential macro replacements.
//!
//! # Features
//!
//! - Declarative configuration syntax
//! - Self-referential macro replacements
//! - UTF-8 support by default
//! - Type-safe value handling
//! - Comprehensive error reporting
//!
//! # Examples
//!
//! ```rust
//! use barkml::from_str;
//!
//! let config = r#"
//! versioning = "1.0.0"
//! [database]
//! host = "localhost"
//! port = 5432
//! "#;
//!
//! let statement = from_str(config).expect("Failed to parse BarkML");
//! ```
// Standard library imports
use Cursor;
// Local crate modules
// Serde deserialization support
// Serde serialization support
// Re-exports
pub use *;
pub use Error;
pub use *;
pub use *;
/// Result type alias for BarkML operations
pub type Result<T> = Result;
/// Parses a BarkML string and returns the root statement.
///
/// This is the primary entry point for parsing BarkML content from a string.
/// The function creates a temporary cursor over the input bytes and uses the
/// standard loader to parse the content.
///
/// # Arguments
///
/// * `input` - A string slice containing the BarkML content to parse
///
/// # Returns
///
/// Returns a `Result<Statement>` containing the parsed root statement on success,
/// or an error if parsing fails.
///
/// # Examples
///
/// ```rust
/// use barkml::from_str;
///
/// let config = r#"
/// versioning = "1.0.0"
/// [database]
/// host = "localhost"
/// port = 5432
/// "#;
///
/// let statement = from_str(config).expect("Failed to parse BarkML");
/// ```
///
/// # Errors
///
/// This function will return an error if:
/// - The input contains invalid BarkML syntax
/// - There are type mismatches in the configuration
/// - Macro resolution fails
/// - The parser encounters unexpected tokens