feat: add tuples and streamline conversion of types to and from data

This commit is contained in:
Kasey White
2022-12-07 04:35:41 -05:00
committed by Lucas
parent d8ff574045
commit 2f7131e9b8
7 changed files with 643 additions and 325 deletions

View File

@@ -7,7 +7,7 @@ use crate::{
pub mod cost_model;
mod error;
mod runtime;
pub mod runtime;
use cost_model::{ExBudget, StepKind};
pub use error::Error;

View File

@@ -853,7 +853,7 @@ impl DefaultFunction {
}
}
fn convert_tag_to_constr(tag: i128) -> i128 {
pub fn convert_tag_to_constr(tag: i128) -> i128 {
if tag < 128 {
tag - 121
} else if (1280..1401).contains(&tag) {
@@ -863,7 +863,7 @@ fn convert_tag_to_constr(tag: i128) -> i128 {
}
}
fn convert_constr_to_tag(constr: u64) -> u64 {
pub fn convert_constr_to_tag(constr: u64) -> u64 {
if constr < 7 {
constr + 121
} else if constr < 128 {