Skip to main content

oak_dhall/language/
mod.rs

1use crate::ast::DHallRoot;
2use oak_core::{Language, LanguageCategory};
3use serde::{Deserialize, Serialize};
4
5#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
6pub struct DHallLanguage {
7    /// Allow unicode identifiers
8    pub unicode_identifiers: bool,
9}
10
11impl DHallLanguage {
12    pub fn new() -> Self {
13        Self::default()
14    }
15}
16
17impl Default for DHallLanguage {
18    fn default() -> Self {
19        Self { unicode_identifiers: true }
20    }
21}
22
23impl Language for DHallLanguage {
24    const NAME: &'static str = "dhall";
25    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
26
27    type TokenType = crate::kind::DHallSyntaxKind;
28    type ElementType = crate::kind::DHallSyntaxKind;
29    type TypedRoot = DHallRoot;
30}