Skip to main content

oak_python/language/
mod.rs

1#![doc = include_str!("readme.md")]
2use oak_core::{Language, LanguageCategory};
3
4/// Python language definition.
5#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
7pub struct PythonLanguage {}
8
9impl PythonLanguage {
10    /// Creates a new Python language configuration.
11    pub fn new() -> Self {
12        Self {}
13    }
14}
15
16impl Language for PythonLanguage {
17    const NAME: &'static str = "python";
18    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
19
20    type TokenType = crate::lexer::token_type::PythonTokenType;
21    type ElementType = crate::parser::PythonElementType;
22    type TypedRoot = crate::ast::PythonRoot;
23}