uh oh, I need to actually switch to struct subvars and resolve pointer variables

This commit is contained in:
2025-04-26 22:15:36 -04:00
parent 71598a4afa
commit a087af505e
18 changed files with 205 additions and 200 deletions
+3 -7
View File
@@ -46,11 +46,7 @@ impl PStruct {
span: FileSpan,
) -> Option<()> {
p.push();
let generics = self
.generics
.iter()
.flat_map(|a| a.lower(p))
.collect();
let generics = self.generics.iter().flat_map(|a| a.lower(p)).collect();
let fields = match &self.fields {
PStructFields::Named(nodes) => nodes
.iter()
@@ -84,8 +80,8 @@ impl PStruct {
impl Node<PStruct> {
pub fn lower_name(&self, p: &mut UProgram) -> Option<StructID> {
let s = self.as_ref()?;
let name = s.name.as_ref()?.to_string();
let id = p.def_searchable(name.to_string(), None, s.name.origin);
let name = s.name.as_ref()?;
let id = p.def_searchable(name, None, s.name.origin);
Some(id)
}
pub fn lower(&self, id: StructID, p: &mut UProgram, output: &mut CompilerOutput) {