Implemented environment type
This commit is contained in:
parent
1268344238
commit
96ac298980
15 changed files with 67 additions and 51 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue