oak_actionscript/language/
mod.rs

1use crate::{ast::ActionScriptRoot, lexer::ActionScriptTokenType, parser::ActionScriptElementType};
2use oak_core::{Language, LanguageCategory};
3use serde::{Deserialize, Serialize};
4
5/// ActionScript 语言配置和元数据。
6#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
7pub struct ActionScriptLanguage {
8    /// Enable strict mode
9    pub strict_mode: bool,
10    /// Enable AS3 specific features
11    pub as3_features: bool,
12}
13
14impl Default for ActionScriptLanguage {
15    fn default() -> Self {
16        Self { strict_mode: true, as3_features: true }
17    }
18}
19
20impl Language for ActionScriptLanguage {
21    const NAME: &'static str = "actionscript";
22    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
23
24    type TokenType = ActionScriptTokenType;
25    type ElementType = ActionScriptElementType;
26    type TypedRoot = ActionScriptRoot;
27}