pub enum Rule {
Show 18 variants
Literal(Literal),
CharClass(CharClass),
Group(Group),
Alternation(Alternation),
Intersection(Intersection),
Repetition(Box<Repetition>),
Boundary(Boundary),
Lookaround(Box<Lookaround>),
Variable(Variable),
Reference(Reference),
Range(Range),
StmtExpr(Box<StmtExpr>),
Negation(Box<Negation>),
Regex(Regex),
Recursion(Recursion),
Grapheme,
Codepoint,
Dot,
}Expand description
A parsed pomsky expression, which might contain more sub-expressions.
Variants§
Literal(Literal)
A string literal
CharClass(CharClass)
A character class
Group(Group)
A group, i.e. a sequence of rules, possibly wrapped in parentheses.
Alternation(Alternation)
An alternation, i.e. a list of alternatives; at least one of them has to match.
Intersection(Intersection)
An intersection, i.e. a list of rules that all have to match at the same time.
Repetition(Box<Repetition>)
A repetition, i.e. a expression that must be repeated. The number of required repetitions is constrained by a lower and possibly an upper bound.
Boundary(Boundary)
A boundary (start of string, end of string or word boundary).
Lookaround(Box<Lookaround>)
A (positive or negative) lookahead or lookbehind.
Variable(Variable)
An variable that has been declared before.
Reference(Reference)
A backreference or forward reference.
Range(Range)
A range of integers
StmtExpr(Box<StmtExpr>)
An expression preceded by a modifier such as enable lazy;
Negation(Box<Negation>)
Negated expression
Regex(Regex)
A regex string, which is not escaped
Recursion(Recursion)
A regex string, which is not escaped
Grapheme
A Unicode grapheme
Codepoint
A Unicode code point
Dot
The dot