microcad_syntax/ast/
mod.rs1mod expression;
5mod literal;
6mod statement;
7mod ty;
8
9use crate::Span;
10use compact_str::CompactString;
11
12pub use expression::*;
13pub use literal::*;
14pub use statement::*;
15pub use ty::*;
16
17#[derive(Debug, PartialEq, Hash, Eq)]
19#[allow(missing_docs)]
20pub struct Identifier {
21 pub span: Span,
22 pub name: CompactString,
23}
24
25impl Identifier {
26 pub(crate) fn dummy(span: Span) -> Self {
27 Identifier {
28 span,
29 name: CompactString::default(),
30 }
31 }
32}
33
34#[derive(Debug)]
36#[allow(missing_docs)]
37pub struct SourceFile {
38 pub span: Span,
39 pub statements: StatementList,
40}
41
42#[derive(Debug, PartialEq, Default)]
44#[allow(missing_docs)]
45pub struct ItemExtras {
46 pub leading: Vec<ItemExtra>,
47 pub trailing: Vec<ItemExtra>,
48}
49
50#[derive(Debug, PartialEq)]
51#[allow(missing_docs)]
52#[non_exhaustive]
53pub enum ItemExtra {
54 Comment(Comment),
55}