Skip to main content

oxilean_parse/ast/
astnodekind_traits.rs

1//! # AstNodeKind - Trait Implementations
2//!
3//! This module contains trait implementations for `AstNodeKind`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::AstNodeKind;
12
13impl std::fmt::Display for AstNodeKind {
14    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15        let s = match self {
16            AstNodeKind::Var => "var",
17            AstNodeKind::Lam => "lam",
18            AstNodeKind::Pi => "pi",
19            AstNodeKind::App => "app",
20            AstNodeKind::Let => "let",
21            AstNodeKind::NatLit => "nat-lit",
22            AstNodeKind::StrLit => "str-lit",
23            AstNodeKind::Sort => "sort",
24            AstNodeKind::Hole => "hole",
25            AstNodeKind::DefDecl => "def",
26            AstNodeKind::TheoremDecl => "theorem",
27            AstNodeKind::AxiomDecl => "axiom",
28        };
29        write!(f, "{}", s)
30    }
31}