Skip to main content

oak_nim/language/
mod.rs

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