lust/ast/
mod.rs

1pub mod expr;
2pub mod items;
3pub mod stmt;
4pub mod types;
5pub use expr::{BinaryOp, Expr, ExprKind, Literal, Pattern, StructLiteralField, UnaryOp};
6pub use items::{
7    EnumDef, EnumVariant, ExternItem, FieldOwnership, FunctionDef, FunctionParam, ImplBlock, Item,
8    ItemKind, StructDef, StructField, TraitBound, TraitDef, TraitMethod, UseTree, UseTreeItem,
9    Visibility,
10};
11pub use stmt::{LocalBinding, Stmt, StmtKind};
12pub use types::{Type, TypeKind};
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
14pub struct Span {
15    pub start_line: usize,
16    pub start_col: usize,
17    pub end_line: usize,
18    pub end_col: usize,
19}
20
21impl Span {
22    pub fn new(start_line: usize, start_col: usize, end_line: usize, end_col: usize) -> Self {
23        Self {
24            start_line,
25            start_col,
26            end_line,
27            end_col,
28        }
29    }
30
31    pub fn dummy() -> Self {
32        Self {
33            start_line: 0,
34            start_col: 0,
35            end_line: 0,
36            end_col: 0,
37        }
38    }
39}