rename joinpoint field

This commit is contained in:
Folkert 2021-06-14 21:12:24 +02:00
parent 19db7515da
commit b622202d97
9 changed files with 30 additions and 29 deletions

View file

@ -519,7 +519,7 @@ where
} }
Stmt::Join { Stmt::Join {
parameters, parameters,
continuation, body: continuation,
remainder, remainder,
.. ..
} => { } => {

View file

@ -2137,7 +2137,7 @@ pub fn build_exp_stmt<'a, 'ctx, 'env>(
id, id,
parameters, parameters,
remainder, remainder,
continuation, body: continuation,
} => { } => {
let builder = env.builder; let builder = env.builder;
let context = env.context; let context = env.context;

View file

@ -298,7 +298,7 @@ fn stmt_spec(
Join { Join {
id, id,
parameters, parameters,
continuation, body: continuation,
remainder, remainder,
} => { } => {
let mut type_ids = Vec::new(); let mut type_ids = Vec::new();

View file

@ -193,7 +193,7 @@ impl<'a> ParamMap<'a> {
id: j, id: j,
parameters: xs, parameters: xs,
remainder: v, remainder: v,
continuation: b, body: b,
} => { } => {
let already_in_there = self let already_in_there = self
.items .items
@ -618,7 +618,7 @@ impl<'a> BorrowInfState<'a> {
id: j, id: j,
parameters: ys, parameters: ys,
remainder: v, remainder: v,
continuation: b, body: b,
} => { } => {
let old = self.param_set.clone(); let old = self.param_set.clone();
self.update_param_set(ys); self.update_param_set(ys);

View file

@ -956,7 +956,7 @@ pub fn optimize_when<'a>(
stmt = Stmt::Join { stmt = Stmt::Join {
id, id,
parameters: &[], parameters: &[],
continuation: env.arena.alloc(body), body: env.arena.alloc(body),
remainder: env.arena.alloc(stmt), remainder: env.arena.alloc(stmt),
}; };
} }
@ -1329,7 +1329,7 @@ fn compile_guard<'a>(
id, id,
parameters: arena.alloc([param]), parameters: arena.alloc([param]),
remainder: stmt, remainder: stmt,
continuation: arena.alloc(cond), body: arena.alloc(cond),
} }
} }
@ -1622,7 +1622,7 @@ fn decide_to_branching<'a>(
Stmt::Join { Stmt::Join {
id: fail_jp_id, id: fail_jp_id,
parameters: &[], parameters: &[],
continuation: fail, body: fail,
remainder: arena.alloc(test_stmt), remainder: arena.alloc(test_stmt),
} }
} }

View file

