From efb2fd3234a0d21214c417217a5ec17057c18a6b Mon Sep 17 00:00:00 2001 From: alexion Date: Sat, 19 Sep 2026 10:23:09 -0400 Subject: [PATCH] style(xatu): order AST declarations by use --- src/xatu/ast.rs | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/xatu/ast.rs b/src/xatu/ast.rs index 15df59d..41472b1 100644 --- a/src/xatu/ast.rs +++ b/src/xatu/ast.rs @@ -1,5 +1,30 @@ use crate::FileId; +#[derive(Debug)] +pub struct ParsedFile { + pub file_id: FileId, + pub nodes: Vec, + pub errors: Vec, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Node { + pub range: SourceRange, + pub data: NodeData, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct SourceRange { + pub start: usize, + pub end: usize, +} + +impl std::fmt::Display for SourceRange { + fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "{}..{}", self.start, self.end) + } +} + #[derive(Debug, Clone, PartialEq, Eq)] pub enum NodeData { Apply(Apply), @@ -33,33 +58,8 @@ pub struct Inherit { pub attr_count: usize, } -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct Node { - pub range: SourceRange, - pub data: NodeData, -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct SourceRange { - pub start: usize, - pub end: usize, -} - -impl std::fmt::Display for SourceRange { - fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "{}..{}", self.start, self.end) - } -} - #[derive(Debug, Clone, PartialEq, Eq)] pub struct ParseError { pub range: SourceRange, pub message: String, } - -#[derive(Debug)] -pub struct ParsedFile { - pub file_id: FileId, - pub nodes: Vec, - pub errors: Vec, -}