31 lines
637 B
Rust
31 lines
637 B
Rust
use crate::ast::expression::Expression;
|
|
use crate::source_range::SourceRange;
|
|
|
|
pub struct SubtractExpression {
|
|
lhs: Box<Expression>,
|
|
rhs: Box<Expression>,
|
|
source_range: SourceRange,
|
|
}
|
|
|
|
impl SubtractExpression {
|
|
pub fn new(lhs: Expression, rhs: Expression, source_range: SourceRange) -> Self {
|
|
Self {
|
|
lhs: lhs.into(),
|
|
rhs: rhs.into(),
|
|
source_range,
|
|
}
|
|
}
|
|
|
|
pub fn lhs(&self) -> &Expression {
|
|
&self.lhs
|
|
}
|
|
|
|
pub fn rhs(&self) -> &Expression {
|
|
&self.rhs
|
|
}
|
|
|
|
pub fn source_range(&self) -> &SourceRange {
|
|
&self.source_range
|
|
}
|
|
}
|