Skip to main content

oak_smalltalk/language/
mod.rs

1use crate::{ast::SmalltalkRoot, lexer::SmalltalkTokenType, parser::SmalltalkElementType};
2use oak_core::{Language, LanguageCategory};
3
4/// Smalltalk language configuration and metadata.
5#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
6#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7pub struct SmalltalkLanguage {
8    /// Whether strict mode is enabled
9    pub strict_mode: bool,
10}
11
12impl SmalltalkLanguage {
13    /// Creates a new Smalltalk language configuration
14    pub fn new() -> Self {
15        Self { strict_mode: false }
16    }
17}
18
19impl Default for SmalltalkLanguage {
20    fn default() -> Self {
21        Self::new()
22    }
23}
24
25impl Language for SmalltalkLanguage {
26    const NAME: &'static str = "smalltalk";
27    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
28
29    type TokenType = SmalltalkTokenType;
30    type ElementType = SmalltalkElementType;
31    type TypedRoot = SmalltalkRoot;
32}