mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
new formatting
This commit is contained in:
parent
981e026a58
commit
e0648d348d
6 changed files with 6 additions and 19 deletions
|
@ -1110,10 +1110,8 @@ fn canonicalize_pending_def<'a>(
|
||||||
// identifier (e.g. `f = \x -> ...`), then this symbol can be tail-called.
|
// identifier (e.g. `f = \x -> ...`), then this symbol can be tail-called.
|
||||||
let outer_identifier = env.tailcallable_symbol;
|
let outer_identifier = env.tailcallable_symbol;
|
||||||
|
|
||||||
if let (
|
if let (&ast::Pattern::Identifier(_name), &Pattern::Identifier(ref defined_symbol)) =
|
||||||
&ast::Pattern::Identifier(_name),
|
(&loc_pattern.value, &loc_can_pattern.value)
|
||||||
&Pattern::Identifier(ref defined_symbol),
|
|
||||||
) = (&loc_pattern.value, &loc_can_pattern.value)
|
|
||||||
{
|
{
|
||||||
env.tailcallable_symbol = Some(*defined_symbol);
|
env.tailcallable_symbol = Some(*defined_symbol);
|
||||||
|
|
||||||
|
|
|
@ -867,8 +867,7 @@ fn dict_symbol_to_zig_dict<'a, 'ctx, 'env>(
|
||||||
|
|
||||||
let zig_dict_type = env.module.get_struct_type("dict.RocDict").unwrap();
|
let zig_dict_type = env.module.get_struct_type("dict.RocDict").unwrap();
|
||||||
|
|
||||||
complex_bitcast(env.builder, dict, zig_dict_type.into(), "dict_to_zig_dict")
|
complex_bitcast(env.builder, dict, zig_dict_type.into(), "dict_to_zig_dict").into_struct_value()
|
||||||
.into_struct_value()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn zig_dict_type<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> inkwell::types::StructType<'ctx> {
|
fn zig_dict_type<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> inkwell::types::StructType<'ctx> {
|
||||||
|
|
|
@ -58,8 +58,7 @@ pub fn basic_type_from_layout<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NullableUnwrapped { other_fields, .. } => {
|
NullableUnwrapped { other_fields, .. } => {
|
||||||
let block =
|
let block = block_of_memory_slices(env.context, &[other_fields], env.ptr_bytes);
|
||||||
block_of_memory_slices(env.context, &[other_fields], env.ptr_bytes);
|
|
||||||
block.ptr_type(AddressSpace::Generic).into()
|
block.ptr_type(AddressSpace::Generic).into()
|
||||||
}
|
}
|
||||||
NonNullableUnwrapped(fields) => {
|
NonNullableUnwrapped(fields) => {
|
||||||
|
|
|
@ -1325,13 +1325,7 @@ fn stores_and_condition<'a>(
|
||||||
|
|
||||||
// Assumption: there is at most 1 guard, and it is the outer layer.
|
// Assumption: there is at most 1 guard, and it is the outer layer.
|
||||||
for (path, test) in test_chain {
|
for (path, test) in test_chain {
|
||||||
tests.push(test_to_equality(
|
tests.push(test_to_equality(env, cond_symbol, cond_layout, &path, test))
|
||||||
env,
|
|
||||||
cond_symbol,
|
|
||||||
cond_layout,
|
|
||||||
&path,
|
|
||||||
test,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tests
|
tests
|
||||||
|
|
|
@ -3531,7 +3531,6 @@ mod test_parse {
|
||||||
match parsed {
|
match parsed {
|
||||||
Ok((_, _, _state)) => {
|
Ok((_, _, _state)) => {
|
||||||
// dbg!(_state);
|
// dbg!(_state);
|
||||||
|
|
||||||
}
|
}
|
||||||
Err((_, _fail, _state)) => {
|
Err((_, _fail, _state)) => {
|
||||||
// dbg!(_fail, _state);
|
// dbg!(_fail, _state);
|
||||||
|
|
|
@ -211,9 +211,7 @@ fn to_expr_report<'a>(
|
||||||
to_lambda_report(alloc, filename, context, lambda, *row, *col)
|
to_lambda_report(alloc, filename, context, lambda, *row, *col)
|
||||||
}
|
}
|
||||||
EExpr::List(list, row, col) => to_list_report(alloc, filename, context, list, *row, *col),
|
EExpr::List(list, row, col) => to_list_report(alloc, filename, context, list, *row, *col),
|
||||||
EExpr::Str(string, row, col) => {
|
EExpr::Str(string, row, col) => to_str_report(alloc, filename, context, string, *row, *col),
|
||||||
to_str_report(alloc, filename, context, string, *row, *col)
|
|
||||||
}
|
|
||||||
EExpr::InParens(expr, row, col) => {
|
EExpr::InParens(expr, row, col) => {
|
||||||
to_expr_in_parens_report(alloc, filename, context, expr, *row, *col)
|
to_expr_in_parens_report(alloc, filename, context, expr, *row, *col)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue