1#![doc = include_str!("readme.md")]
2use oak_core::language::{Language, LanguageCategory};
3#[cfg(feature = "serde")]
4use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
8#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9pub struct JasmLanguage {
10 pub extended: bool,
12 pub comments: bool,
14}
15
16impl JasmLanguage {
17 pub fn new() -> Self {
19 Self::default()
20 }
21
22 pub fn standard() -> Self {
24 Self { extended: true, comments: true }
25 }
26
27 pub fn minimal() -> Self {
29 Self { extended: false, comments: false }
30 }
31}
32
33impl Language for JasmLanguage {
34 const NAME: &'static str = "jasm";
35 const CATEGORY: LanguageCategory = LanguageCategory::Programming;
36
37 type TokenType = crate::lexer::token_type::JasmTokenType;
38 type ElementType = crate::parser::element_type::JasmElementType;
39 type TypedRoot = crate::ast::JasmRoot;
40}