#[derive(Debug, Clone, PartialEq)] pub enum Composite { SelectionFunction { func: BuiltinSelectionFn, search_mod: Option, result_transform: Option, }, TextFunction { func: BuiltinTextFn, swapped: bool, }, Hook { kind: HookKind, left: Box, right: Box, }, Train2 { f: Box, g: Box, }, Train3 { f: Box, g: Box, h: Box, }, } #[derive(Debug, Clone, PartialEq)] pub enum TextFn { Function { func: BuiltinTextFn, swapped: bool, }, Hook { kind: HookKind, left: Box, right: Box, }, Train2 { f: Box, g: Box, }, Train3 { f: Box, g: Box, h: Box, }, } #[derive(Debug, Clone, PartialEq)] pub enum BuiltinSelectionFn { Empty, // e EndOfBuffer, // $ Span, // - CharOffset(usize), // # (expects number arg) Line(usize), // (expects number arg) Regex(String), // /re/ (expects regex arg) AllMatches(String), // x (expects /re/ arg) RelativeLine(usize), // + (expects number arg) BufferMatch(String), // B (expects /re/ arg) } #[derive(Debug, Clone, PartialEq)] pub enum BuiltinTextFn { Dot, // . Change, // c Insert, // i Append, // a Delete, // d Write, // w Pipe, // | Literal(String), // "..." } #[derive(Debug, Clone, Copy, PartialEq)] pub enum SearchModifier { Reverse, // ' Sequential, // ; ReverseSequential, // '; SequentialReverse, // ;' } #[derive(Debug, Clone, Copy, PartialEq)] pub enum ResultTransform { Complement, // ~ Conditional, // ? ComplementConditional, // ~? ConditionalComplement, // ?~ } #[derive(Debug, Clone, Copy, PartialEq)] pub enum HookKind { Before, // F>G (left hook) After, // F