@ -622,7 +622,7 @@ fn expand_and_cancel<'a>(env: &mut Env<'a, '_>, stmt: &'a Stmt<'a>) -> &'a Stmt<
Join { Join {
id, id,
parameters, parameters,
continuation, body: continuation,
remainder, remainder,
} => { } => {
let continuation = expand_and_cancel(env, continuation); 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 { let stmt = Join {
id: *id, id: *id,
parameters, parameters,
continuation, body: continuation,
remainder, remainder,
}; };

View file

@ -64,7 +64,7 @@ pub fn occurring_variables(stmt: &Stmt<'_>) -> (MutSet<Symbol>, MutSet<Symbol>)
Join { Join {
parameters, parameters,
continuation, body: continuation,
remainder, remainder,
.. ..
} => { } => {
@ -978,7 +978,7 @@ impl<'a> Context<'a> {
id: j, id: j,
parameters: _, parameters: _,
remainder: b, remainder: b,
continuation: v, body: v,
} => { } => {
// get the parameters with borrow signature // get the parameters with borrow signature
let xs = self.param_map.get_join_point(*j); let xs = self.param_map.get_join_point(*j);
@ -1000,7 +1000,7 @@ impl<'a> Context<'a> {
id: *j, id: *j,
parameters: xs, parameters: xs,
remainder: b, remainder: b,
continuation: v, body: v,
}), }),
b_live_vars, b_live_vars,
) )
@ -1143,7 +1143,7 @@ pub fn collect_stmt(
id: j, id: j,
parameters, parameters,
remainder: b, remainder: b,
continuation: v, body: v,
} => { } => {
let mut j_live_vars = collect_stmt(v, jp_live_vars, MutSet::default()); let mut j_live_vars = collect_stmt(v, jp_live_vars, MutSet::default());
for param in parameters.iter() { for param in parameters.iter() {

View file

@ -890,9 +890,10 @@ pub enum Stmt<'a> {
Join { Join {
id: JoinPointId, id: JoinPointId,
parameters: &'a [Param<'a>], parameters: &'a [Param<'a>],
/// does not contain jumps to this id /// body of the join point
continuation: &'a Stmt<'a>, /// what happens after _jumping to_ the join point
/// the "body" of the join point, contains the jumps to this id body: &'a Stmt<'a>,
/// what happens after _defining_ the join point
remainder: &'a Stmt<'a>, remainder: &'a Stmt<'a>,
}, },
Jump(JoinPointId, &'a [Symbol]), Jump(JoinPointId, &'a [Symbol]),
@ -1476,7 +1477,7 @@ impl<'a> Stmt<'a> {
Join { Join {
id, id,
parameters, parameters,
continuation, body: continuation,
remainder, remainder,
} => { } => {
let it = parameters.iter().map(|p| symbol_to_doc(alloc, p.symbol)); let it = parameters.iter().map(|p| symbol_to_doc(alloc, p.symbol));
@ -3328,7 +3329,7 @@ pub fn with_hole<'a>(
id, id,
parameters: env.arena.alloc([param]), parameters: env.arena.alloc([param]),
remainder: env.arena.alloc(stmt), remainder: env.arena.alloc(stmt),
continuation: hole, body: hole,
} }
} }
} }
@ -3381,7 +3382,7 @@ pub fn with_hole<'a>(
id, id,
parameters: env.arena.alloc([param]), parameters: env.arena.alloc([param]),
remainder: env.arena.alloc(stmt), 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, id,
parameters, parameters,
remainder, remainder,
continuation, body: continuation,
} => { } => {
let opt_remainder = substitute_in_stmt_help(arena, remainder, subs); let opt_remainder = substitute_in_stmt_help(arena, remainder, subs);
let opt_continuation = substitute_in_stmt_help(arena, continuation, subs); let opt_continuation = substitute_in_stmt_help(arena, continuation, subs);
@ -5340,7 +5341,7 @@ fn substitute_in_stmt_help<'a>(
id: *id, id: *id,
parameters, parameters,
remainder, remainder,
continuation, body: continuation,
})) }))
} else { } else {
None None
@ -7859,7 +7860,7 @@ where
Stmt::Join { Stmt::Join {
id: join_point_id, id: join_point_id,
parameters: &*env.arena.alloc([param]), parameters: &*env.arena.alloc([param]),
continuation: hole, body: hole,
remainder: env.arena.alloc(switch), remainder: env.arena.alloc(switch),
} }
} }
@ -8017,7 +8018,7 @@ fn union_lambda_set_to_switch<'a>(
Stmt::Join { Stmt::Join {
id: join_point_id, id: join_point_id,
parameters: &*env.arena.alloc([param]), parameters: &*env.arena.alloc([param]),
continuation: hole, body: hole,
remainder: env.arena.alloc(switch), remainder: env.arena.alloc(switch),
} }
} }
@ -8161,7 +8162,7 @@ fn enum_lambda_set_to_switch<'a>(
Stmt::Join { Stmt::Join {
id: join_point_id, id: join_point_id,
parameters: &*env.arena.alloc([param]), parameters: &*env.arena.alloc([param]),
continuation: hole, body: hole,
remainder: env.arena.alloc(switch), remainder: env.arena.alloc(switch),
} }
} }
@ -8290,7 +8291,7 @@ where
Stmt::Join { Stmt::Join {
id: join_point_id, id: join_point_id,
parameters: &*env.arena.alloc([param]), parameters: &*env.arena.alloc([param]),
continuation: hole, body: hole,
remainder: env.arena.alloc(switch), remainder: env.arena.alloc(switch),
} }
} }

View file

@ -60,7 +60,7 @@ pub fn make_tail_recursive<'a>(
id, id,
remainder: jump, remainder: jump,
parameters: params, parameters: params,
continuation: new, body: new,
} }
} }
} }
@ -160,7 +160,7 @@ fn insert_jumps<'a>(
id, id,
parameters, parameters,
remainder, remainder,
continuation, body: continuation,
} => { } => {
let opt_remainder = insert_jumps(arena, remainder, goal_id, needle); let opt_remainder = insert_jumps(arena, remainder, goal_id, needle);
let opt_continuation = insert_jumps(arena, continuation, goal_id, needle); let opt_continuation = insert_jumps(arena, continuation, goal_id, needle);
@ -173,7 +173,7 @@ fn insert_jumps<'a>(
id: *id, id: *id,
parameters, parameters,
remainder, remainder,
continuation, body: continuation,
})) }))
} else { } else {
None None