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