oak_vampire/language/
mod.rs1use oak_core::Language;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4pub struct CommentConfig {
5 pub line_comment: Option<String>,
6 pub block_comment: Option<(String, String)>,
7}
8
9#[derive(Debug, Clone, PartialEq, Eq)]
10pub struct StringConfig {
11 pub quotes: Vec<char>,
12 pub escape_char: Option<char>,
13}
14
15#[derive(Debug, Clone, PartialEq, Eq)]
16pub struct WhitespaceConfig {
17 pub characters: Vec<char>,
18 pub new_line_characters: Vec<char>,
19}
20
21pub struct VampireLanguage {
22 pub comment_config: CommentConfig,
23 pub string_config: StringConfig,
24 pub whitespace_config: WhitespaceConfig,
25}
26
27impl Default for VampireLanguage {
28 fn default() -> Self {
29 Self {
30 comment_config: CommentConfig {
31 line_comment: Some("%".to_string()),
32 block_comment: Some(("/*".to_string(), "*/".to_string())),
33 },
34 string_config: StringConfig { quotes: vec!['"', '\''], escape_char: Some('\\') },
35 whitespace_config: WhitespaceConfig { characters: vec![' ', '\t'], new_line_characters: vec!['\n', '\r'] },
36 }
37 }
38}
39
40impl Language for VampireLanguage {
41 type SyntaxKind = crate::kind::VampireSyntaxKind;
42 type TypedRoot = ();
43}