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:
1 parent
0063a8536c
commit
74ff1e7e9f
6 files changed
+53
-30
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -55,8 +55,8 @@ def test_signal_with_fstring():
|
||||
ir = parse_component(source)
|
||||
llvm_ir = generate_llvm_ir(ir)
|
||||
|
||||
# Should have signal storage
|
||||
assert "@signal_count" in llvm_ir
|
||||
# Should have signal storage (scoped to component)
|
||||
assert "@signal_Counter_count" in llvm_ir
|
||||
|
||||
# Should have getter function
|
||||
assert "get_count" in llvm_ir
|
||||
|
||||
Reference in new issue
Block a user