Update Nat to U64 in some comments

This commit is contained in:
Richard Feldman 2024-01-22 23:18:55 -05:00
parent a71188dc30
commit 4a870c8ee0
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
2 changed files with 17 additions and 17 deletions

View file

@ -468,7 +468,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
) )
} }
StrRepeat => { StrRepeat => {
// Str.repeat : Str, Nat -> Str // Str.repeat : Str, U64 -> Str
arguments!(string, count); arguments!(string, count);
call_str_bitcode_fn( call_str_bitcode_fn(
@ -522,7 +522,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
BasicValueEnum::IntValue(is_zero) BasicValueEnum::IntValue(is_zero)
} }
StrCountUtf8Bytes => { StrCountUtf8Bytes => {
// Str.countUtf8Bytes : Str -> Nat // Str.countUtf8Bytes : Str -> U64
arguments!(string); arguments!(string);
call_str_bitcode_fn( call_str_bitcode_fn(
@ -534,13 +534,13 @@ pub(crate) fn run_low_level<'a, 'ctx>(
) )
} }
StrGetCapacity => { StrGetCapacity => {
// Str.capacity : Str -> Nat // Str.capacity : Str -> U64
arguments!(string); arguments!(string);
call_bitcode_fn(env, &[string], bitcode::STR_CAPACITY) call_bitcode_fn(env, &[string], bitcode::STR_CAPACITY)
} }
StrSubstringUnsafe => { StrSubstringUnsafe => {
// Str.substringUnsafe : Str, Nat, Nat -> Str // Str.substringUnsafe : Str, U64, U64 -> Str
arguments!(string, start, length); arguments!(string, start, length);
call_str_bitcode_fn( call_str_bitcode_fn(
@ -552,7 +552,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
) )
} }
StrReserve => { StrReserve => {
// Str.reserve : Str, Nat -> Str // Str.reserve : Str, U64 -> Str
arguments!(string, capacity); arguments!(string, capacity);
call_str_bitcode_fn( call_str_bitcode_fn(
@ -606,7 +606,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
) )
} }
StrWithCapacity => { StrWithCapacity => {
// Str.withCapacity : Nat -> Str // Str.withCapacity : U64 -> Str
arguments!(str_len); arguments!(str_len);
call_str_bitcode_fn( call_str_bitcode_fn(
@ -629,7 +629,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
.into() .into()
} }
ListGetCapacity => { ListGetCapacity => {
// List.capacity: List a -> Nat // List.capacity: List a -> U64
arguments!(list); arguments!(list);
call_list_bitcode_fn( call_list_bitcode_fn(
@ -641,7 +641,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
) )
} }
ListWithCapacity => { ListWithCapacity => {
// List.withCapacity : Nat -> List a // List.withCapacity : U64 -> List a
arguments!(list_len); arguments!(list_len);
let result_layout = layout; let result_layout = layout;
@ -714,7 +714,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
list_release_excess_capacity(env, layout_interner, list, element_layout, update_mode) list_release_excess_capacity(env, layout_interner, list, element_layout, update_mode)
} }
ListSwap => { ListSwap => {
// List.swap : List elem, Nat, Nat -> List elem // List.swap : List elem, U64, U64 -> List elem
debug_assert_eq!(args.len(), 3); debug_assert_eq!(args.len(), 3);
let (list, list_layout) = scope.load_symbol_and_layout(&args[0]); let (list, list_layout) = scope.load_symbol_and_layout(&args[0]);
@ -755,7 +755,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
) )
} }
ListDropAt => { ListDropAt => {
// List.dropAt : List elem, Nat -> List elem // List.dropAt : List elem, U64 -> List elem
debug_assert_eq!(args.len(), 2); debug_assert_eq!(args.len(), 2);
let (list, list_layout) = scope.load_symbol_and_layout(&args[0]); let (list, list_layout) = scope.load_symbol_and_layout(&args[0]);
@ -774,7 +774,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
) )
} }
StrGetUnsafe => { StrGetUnsafe => {
// Str.getUnsafe : Str, Nat -> u8 // Str.getUnsafe : Str, U64 -> u8
arguments!(wrapper_struct, elem_index); arguments!(wrapper_struct, elem_index);
call_str_bitcode_fn( call_str_bitcode_fn(
@ -786,7 +786,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
) )
} }
ListGetUnsafe => { ListGetUnsafe => {
// List.getUnsafe : List elem, Nat -> elem // List.getUnsafe : List elem, U64 -> elem
arguments_with_layouts!((wrapper_struct, list_layout), (element_index, _l)); arguments_with_layouts!((wrapper_struct, list_layout), (element_index, _l));
list_get_unsafe( list_get_unsafe(

View file

@ -361,7 +361,7 @@ impl<'a> LowLevelCall<'a> {
} }
} }
ListReplaceUnsafe => { ListReplaceUnsafe => {
// List.replace_unsafe : List elem, Nat, elem -> { list: List elem, value: elem } // List.replace_unsafe : List elem, U64, elem -> { list: List elem, value: elem }
let list: Symbol = self.arguments[0]; let list: Symbol = self.arguments[0];
let index: Symbol = self.arguments[1]; let index: Symbol = self.arguments[1];
@ -449,7 +449,7 @@ impl<'a> LowLevelCall<'a> {
backend.call_host_fn_after_loading_args(bitcode::LIST_REPLACE); backend.call_host_fn_after_loading_args(bitcode::LIST_REPLACE);
} }
ListWithCapacity => { ListWithCapacity => {
// List.withCapacity : Nat -> List elem // List.withCapacity : U64 -> List elem
let capacity: Symbol = self.arguments[0]; let capacity: Symbol = self.arguments[0];
let elem_layout = unwrap_list_elem_layout(self.ret_layout_raw); let elem_layout = unwrap_list_elem_layout(self.ret_layout_raw);
@ -500,7 +500,7 @@ impl<'a> LowLevelCall<'a> {
} }
ListReserve => { ListReserve => {
// List.reserve : List elem, Nat -> List elem // List.reserve : List elem, U64 -> List elem
let list: Symbol = self.arguments[0]; let list: Symbol = self.arguments[0];
let spare: Symbol = self.arguments[1]; let spare: Symbol = self.arguments[1];
@ -649,7 +649,7 @@ impl<'a> LowLevelCall<'a> {
} }
ListSublist => { ListSublist => {
// As a low-level, record is destructured // As a low-level, record is destructured
// List.sublist : List elem, start : Nat, len : Nat -> List elem // List.sublist : List elem, start : U64, len : U64 -> List elem
let list: Symbol = self.arguments[0]; let list: Symbol = self.arguments[0];
let start: Symbol = self.arguments[1]; let start: Symbol = self.arguments[1];
@ -697,7 +697,7 @@ impl<'a> LowLevelCall<'a> {
backend.call_host_fn_after_loading_args(bitcode::LIST_SUBLIST); backend.call_host_fn_after_loading_args(bitcode::LIST_SUBLIST);
} }
ListDropAt => { ListDropAt => {
// List.dropAt : List elem, Nat -> List elem // List.dropAt : List elem, U64 -> List elem
let list: Symbol = self.arguments[0]; let list: Symbol = self.arguments[0];
let drop_index: Symbol = self.arguments[1]; let drop_index: Symbol = self.arguments[1];