1pub trait Dialect: std::fmt::Debug {
3 fn is_identifier_start(&self, ch: char) -> bool;
5
6 fn is_identifier_part(&self, ch: char) -> bool;
8
9 fn name(&self) -> &'static str;
11}
12
13#[derive(Debug, Default, Clone)]
15pub struct AlopexDialect;
16
17impl Dialect for AlopexDialect {
18 fn is_identifier_start(&self, ch: char) -> bool {
19 ch == '_' || ch.is_ascii_alphabetic()
20 }
21
22 fn is_identifier_part(&self, ch: char) -> bool {
23 ch == '_' || ch.is_ascii_alphanumeric()
24 }
25
26 fn name(&self) -> &'static str {
27 "alopex"
28 }
29}