ocelot-ast 0.1.2

Abstract syntax tree types for the ocelot project
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::item_kind::ItemKind;
use ocelot_base::span::Span;

/// Top-level source file item with an explicit source span.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Item {
    pub kind: ItemKind,
    pub span: Span,
}

impl Item {
    /// Creates an item from its kind and source span.
    pub fn new(kind: ItemKind, span: Span) -> Self {
        Self { kind, span }
    }
}