Skip to main content

oak_python/language/
mod.rs

1use oak_core::{Language, LanguageCategory};
2use serde::{Deserialize, Serialize};
3
4/// Python 语言定义
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
6pub struct PythonLanguage {}
7
8impl PythonLanguage {
9    /// 创建新的 Python 语言配置
10    pub fn new() -> Self {
11        Self {}
12    }
13}
14
15impl Language for PythonLanguage {
16    const NAME: &'static str = "python";
17    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
18
19    type TokenType = crate::kind::PythonSyntaxKind;
20    type ElementType = crate::kind::PythonSyntaxKind;
21    type TypedRoot = crate::ast::PythonRoot;
22}