formatting
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use crate::ast::typed::{Type, TypedExpr};
|
use crate::ast::typed::{Type, TypedExpr};
|
||||||
use crate::ast::{BinOp, OpCommutative};
|
use crate::ast::{BinOp, OpCommutative};
|
||||||
@@ -48,7 +48,9 @@ pub fn bubble_binop_vars(expr: TypedExpr) -> TypedExpr {
|
|||||||
*rhs1,
|
*rhs1,
|
||||||
op1,
|
op1,
|
||||||
),
|
),
|
||||||
(lhs, rhs) if !lhs.is_const() && rhs.is_const() && op.swappable(&op) => (rhs, lhs, op),
|
(lhs, rhs) if !lhs.is_const() && rhs.is_const() && op.swappable(&op) => {
|
||||||
|
(rhs, lhs, op)
|
||||||
|
},
|
||||||
(lhs, rhs) if op.precedence() < lhs.precedence() && op.swappable(&op) => {
|
(lhs, rhs) if op.precedence() < lhs.precedence() && op.swappable(&op) => {
|
||||||
(rhs, lhs, op)
|
(rhs, lhs, op)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use super::{optimization, BinOp, UntypedExpr};
|
use super::{BinOp, UntypedExpr, optimization};
|
||||||
use crate::ast::optimization::OLevel;
|
use crate::ast::optimization::OLevel;
|
||||||
use crate::error;
|
use crate::error;
|
||||||
use crate::error::{SemanticError, SemanticErrorKind};
|
use crate::error::{SemanticError, SemanticErrorKind};
|
||||||
|
|||||||
Reference in New Issue
Block a user