Skip to main content

oak_lean/ast/
mod.rs

1#![doc = include_str!("readme.md")]
2use core::range::Range;
3
4/// Lean root node.
5#[derive(Debug, Clone, PartialEq)]
6#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7pub struct LeanRoot {
8    /// The byte range of the root node in the source text.
9    #[cfg_attr(feature = "serde", serde(with = "oak_core::serde_range"))]
10    pub range: Range<usize>,
11}
12
13impl LeanRoot {
14    /// Creates a new Lean root node with the given byte range.
15    pub fn new(range: Range<usize>) -> Self {
16        Self { range }
17    }
18}