Add percision variable in fp/integer eq constraints

This commit is contained in:
Jared Ramirez 2020-12-28 16:22:34 -06:00
parent 5e332cbad9
commit 48f964adf4
17 changed files with 120 additions and 71 deletions

View file

@ -451,7 +451,7 @@ fn test_at_path<'a>(selected_path: &Path, branch: &Branch<'a>, all_tests: &mut V
IntLiteral(v) => {
all_tests.push(guarded(IsInt(*v)));
}
FloatLiteral(v) => {
FloatLiteral(_, v) => {
all_tests.push(IsFloat(*v));
}
StrLiteral(v) => {
@ -655,7 +655,7 @@ fn to_relevant_branch_help<'a>(
_ => None,
},
FloatLiteral(float) => match test {
FloatLiteral(_, float) => match test {
IsFloat(test_float) if float == *test_float => {
start.extend(end);
Some(Branch {
@ -749,7 +749,7 @@ fn needs_tests<'a>(pattern: &Pattern<'a>) -> bool {
| BitLiteral { .. }
| EnumLiteral { .. }
| IntLiteral(_)
| FloatLiteral(_)
| FloatLiteral(_, _)
| StrLiteral(_) => true,
}
}