diff options
| author | Marc Vertes <mvertes@free.fr> | 2024-03-08 19:29:34 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2024-03-08 19:29:34 +0100 |
| commit | 8c4fa9d85cd274439dbd7d0a5c699fe1cea557dc (patch) | |
| tree | a8c910cf13aa06e61ee2db40b5dd2f1f63a25b9d /parser/parse.go | |
| parent | 828cfd1c8da5e243fd0f34530fb1a7faab49784e (diff) | |
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.
Diffstat (limited to 'parser/parse.go')
| -rw-r--r-- | parser/parse.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 } |
