Support multiple components in single file with scoped signals

- Update generate_llvm_ir() to accept list of component dicts
- Process each component with own signal/handler state
- Scope signal globals with component name prefix (@signal_ComponentName_signalName)
- Add _signal_global() helper for scoped signal names
- Update tests for scoped signal names
- All tests passing (30/30)
This commit is contained in:
Aaron Sinclair committed 2025-11-15 03:32:38 -08:00
1 parent 0063a8536c
commit 74ff1e7e9f
6 files changed
+53 -30

No files matched your search

+2 -2
View File
@@ -21,8 +21,8 @@ def Toggle():
ir = parse_component(source)
llvm_ir = generate_llvm_ir(ir)
# Should have signal global
assert "@signal_visible = global i32 1" in llvm_ir
# Should have signal global (scoped to component)
assert "@signal_Toggle_visible = global i32 1" in llvm_ir
# Should have conditional branch
assert "br i1" in llvm_ir