oak_jasm/language/
mod.rs

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