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    NilTest,
19    NewlineEscape,
20    Index,
21}
22
23impl Spelling {
24    pub const ALL: &'static [Spelling] = &[
25        Spelling::LogicalSymbol,
26        Spelling::Unless,
27        Spelling::ElseIf,
28        Spelling::CallForm,
29        Spelling::KeywordRocket,
30        Spelling::ParameterList,
31        Spelling::OperatorSpelling,
32        Spelling::TrailingComma,
33        Spelling::NegatedComparison,
34        Spelling::ElseNil,
35        Spelling::TryCatch,
36        Spelling::Apply,
37        Spelling::MapPun,
38        Spelling::NilTest,
39        Spelling::NewlineEscape,
40        Spelling::Index,
41    ];
42}
43
44#[derive(Clone, Debug, PartialEq, Eq)]
45pub struct Note {
46    pub spelling: Spelling,
47    pub span: Span,
48    pub written: String,
49    pub canonical: String,
50}