Skip to main content

oak_wit_component/language/
mod.rs

1#![doc = include_str!("readme.md")]
2// use crate::{lexer::token_type::WitTokenType, parser::element_type::WitElementType};
3use oak_core::{Language, LanguageCategory};
4
5/// Language configuration for WIT (WebAssembly Interface Types) Component.
6///
7/// This struct implements the `Language` trait and provides the configuration
8/// for lexing and parsing WIT component definition files.
9#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10#[derive(Default, Debug, Clone, Copy)]
11pub struct WitLanguage {}
12
13impl Language for WitLanguage {
14    const NAME: &'static str = "wit-component";
15    const CATEGORY: LanguageCategory = LanguageCategory::Dsl;
16
17    type TokenType = crate::lexer::token_type::WitTokenType;
18    type ElementType = crate::parser::element_type::WitElementType;
19    type TypedRoot = crate::ast::WitRoot;
20}