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
//! Source mapping for Quarto
//!
//! This crate provides unified source location tracking with support for
//! transformations (extraction, concatenation, normalization). It enables
//! precise error reporting and mapping positions back through transformation
//! chains to original source files.
//!
//! # Overview
//!
//! The core types are:
//! - [`SourceInfo`]: Enum tracking a location and its transformation history
//! - [`SourceContext`]: Manages files and provides content for mapping
//! - [`MappedLocation`]: Result of mapping through transformation chains
//!
//! # Example
//!
//! ```rust
//! use quarto_source_map::*;
//!
//! // Create a context and register a file
//! let mut ctx = SourceContext::new();
//! let file_id = ctx.add_file("main.qmd".into(), Some("# Hello\nWorld".into()));
//!
//! // Create a source location (stores only offsets)
//! let info = SourceInfo::original(file_id, 0, 7);
//!
//! // Map to get row/column information
//! let mapped = info.map_offset(0, &ctx).unwrap();
//! assert_eq!(mapped.location.row, 0);
//! assert_eq!(mapped.location.column, 0);
//! ```
// Re-export main types
pub use ;
pub use FileInformation;
pub use MappedLocation;
pub use ;
pub use ;
pub use ;