Skip to main content

oak_jasmin/language/
mod.rs

1use oak_core::{Language, LanguageCategory};
2
3/// JASMIN 语言绑定与配置
4#[derive(Debug, Default, Copy, Clone)]
5pub struct JasminLanguage {
6    /// 是否启用扩展指令(如 invokedynamic 等)
7    pub extended: bool,
8    /// 是否允许注释
9    pub comments: bool,
10}
11
12impl JasminLanguage {
13    pub fn new() -> Self {
14        Self::default()
15    }
16
17    pub fn standard() -> Self {
18        Self { extended: true, comments: true }
19    }
20
21    pub fn minimal() -> Self {
22        Self { extended: false, comments: false }
23    }
24}
25
26impl Language for JasminLanguage {
27    const NAME: &'static str = "jasmin";
28    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
29
30    type TokenType = crate::kind::JasminSyntaxKind;
31    type ElementType = crate::kind::JasminSyntaxKind;
32    type TypedRoot = crate::ast::JasminRoot;
33}