feat: render interactive manuscript from Endor through generic graphics
This commit is contained in:
@@ -102,6 +102,28 @@ fn shift_input(input: &mut InteractiveInput, offset: usize) {
|
||||
fn shift_statement(statement: &mut Stmt, offset: usize) {
|
||||
shift_span(&mut statement.span, offset);
|
||||
match &mut statement.kind {
|
||||
StmtKind::If(branch) => {
|
||||
shift_span(&mut branch.span, offset);
|
||||
shift_expression(&mut branch.condition, offset);
|
||||
shift_span(&mut branch.body.span, offset);
|
||||
for s in &mut branch.body.statements {
|
||||
shift_statement(s, offset);
|
||||
}
|
||||
if let Some(body) = &mut branch.otherwise {
|
||||
shift_span(&mut body.span, offset);
|
||||
for s in &mut body.statements {
|
||||
shift_statement(s, offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
StmtKind::While(loop_) => {
|
||||
shift_span(&mut loop_.span, offset);
|
||||
shift_expression(&mut loop_.condition, offset);
|
||||
shift_span(&mut loop_.body.span, offset);
|
||||
for s in &mut loop_.body.statements {
|
||||
shift_statement(s, offset);
|
||||
}
|
||||
}
|
||||
StmtKind::Binding(binding) => {
|
||||
shift_span(&mut binding.span, offset);
|
||||
shift_span(&mut binding.name.span, offset);
|
||||
|
||||
Reference in New Issue
Block a user