oak_regex/language/
mod.rs1use crate::ast::RegexRoot;
2use oak_core::{Language, LanguageCategory};
3use serde::{Deserialize, Serialize};
4
5#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
10pub struct RegexLanguage {
11 pub ignore_whitespace: bool,
13}
14
15impl RegexLanguage {
16 pub fn new() -> Self {
18 Self::default()
19 }
20}
21
22impl Default for RegexLanguage {
26 fn default() -> Self {
27 Self { ignore_whitespace: false }
28 }
29}
30
31impl Language for RegexLanguage {
36 const NAME: &'static str = "regex";
37 const CATEGORY: LanguageCategory = LanguageCategory::Dsl;
38
39 type TokenType = crate::kind::RegexSyntaxKind;
40 type ElementType = crate::kind::RegexSyntaxKind;
41 type TypedRoot = RegexRoot;
42}