Rename Category::Float to Category::Frac

This commit is contained in:
Richard Feldman 2022-07-19 20:04:51 -04:00
parent e389b23e4b
commit 3972664e48
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
6 changed files with 10 additions and 10 deletions

View file

@ -126,7 +126,7 @@ pub fn constrain_expr<'a>(
region, region,
)); ));
and_constraints.push(Eq(num_type, expected, Category::Float, region)); and_constraints.push(Eq(num_type, expected, Category::Frac, region));
let defs_constraint = And(and_constraints); let defs_constraint = And(and_constraints);

View file

@ -66,7 +66,7 @@ impl Constraints {
Category::StrInterpolation, Category::StrInterpolation,
Category::If, Category::If,
Category::When, Category::When,
Category::Float, Category::Frac,
Category::Int, Category::Int,
Category::Num, Category::Num,
Category::List, Category::List,
@ -199,7 +199,7 @@ impl Constraints {
Category::StrInterpolation => Self::CATEGORY_STRINTERPOLATION, Category::StrInterpolation => Self::CATEGORY_STRINTERPOLATION,
Category::If => Self::CATEGORY_IF, Category::If => Self::CATEGORY_IF,
Category::When => Self::CATEGORY_WHEN, Category::When => Self::CATEGORY_WHEN,
Category::Float => Self::CATEGORY_FLOAT, Category::Frac => Self::CATEGORY_FLOAT,
Category::Int => Self::CATEGORY_INT, Category::Int => Self::CATEGORY_INT,
Category::Num => Self::CATEGORY_NUM, Category::Num => Self::CATEGORY_NUM,
Category::List => Self::CATEGORY_LIST, Category::List => Self::CATEGORY_LIST,

View file

@ -243,7 +243,7 @@ impl Expr {
match self { match self {
Self::Num(..) => Category::Num, Self::Num(..) => Category::Num,
Self::Int(..) => Category::Int, Self::Int(..) => Category::Int,
Self::Float(..) => Category::Float, Self::Float(..) => Category::Frac,
Self::Str(..) => Category::Str, Self::Str(..) => Category::Str,
Self::SingleQuote(..) => Category::Character, Self::SingleQuote(..) => Category::Character,
Self::List { .. } => Category::List, Self::List { .. } => Category::List,

View file

@ -118,17 +118,17 @@ pub fn float_literal(
precision_var, precision_var,
bound, bound,
region, region,
Category::Float, Category::Frac,
); );
constrs.extend([ constrs.extend([
constraints.equal_types( constraints.equal_types(
num_type.clone(), num_type.clone(),
ForReason(reason, num_float(Type::Variable(precision_var)), region), ForReason(reason, num_float(Type::Variable(precision_var)), region),
Category::Float, Category::Frac,
region, region,
), ),
constraints.equal_types(num_type, expected, Category::Float, region), constraints.equal_types(num_type, expected, Category::Frac, region),
]); ]);
let and_constraint = constraints.and_constraint(constrs); let and_constraint = constraints.and_constraint(constrs);

View file

@ -289,7 +289,7 @@ pub fn constrain_pattern(
num_precision_var, num_precision_var,
bound, bound,
region, region,
Category::Float, Category::Frac,
); );
// Link the free num var with the float var and our expectation. // Link the free num var with the float var and our expectation.
@ -298,7 +298,7 @@ pub fn constrain_pattern(
state.constraints.push(constraints.equal_types( state.constraints.push(constraints.equal_types(
num_type.clone(), // TODO check me if something breaks! num_type.clone(), // TODO check me if something breaks!
Expected::NoExpectation(float_type), Expected::NoExpectation(float_type),
Category::Float, Category::Frac,
region, region,
)); ));

View file

@ -1980,7 +1980,7 @@ pub enum Category {
When, When,
// types // types
Float, Frac,
Int, Int,
Num, Num,
List, List,