Struct cldr_pluralrules_parser::ast::Relation
source · pub struct Relation {
pub expression: Expression,
pub operator: Operator,
pub range_list: RangeList,
}
Expand description
An incomplete AST representation of a plural rule. Comprises an Expression, an Operator, and a RangeList.
Examples
All AST nodes can be built explicitly, as seen in the example. However, due to its complexity, it is preferred to build the AST using the parse_plural_rule function.
"i = 3"
Can be represented by the AST:
use cldr_pluralrules_parser::ast::*;
Relation {
expression: Expression {
operand: Operand('i'),
modulus: None,
},
operator: Operator::Is,
range_list: RangeList(vec![RangeListItem::Value(Value(3))]),
};
Fields
expression: Expression
operator: Operator
range_list: RangeList
Trait Implementations
impl StructuralPartialEq for Relation
Auto Trait Implementations
impl RefUnwindSafe for Relation
impl Send for Relation
impl Sync for Relation
impl Unpin for Relation
impl UnwindSafe for Relation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more