fix extra ampersands

This commit is contained in:
Folkert 2021-07-29 17:32:08 +02:00
parent b6116eeb98
commit 899cbeabd7
79 changed files with 372 additions and 376 deletions

View file

@ -27,7 +27,7 @@ pub fn str_split<'a, 'ctx, 'env>(
let segment_count = call_bitcode_fn(
env,
&[str_i128.into(), delim_i128.into()],
&bitcode::STR_COUNT_SEGMENTS,
bitcode::STR_COUNT_SEGMENTS,
)
.into_int_value();
@ -47,7 +47,7 @@ pub fn str_split<'a, 'ctx, 'env>(
call_void_bitcode_fn(
env,
&[ret_list_ptr_zig_rocstr, str_i128.into(), delim_i128.into()],
&bitcode::STR_STR_SPLIT_IN_PLACE,
bitcode::STR_STR_SPLIT_IN_PLACE,
);
store_list(env, ret_list_ptr, segment_count)
@ -62,7 +62,7 @@ fn str_symbol_to_i128<'a, 'ctx, 'env>(
let i128_type = env.context.i128_type().into();
complex_bitcast(&env.builder, string, i128_type, "str_to_i128").into_int_value()
complex_bitcast(env.builder, string, i128_type, "str_to_i128").into_int_value()
}
pub fn str_to_i128<'a, 'ctx, 'env>(
@ -119,7 +119,7 @@ pub fn str_concat<'a, 'ctx, 'env>(
call_bitcode_fn(
env,
&[str1_i128.into(), str2_i128.into()],
&bitcode::STR_CONCAT,
bitcode::STR_CONCAT,
)
}
@ -138,7 +138,7 @@ pub fn str_join_with<'a, 'ctx, 'env>(
call_bitcode_fn(
env,
&[list_i128.into(), str_i128.into()],
&bitcode::STR_JOIN_WITH,
bitcode::STR_JOIN_WITH,
)
}
@ -151,7 +151,7 @@ pub fn str_number_of_bytes<'a, 'ctx, 'env>(
// the builtin will always return an u64
let length =
call_bitcode_fn(env, &[str_i128.into()], &bitcode::STR_NUMBER_OF_BYTES).into_int_value();
call_bitcode_fn(env, &[str_i128.into()], bitcode::STR_NUMBER_OF_BYTES).into_int_value();
// cast to the appropriate usize of the current build
env.builder
@ -171,7 +171,7 @@ pub fn str_starts_with<'a, 'ctx, 'env>(
call_bitcode_fn(
env,
&[str_i128.into(), prefix_i128.into()],
&bitcode::STR_STARTS_WITH,
bitcode::STR_STARTS_WITH,
)
}
@ -188,7 +188,7 @@ pub fn str_starts_with_code_point<'a, 'ctx, 'env>(
call_bitcode_fn(
env,
&[str_i128.into(), prefix],
&bitcode::STR_STARTS_WITH_CODE_POINT,
bitcode::STR_STARTS_WITH_CODE_POINT,
)
}
@ -205,7 +205,7 @@ pub fn str_ends_with<'a, 'ctx, 'env>(
call_bitcode_fn(
env,
&[str_i128.into(), prefix_i128.into()],
&bitcode::STR_ENDS_WITH,
bitcode::STR_ENDS_WITH,
)
}
@ -220,7 +220,7 @@ pub fn str_count_graphemes<'a, 'ctx, 'env>(
call_bitcode_fn(
env,
&[str_i128.into()],
&bitcode::STR_COUNT_GRAPEHEME_CLUSTERS,
bitcode::STR_COUNT_GRAPEHEME_CLUSTERS,
)
}
@ -232,7 +232,7 @@ pub fn str_from_int<'a, 'ctx, 'env>(
) -> BasicValueEnum<'ctx> {
let int = load_symbol(scope, &int_symbol);
call_bitcode_fn(env, &[int], &bitcode::STR_FROM_INT)
call_bitcode_fn(env, &[int], bitcode::STR_FROM_INT)
}
/// Str.toBytes : Str -> List U8
@ -247,7 +247,7 @@ pub fn str_to_bytes<'a, 'ctx, 'env>(
"to_bytes",
);
call_bitcode_fn_returns_list(env, &[string], &bitcode::STR_TO_BYTES)
call_bitcode_fn_returns_list(env, &[string], bitcode::STR_TO_BYTES)
}
/// Str.fromUtf8 : List U8 -> { a : Bool, b : Str, c : Nat, d : I8 }
@ -273,7 +273,7 @@ pub fn str_from_utf8<'a, 'ctx, 'env>(
),
result_ptr.into(),
],
&bitcode::STR_FROM_UTF8,
bitcode::STR_FROM_UTF8,
);
let record_type = env.context.struct_type(
@ -306,7 +306,7 @@ pub fn str_from_float<'a, 'ctx, 'env>(
) -> BasicValueEnum<'ctx> {
let float = load_symbol(scope, &int_symbol);
call_bitcode_fn(env, &[float], &bitcode::STR_FROM_FLOAT)
call_bitcode_fn(env, &[float], bitcode::STR_FROM_FLOAT)
}
/// Str.equal : Str, Str -> Bool
@ -321,7 +321,7 @@ pub fn str_equal<'a, 'ctx, 'env>(
call_bitcode_fn(
env,
&[str1_i128.into(), str2_i128.into()],
&bitcode::STR_EQUAL,
bitcode::STR_EQUAL,
)
}