1use oak_core::{Language, LanguageCategory};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
6pub struct MsilLanguage {
7 pub extended_instructions: bool,
9 pub debug_info: bool,
11 pub strict_mode: bool,
13}
14
15impl MsilLanguage {
16 pub fn new() -> Self {
18 Self::default()
19 }
20
21 pub fn standard() -> Self {
23 Self { extended_instructions: false, debug_info: false, strict_mode: true }
24 }
25
26 pub fn extended() -> Self {
28 Self { extended_instructions: true, debug_info: true, strict_mode: false }
29 }
30}
31
32impl Default for MsilLanguage {
33 fn default() -> Self {
34 Self { extended_instructions: false, debug_info: false, strict_mode: false }
35 }
36}
37
38impl Language for MsilLanguage {
39 const NAME: &'static str = "msil";
40 const CATEGORY: LanguageCategory = LanguageCategory::Programming;
41
42 type TokenType = crate::kind::MsilSyntaxKind;
43 type ElementType = crate::kind::MsilSyntaxKind;
44 type TypedRoot = crate::ast::MsilRoot;
45}