summaryrefslogtreecommitdiff
path: root/src/syntax/mod.rs
blob: f4472df55e81415f5f31a2b30d31bf4ca37a4ca0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Syntax types.

mod expr;
mod ident;
mod lit;
mod span;
mod token;
mod tree;

/// Abstract syntax tree definition.
pub mod ast {
    use super::*;
    pub use expr::*;
    pub use lit::*;
    pub use tree::*;
}

pub use ast::*;
pub use ident::*;
pub use span::*;
pub use token::*;

/// Decorations for semantic syntax highlighting.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
#[cfg_attr(feature = "serialize", serde(rename_all = "camelCase"))]
pub enum Decoration {
    /// Text in italics.
    Italic,
    /// Text in bold.
    Bold,
    /// A valid, successfully resolved name.
    Resolved,
    /// An invalid, unresolved name.
    Unresolved,
    /// A key in a dictionary.
    DictKey,
}