refactor(joinir): Split ast_lowerer and join_ir_vm_bridge into modules
ast_lowerer.rs → ast_lowerer/ (10 files): - mod.rs: public surface + entry dispatch - context.rs: ExtractCtx helpers - expr.rs: expression-to-JoinIR extraction - if_return.rs: simple if→Select lowering - loop_patterns.rs: loop variants (simple/break/continue) - read_quoted.rs: read_quoted_from lowering (Phase 45-46) - nested_if.rs: NestedIfMerge lowering - analysis.rs: loop if-var analysis + metadata helpers - tests.rs: frontend lowering tests - README.md: module documentation join_ir_vm_bridge.rs → join_ir_vm_bridge/ (5 files): - mod.rs: public surface + shared helpers - convert.rs: JoinIR→MIR lowering - runner.rs: VM execution entry (run_joinir_via_vm) - meta.rs: experimental metadata-aware hooks - tests.rs: bridge-specific unit tests - README.md: module documentation Benefits: - Clear separation of concerns per pattern - Easier navigation and maintenance - Each file has single responsibility - README documents module boundaries Co-authored-by: ChatGPT <noreply@openai.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -244,10 +244,7 @@ impl BasicBlock {
|
||||
self.instructions
|
||||
.get(idx)
|
||||
.zip(self.instruction_spans.get(idx))
|
||||
.map(|(inst, span)| SpannedInstRef {
|
||||
inst,
|
||||
span: *span,
|
||||
})
|
||||
.map(|(inst, span)| SpannedInstRef { inst, span: *span })
|
||||
}
|
||||
|
||||
/// Get span for terminator instruction
|
||||
@ -268,19 +265,12 @@ impl BasicBlock {
|
||||
self.instructions
|
||||
.iter()
|
||||
.zip(self.instruction_spans.iter())
|
||||
.map(|(inst, span)| SpannedInstRef {
|
||||
inst,
|
||||
span: *span,
|
||||
})
|
||||
.map(|(inst, span)| SpannedInstRef { inst, span: *span })
|
||||
}
|
||||
|
||||
/// Iterate instructions with index and span.
|
||||
pub fn iter_spanned_enumerated(
|
||||
&self,
|
||||
) -> impl Iterator<Item = (usize, SpannedInstRef<'_>)> {
|
||||
self.iter_spanned()
|
||||
.enumerate()
|
||||
.map(|(idx, sp)| (idx, sp))
|
||||
pub fn iter_spanned_enumerated(&self) -> impl Iterator<Item = (usize, SpannedInstRef<'_>)> {
|
||||
self.iter_spanned().enumerate().map(|(idx, sp)| (idx, sp))
|
||||
}
|
||||
|
||||
/// Iterate all instructions (including terminator) with spans.
|
||||
|
||||
Reference in New Issue
Block a user