Added placeholders for type casts
This commit is contained in:
parent
f87cda97e2
commit
a905710982
19 changed files with 61 additions and 42 deletions
|
@ -52,6 +52,17 @@ func (f *Function) CompileCall(root *expression.Expression) ([]types.Type, error
|
|||
fn, exists = f.All.Functions[pkg+"."+name]
|
||||
|
||||
if !exists {
|
||||
typ := types.ByName(name, f.Package, f.All.Structs)
|
||||
|
||||
if typ != nil {
|
||||
if len(root.Children) != 2 {
|
||||
return nil, errors.New(&errors.ParameterCountMismatch{Function: name, Count: len(root.Children), ExpectedCount: 1}, f.File, nameNode.Token.End())
|
||||
}
|
||||
|
||||
_, err := f.ExpressionToRegister(root.Children[1], f.CPU.Output[0])
|
||||
return []types.Type{typ}, err
|
||||
}
|
||||
|
||||
return nil, errors.New(&errors.UnknownFunction{Name: name}, f.File, nameNode.Token.Position)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue