Enum rslint_core::directives::Instruction [−][src]
pub enum Instruction {
RuleName,
Number,
CommandName(&'static str),
Literal(&'static str),
Optional(Vec<Instruction>),
Repetition(Box<Instruction>, SyntaxKind),
Either(Box<Instruction>, Box<Instruction>),
}
Expand description
Instruction
s are used to add directives to the parser.
Directives are parsed based off all registered instructions.
Example
To add an ignore
rule, you can add the following instructions:
ⓘ
vec![
CommandName("ignore"),
Repetition(RuleName, ","),
Optional(vec![
Literal("until"),
Either(Literal("eof"), Number)
])
]
Variants
CommandName(&'static str)
Tuple Fields of CommandName
0: &'static str
Literal(&'static str)
Tuple Fields of Literal
0: &'static str
Optional(Vec<Instruction>)
Tuple Fields of Optional
0: Vec<Instruction>
Repetition(Box<Instruction>, SyntaxKind)
Tuple Fields of Repetition
0: Box<Instruction>
1: SyntaxKind
Either(Box<Instruction>, Box<Instruction>)
Tuple Fields of Either
0: Box<Instruction>
1: Box<Instruction>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations
Mutably borrows from an owned value. Read more
Whether this implementor has acknowledged the 1.1.0 update to
unerase
’s documented implementation requirements. Read more