Implemented environment type

This commit is contained in:
Eduard Urbach 2025-02-21 17:35:42 +01:00
parent 1268344238
commit 96ac298980
Signed by: eduard
GPG key ID: 49226B848C78F6C8
15 changed files with 67 additions and 51 deletions

View file

@ -37,7 +37,7 @@ func (f *Function) CompileNew(root *expression.Expression) (types.Type, error) {
imp.Used = true
}
typ, exists := f.Structs[pkg+"."+name]
typ, exists := f.All.Structs[pkg+"."+name]
if !exists {
return nil, errors.New(&errors.UnknownType{Name: name}, f.File, nameNode.Token.Position)
@ -45,6 +45,6 @@ func (f *Function) CompileNew(root *expression.Expression) (types.Type, error) {
f.SaveRegister(f.CPU.Input[0])
f.RegisterNumber(asm.MOVE, f.CPU.Input[0], typ.Size())
f.CallSafe(f.Functions["mem.alloc"], f.CPU.Input[:1])
f.CallSafe(f.All.Functions["mem.alloc"], f.CPU.Input[:1])
return &types.Pointer{To: typ}, nil
}