Move Int and Float modules into Num

This commit is contained in:
Richard Feldman 2020-06-22 21:58:42 -04:00
parent d041355c1d
commit 88990c8711
26 changed files with 543 additions and 547 deletions

View file

@ -300,7 +300,7 @@ fn desugar_field<'a>(
}
}
// TODO move this desugaring to canonicalization, to avoid dealing with strings as much
// TODO move this desugaring to canonicalization, so we can use Symbols instead of strings
#[inline(always)]
fn binop_to_function(binop: BinOp) -> (&'static str, &'static str) {
use self::BinOp::*;
@ -308,8 +308,8 @@ fn binop_to_function(binop: BinOp) -> (&'static str, &'static str) {
match binop {
Caret => (ModuleName::NUM, "pow"),
Star => (ModuleName::NUM, "mul"),
Slash => (ModuleName::FLOAT, "div"),
DoubleSlash => (ModuleName::INT, "div"),
Slash => (ModuleName::NUM, "div"),
DoubleSlash => (ModuleName::NUM, "divFloor"),
Percent => (ModuleName::NUM, "rem"),
DoublePercent => (ModuleName::NUM, "mod"),
Plus => (ModuleName::NUM, "add"),