oak_ada/language/
mod.rs

1#[doc = include_str!("../readme.md")]
2use crate::{ast::AdaRoot, lexer::AdaTokenType, parser::AdaElementType};
3use oak_core::{Language, LanguageCategory};
4use serde::{Deserialize, Serialize};
5
6/// Ada 语言配置和元数据。
7#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
8pub struct AdaLanguage {
9    /// 是否启用 Ada 2022 特性
10    pub allow_ada_2022: bool,
11    /// 是否启用严格模式
12    pub strict_mode: bool,
13}
14
15impl Default for AdaLanguage {
16    fn default() -> Self {
17        Self { allow_ada_2022: true, strict_mode: false }
18    }
19}
20
21impl Language for AdaLanguage {
22    const NAME: &'static str = "ada";
23    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
24
25    type TokenType = AdaTokenType;
26    type ElementType = AdaElementType;
27    type TypedRoot = AdaRoot;
28}