Skip to main content

blue_lang_syntax/
spelling.rs

1use crate::lex::Span;
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
4pub enum Spelling {
5    LogicalSymbol,
6    Unless,
7    ElseIf,
8    CallForm,
9    KeywordRocket,
10    ParameterList,
11    OperatorSpelling,
12    TrailingComma,
13    NegatedComparison,
14    ElseNil,
15    TryCatch,
16    Apply,
17    MapPun,
18}
19
20impl Spelling {
21    pub const ALL: &'static [Spelling] = &[
22        Spelling::LogicalSymbol,
23        Spelling::Unless,
24        Spelling::ElseIf,
25        Spelling::CallForm,
26        Spelling::KeywordRocket,
27        Spelling::ParameterList,
28        Spelling::OperatorSpelling,
29        Spelling::TrailingComma,
30        Spelling::NegatedComparison,
31        Spelling::ElseNil,
32        Spelling::TryCatch,
33        Spelling::Apply,
34        Spelling::MapPun,
35    ];
36}
37
38#[derive(Clone, Debug, PartialEq, Eq)]
39pub struct Note {
40    pub spelling: Spelling,
41    pub span: Span,
42    pub written: String,
43    pub canonical: String,
44}