mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
rename joinpoint field
This commit is contained in:
parent
19db7515da
commit
b622202d97
9 changed files with 30 additions and 29 deletions
|
@ -519,7 +519,7 @@ where
|
|||
}
|
||||
Stmt::Join {
|
||||
parameters,
|
||||
continuation,
|
||||
body: continuation,
|
||||
remainder,
|
||||
..
|
||||
} => {
|
||||
|
|
|
@ -2137,7 +2137,7 @@ pub fn build_exp_stmt<'a, 'ctx, 'env>(
|
|||
id,
|
||||
parameters,
|
||||
remainder,
|
||||
continuation,
|
||||
body: continuation,
|
||||
} => {
|
||||
let builder = env.builder;
|
||||
let context = env.context;
|
||||
|
|
|
@ -298,7 +298,7 @@ fn stmt_spec(
|
|||
Join {
|
||||
id,
|
||||
parameters,
|
||||
continuation,
|
||||
body: continuation,
|
||||
remainder,
|
||||
} => {
|
||||
let mut type_ids = Vec::new();
|
||||
|
|
|
@ -193,7 +193,7 @@ impl<'a> ParamMap<'a> {
|
|||
id: j,
|
||||
parameters: xs,
|
||||
remainder: v,
|
||||
continuation: b,
|
||||
body: b,
|
||||
} => {
|
||||
let already_in_there = self
|
||||
.items
|
||||
|
@ -618,7 +618,7 @@ impl<'a> BorrowInfState<'a> {
|
|||
id: j,
|
||||
parameters: ys,
|
||||
remainder: v,
|
||||
continuation: b,
|
||||
body: b,
|
||||
} => {
|
||||
let old = self.param_set.clone();
|
||||
self.update_param_set(ys);
|
||||
|
|
|
@ -956,7 +956,7 @@ pub fn optimize_when<'a>(
|
|||
stmt = Stmt::Join {
|
||||
id,
|
||||
parameters: &[],
|
||||
continuation: env.arena.alloc(body),
|
||||
body: env.arena.alloc(body),
|
||||
remainder: env.arena.alloc(stmt),
|
||||
};
|
||||
}
|
||||
|
@ -1329,7 +1329,7 @@ fn compile_guard<'a>(
|
|||
id,
|
||||
parameters: arena.alloc([param]),
|
||||
remainder: stmt,
|
||||
continuation: arena.alloc(cond),
|
||||
body: arena.alloc(cond),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1622,7 +1622,7 @@ fn decide_to_branching<'a>(
|
|||
Stmt::Join {
|
||||
id: fail_jp_id,
|
||||
parameters: &[],
|
||||
continuation: fail,
|
||||
body: fail,
|
||||
remainder: arena.alloc(test_stmt),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -622,7 +622,7 @@ fn expand_and_cancel<'a>(env: &mut Env<'a, '_>, stmt: &'a Stmt<'a>) -> &'a Stmt<
|
|||
Join {
|
||||
id,
|
||||
parameters,
|
||||
continuation,
|
||||
body: continuation,
|
||||
remainder,
|
||||
} => {
|
||||
let continuation = expand_and_cancel(env, continuation);
|
||||
|
@ -631,7 +631,7 @@ fn expand_and_cancel<'a>(env: &mut Env<'a, '_>, stmt: &'a Stmt<'a>) -> &'a Stmt<
|
|||
let stmt = Join {
|
||||
id: *id,
|
||||
parameters,
|
||||
continuation,
|
||||
body: continuation,
|
||||
remainder,
|
||||
};
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ pub fn occurring_variables(stmt: &Stmt<'_>) -> (MutSet<Symbol>, MutSet<Symbol>)
|
|||
|
||||
Join {
|
||||
parameters,
|
||||
continuation,
|
||||
body: continuation,
|
||||
remainder,
|
||||
..
|
||||
} => {
|
||||
|
@ -978,7 +978,7 @@ impl<'a> Context<'a> {
|
|||
id: j,
|
||||
parameters: _,
|
||||
remainder: b,
|
||||
continuation: v,
|
||||
body: v,
|
||||
} => {
|
||||
// get the parameters with borrow signature
|
||||
let xs = self.param_map.get_join_point(*j);
|
||||
|
@ -1000,7 +1000,7 @@ impl<'a> Context<'a> {
|
|||
id: *j,
|
||||
parameters: xs,
|
||||
remainder: b,
|
||||
continuation: v,
|
||||
body: v,
|
||||
}),
|
||||
b_live_vars,
|
||||
)
|
||||
|
@ -1143,7 +1143,7 @@ pub fn collect_stmt(
|
|||
id: j,
|
||||
parameters,
|
||||
remainder: b,
|
||||
continuation: v,
|
||||
body: v,
|
||||
} => {
|
||||
let mut j_live_vars = collect_stmt(v, jp_live_vars, MutSet::default());
|
||||
for param in parameters.iter() {
|
||||
|
|
|
@ -890,9 +890,10 @@ pub enum Stmt<'a> {
|
|||
Join {
|
||||
id: JoinPointId,
|
||||
parameters: &'a [Param<'a>],
|
||||
/// does not contain jumps to this id
|
||||
continuation: &'a Stmt<'a>,
|
||||
/// the "body" of the join point, contains the jumps to this id
|
||||
/// body of the join point
|
||||
/// what happens after _jumping to_ the join point
|
||||
body: &'a Stmt<'a>,
|
||||
/// what happens after _defining_ the join point
|
||||
remainder: &'a Stmt<'a>,
|
||||
},
|
||||
Jump(JoinPointId, &'a [Symbol]),
|
||||
|
@ -1476,7 +1477,7 @@ impl<'a> Stmt<'a> {
|
|||
Join {
|
||||
id,
|
||||
parameters,
|
||||
continuation,
|
||||
body: continuation,
|
||||
remainder,
|
||||
} => {
|
||||
let it = parameters.iter().map(|p| symbol_to_doc(alloc, p.symbol));
|
||||
|
@ -3328,7 +3329,7 @@ pub fn with_hole<'a>(
|
|||
id,
|
||||
parameters: env.arena.alloc([param]),
|
||||
remainder: env.arena.alloc(stmt),
|
||||
continuation: hole,
|
||||
body: hole,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3381,7 +3382,7 @@ pub fn with_hole<'a>(
|
|||
id,
|
||||
parameters: env.arena.alloc([param]),
|
||||
remainder: env.arena.alloc(stmt),
|
||||
continuation: env.arena.alloc(hole),
|
||||
body: env.arena.alloc(hole),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5327,7 +5328,7 @@ fn substitute_in_stmt_help<'a>(
|
|||
id,
|
||||
parameters,
|
||||
remainder,
|
||||
continuation,
|
||||
body: continuation,
|
||||
} => {
|
||||
let opt_remainder = substitute_in_stmt_help(arena, remainder, subs);
|
||||
let opt_continuation = substitute_in_stmt_help(arena, continuation, subs);
|
||||
|
@ -5340,7 +5341,7 @@ fn substitute_in_stmt_help<'a>(
|
|||
id: *id,
|
||||
parameters,
|
||||
remainder,
|
||||
continuation,
|
||||
body: continuation,
|
||||
}))
|
||||
} else {
|
||||
None
|
||||
|
@ -7859,7 +7860,7 @@ where
|
|||
Stmt::Join {
|
||||
id: join_point_id,
|
||||
parameters: &*env.arena.alloc([param]),
|
||||
continuation: hole,
|
||||
body: hole,
|
||||
remainder: env.arena.alloc(switch),
|
||||
}
|
||||
}
|
||||
|
@ -8017,7 +8018,7 @@ fn union_lambda_set_to_switch<'a>(
|
|||
Stmt::Join {
|
||||
id: join_point_id,
|
||||
parameters: &*env.arena.alloc([param]),
|
||||
continuation: hole,
|
||||
body: hole,
|
||||
remainder: env.arena.alloc(switch),
|
||||
}
|
||||
}
|
||||
|
@ -8161,7 +8162,7 @@ fn enum_lambda_set_to_switch<'a>(
|
|||
Stmt::Join {
|
||||
id: join_point_id,
|
||||
parameters: &*env.arena.alloc([param]),
|
||||
continuation: hole,
|
||||
body: hole,
|
||||
remainder: env.arena.alloc(switch),
|
||||
}
|
||||
}
|
||||
|
@ -8290,7 +8291,7 @@ where
|
|||
Stmt::Join {
|
||||
id: join_point_id,
|
||||
parameters: &*env.arena.alloc([param]),
|
||||
continuation: hole,
|
||||
body: hole,
|
||||
remainder: env.arena.alloc(switch),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ pub fn make_tail_recursive<'a>(
|
|||
id,
|
||||
remainder: jump,
|
||||
parameters: params,
|
||||
continuation: new,
|
||||
body: new,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ fn insert_jumps<'a>(
|
|||
id,
|
||||
parameters,
|
||||
remainder,
|
||||
continuation,
|
||||
body: continuation,
|
||||
} => {
|
||||
let opt_remainder = insert_jumps(arena, remainder, goal_id, needle);
|
||||
let opt_continuation = insert_jumps(arena, continuation, goal_id, needle);
|
||||
|
@ -173,7 +173,7 @@ fn insert_jumps<'a>(
|
|||
id: *id,
|
||||
parameters,
|
||||
remainder,
|
||||
continuation,
|
||||
body: continuation,
|
||||
}))
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue