Generate multiple components in Rust and C++ (#5449)

When lowering to the LLR, generate one PulbicComponent for each exported
component in the main file

Closes #784
This commit is contained in:
Olivier Goffart 2024-06-24 10:03:19 +02:00 committed by GitHub
parent c89ea56abb
commit 3764312561
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 257 additions and 167 deletions

View file

@ -326,7 +326,7 @@ mod cpp_ast {
}
use crate::expression_tree::{BuiltinFunction, EasingCurve, MinMaxOp};
use crate::langtype::{ElementType, Enumeration, EnumerationValue, NativeClass, Type};
use crate::langtype::{Enumeration, EnumerationValue, NativeClass, Type};
use crate::layout::Orientation;
use crate::llr::{
self, EvaluationContext as llr_EvaluationContext, ParentCtx as llr_ParentCtx,
@ -761,14 +761,6 @@ pub fn generate(
}
}
if matches!(
doc.root_component.root_element.borrow().base_type,
ElementType::Error | ElementType::Global
) {
// empty document, nothing to generate
return file;
}
let llr = llr::lower_to_item_tree::lower_to_item_tree(&doc, compiler_config);
// Forward-declare the root so that sub-components can access singletons, the window, etc.