Closed c9s closed 1 year ago
Use case code:
// +gen symtable:"SymTable[ast.Function]"
type FunctionSymTable map[string]*ast.Function
This fixes the lexer, but we need to let the go/ast
works, I am currently tracing the code of type parsing
I will submit the external type support in another PR.
Some updates
go/types.Checker
didn't open much API that we can use. We need to pass go/types.Info
to let Checker knows the external package.check.rawExpr(&x, node, nil)
method is not exported, that way even we copy the code, we still can't eval the external type.
Summary:
For types from other packages, we need to reference the typename with package name. e.g., "ast.Function"
Related Issue: https://github.com/clipperhouse/gen/issues/88