Skip to main content

oak_hlsl/language/
mod.rs

1use oak_core::{Language, LanguageCategory};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
5pub struct HlslLanguage {
6    pub allow_comment: bool,
7}
8
9impl HlslLanguage {
10    pub fn new() -> Self {
11        Self::default()
12    }
13}
14
15impl Language for HlslLanguage {
16    const NAME: &'static str = "hlsl";
17    const CATEGORY: LanguageCategory = LanguageCategory::Programming;
18
19    type TokenType = crate::kind::HlslSyntaxKind;
20    type ElementType = crate::kind::HlslSyntaxKind;
21    type TypedRoot = crate::ast::HlslRoot;
22}
23
24impl Default for HlslLanguage {
25    fn default() -> Self {
26        Self { allow_comment: true }
27    }
28}