@@ -580,7 +580,7 @@ fn pass_expr(expr: &mut Expr, symbol_table: &Rc<RefCell<SymbolTable>>, errors: &
580580 }
581581 // Make sure the types match
582582 for ( i, a) in args. iter_mut ( ) . enumerate ( ) {
583- * a = Box :: new ( force_cast ( * a. clone ( ) , fe. signature . args [ i] . clone ( ) , symbol_table, errors) ) ;
583+ * * a = force_cast ( * a. clone ( ) , fe. signature . args [ i] . clone ( ) , symbol_table, errors) ;
584584 }
585585
586586 // It does; return the return type
@@ -608,7 +608,7 @@ fn pass_expr(expr: &mut Expr, symbol_table: &Rc<RefCell<SymbolTable>>, errors: &
608608 // Insert a cast in the value if necessary
609609 if & expr_type != elem_type {
610610 let range: TextRange = v. range ( ) . clone ( ) ;
611- * v = Box :: new ( Expr :: new_cast ( v. clone ( ) , elem_type. clone ( ) , range) ) ;
611+ * * v = Expr :: new_cast ( v. clone ( ) , elem_type. clone ( ) , range) ;
612612 }
613613 } else {
614614 elem_type = Some ( ( expr_type, v. range ( ) . clone ( ) ) ) ;
@@ -634,7 +634,7 @@ fn pass_expr(expr: &mut Expr, symbol_table: &Rc<RefCell<SymbolTable>>, errors: &
634634 * data_type = elem_type. clone ( ) ;
635635
636636 // Make sure the index is a number
637- * index = Box :: new ( force_cast ( ( * * index) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
637+ * * index = force_cast ( ( * * index) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
638638
639639 // Return the element type as evaluated type
640640 elem_type
@@ -649,14 +649,14 @@ fn pass_expr(expr: &mut Expr, symbol_table: &Rc<RefCell<SymbolTable>>, errors: &
649649 match op {
650650 brane_dsl:: ast:: UnaOp :: Not { .. } => {
651651 // Expect boolean, return boolean
652- * expr = Box :: new ( force_cast ( ( * * expr) . clone ( ) , DataType :: Boolean , symbol_table, errors) ) ;
652+ * * expr = force_cast ( ( * * expr) . clone ( ) , DataType :: Boolean , symbol_table, errors) ;
653653 DataType :: Boolean
654654 } ,
655655 brane_dsl:: ast:: UnaOp :: Neg { .. } => {
656656 // Expect integer or real, return the same thing
657657 let mut expr_type: DataType = pass_expr ( expr, symbol_table, errors) ;
658658 if expr_type != DataType :: Integer && expr_type != DataType :: Real {
659- * expr = Box :: new ( force_cast ( ( * * expr) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
659+ * * expr = force_cast ( ( * * expr) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
660660 expr_type = DataType :: Integer ;
661661 }
662662 expr_type
@@ -677,8 +677,8 @@ fn pass_expr(expr: &mut Expr, symbol_table: &Rc<RefCell<SymbolTable>>, errors: &
677677 match op {
678678 brane_dsl:: ast:: BinOp :: And { .. } | brane_dsl:: ast:: BinOp :: Or { .. } => {
679679 // Expect boolean, return boolean
680- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: Boolean , symbol_table, errors) ) ;
681- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: Boolean , symbol_table, errors) ) ;
680+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: Boolean , symbol_table, errors) ;
681+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: Boolean , symbol_table, errors) ;
682682 DataType :: Boolean
683683 } ,
684684
@@ -693,26 +693,26 @@ fn pass_expr(expr: &mut Expr, symbol_table: &Rc<RefCell<SymbolTable>>, errors: &
693693 // If the types are (runtime) strings, then treat as such
694694 if ( lhs_type == DataType :: String || lhs_type == DataType :: Any ) && ( rhs_type == DataType :: String || rhs_type == DataType :: Any )
695695 {
696- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: String , symbol_table, errors) ) ;
697- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: String , symbol_table, errors) ) ;
696+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: String , symbol_table, errors) ;
697+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: String , symbol_table, errors) ;
698698 lhs_type = DataType :: String ;
699699 } else {
700700 // Now either has to be an integer or a real, or casteable to one
701701 if lhs_type != DataType :: Integer && lhs_type != DataType :: Real {
702- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
702+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
703703 lhs_type = DataType :: Integer ;
704704 }
705705 if rhs_type != DataType :: Integer && rhs_type != DataType :: Real {
706- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
706+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
707707 rhs_type = DataType :: Integer ;
708708 }
709709
710710 // Finally, if either is real and the other not, promote it
711711 if lhs_type == DataType :: Real && rhs_type != DataType :: Real {
712- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: Real , symbol_table, errors) ) ;
712+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: Real , symbol_table, errors) ;
713713 }
714714 if lhs_type != DataType :: Real && rhs_type == DataType :: Real {
715- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: Real , symbol_table, errors) ) ;
715+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: Real , symbol_table, errors) ;
716716 }
717717 }
718718 }
@@ -727,29 +727,29 @@ fn pass_expr(expr: &mut Expr, symbol_table: &Rc<RefCell<SymbolTable>>, errors: &
727727
728728 // Now either has to be an integer or a real, or casteable to one
729729 if lhs_type != DataType :: Integer && lhs_type != DataType :: Real {
730- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
730+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
731731 lhs_type = DataType :: Integer ;
732732 }
733733 if rhs_type != DataType :: Integer && rhs_type != DataType :: Real {
734- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
734+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
735735 rhs_type = DataType :: Integer ;
736736 }
737737
738738 // Finally, if either is real and the other not, promote it
739739 if lhs_type == DataType :: Real && rhs_type != DataType :: Real {
740- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: Real , symbol_table, errors) ) ;
740+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: Real , symbol_table, errors) ;
741741 }
742742 if lhs_type != DataType :: Real && rhs_type == DataType :: Real {
743- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: Real , symbol_table, errors) ) ;
743+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: Real , symbol_table, errors) ;
744744 }
745745
746746 // Return the type of the lhs (which is now the same as rhs)
747747 lhs_type
748748 } ,
749749 brane_dsl:: ast:: BinOp :: Mod { .. } => {
750750 // Expect two integers
751- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
752- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
751+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
752+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
753753 DataType :: Integer
754754 } ,
755755
@@ -771,20 +771,20 @@ fn pass_expr(expr: &mut Expr, symbol_table: &Rc<RefCell<SymbolTable>>, errors: &
771771
772772 // Now either has to be an integer or a real, or casteable to one
773773 if lhs_type != DataType :: Integer && lhs_type != DataType :: Real {
774- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
774+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
775775 lhs_type = DataType :: Integer ;
776776 }
777777 if rhs_type != DataType :: Integer && rhs_type != DataType :: Real {
778- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ) ;
778+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: Integer , symbol_table, errors) ;
779779 rhs_type = DataType :: Integer ;
780780 }
781781
782782 // Finally, if either is real and the other not, promote it
783783 if lhs_type == DataType :: Real && rhs_type != DataType :: Real {
784- * rhs = Box :: new ( force_cast ( ( * * rhs) . clone ( ) , DataType :: Real , symbol_table, errors) ) ;
784+ * * rhs = force_cast ( ( * * rhs) . clone ( ) , DataType :: Real , symbol_table, errors) ;
785785 }
786786 if lhs_type != DataType :: Real && rhs_type == DataType :: Real {
787- * lhs = Box :: new ( force_cast ( ( * * lhs) . clone ( ) , DataType :: Real , symbol_table, errors) ) ;
787+ * * lhs = force_cast ( ( * * lhs) . clone ( ) , DataType :: Real , symbol_table, errors) ;
788788 }
789789
790790 // Now return a boolean
0 commit comments