oxc/crates/oxc_codegen/src/operator.rs
DonIsaac ab187d1e22 refactor(codegen): restrict visibility of internal methods (#6145)
add `pub(crate)` to `Codegen` methods that should only be used within `oxc_codegen`
2024-09-28 14:33:42 +00:00

26 lines
586 B
Rust

use oxc_syntax::operator::{BinaryOperator, UnaryOperator, UpdateOperator};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(crate) enum Operator {
Binary(BinaryOperator),
Unary(UnaryOperator),
Update(UpdateOperator),
}
impl From<BinaryOperator> for Operator {
fn from(op: BinaryOperator) -> Self {
Self::Binary(op)
}
}
impl From<UnaryOperator> for Operator {
fn from(op: UnaryOperator) -> Self {
Self::Unary(op)
}
}
impl From<UpdateOperator> for Operator {
fn from(op: UpdateOperator) -> Self {
Self::Update(op)
}
}