From 8c4fa9d85cd274439dbd7d0a5c699fe1cea557dc Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Fri, 8 Mar 2024 19:29:34 +0100 Subject: feat: add type representation in vm package Type and Value types in vm package are now used in place of reflect.Type and reflect.Value. It allows to remove the dependency on reflect for parser and compiler packages. The main purpose of Type is to provide a solution to implement recursive structs, named types, interfaces and methods, despite the limitations of Go reflect. The goal is to provide the thinnest layer around reflect. --- parser/parse.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parser/parse.go') diff --git a/parser/parse.go b/parser/parse.go index 59083b6..ffa8102 100644 --- a/parser/parse.go +++ b/parser/parse.go @@ -420,8 +420,8 @@ func (p *Parser) ParseReturn(in Tokens) (out Tokens, err error) { // TODO: the function symbol should be already present in the parser context. // otherwise no way to handle anonymous func. s := p.function - in[0].Beg = s.Type.NumOut() - in[0].End = s.Type.NumIn() + in[0].Beg = s.Type.Rtype.NumOut() + in[0].End = s.Type.Rtype.NumIn() out = append(out, in[0]) return out, err } -- cgit v1.2.3