summaryrefslogtreecommitdiff
path: root/parser/compiler.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2024-03-11 10:03:02 +0100
committerMarc Vertes <mvertes@free.fr>2024-03-11 10:03:02 +0100
commit89e1575f1d7e542b843a53ba7434ac0f034a63fb (patch)
tree0fea8a8262f38caad10b8532cdfe09d2c078a7a6 /parser/compiler.go
parent73eb1891da7171f2bea0d3eb36e3458f267e6f19 (diff)
fix callX, update readme
Diffstat (limited to 'parser/compiler.go')
-rw-r--r--parser/compiler.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/parser/compiler.go b/parser/compiler.go
index 7a60565..82228ed 100644
--- a/parser/compiler.go
+++ b/parser/compiler.go
@@ -115,10 +115,10 @@ func (c *Compiler) Codegen(tokens Tokens) (err error) {
emit(int64(t.Pos), vm.Call)
case lang.CallX:
- typ := pop().Type
+ rtyp := pop().value.Data.Type()
// TODO: pop input types (careful with variadic function)
- for i := 0; i < typ.Rtype.NumOut(); i++ {
- push(&symbol{Type: typ.Out(i)})
+ for i := 0; i < rtyp.NumOut(); i++ {
+ push(&symbol{Type: &vm.Type{Rtype: rtyp.Out(i)}})
}
emit(int64(t.Pos), vm.CallX, int64(t.Beg))