Skip to content

Allow '.' for typename in annotation comment#8

Closed
c9s wants to merge 2 commits intoclipperhouse:masterfrom
c9s:master
Closed

Allow '.' for typename in annotation comment#8
c9s wants to merge 2 commits intoclipperhouse:masterfrom
c9s:master

Conversation

@c9s
Copy link
Copy Markdown

@c9s c9s commented May 27, 2015

Summary:

For types from other packages, we need to reference the typename with
package name. e.g., "ast.Function"

Related Issue: clipperhouse/gen#88

Summary:

For types from other packages, we need to reference the typename with
package name. e.g.,   "ast.Function"
@c9s
Copy link
Copy Markdown
Author

c9s commented May 27, 2015

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

@c9s
Copy link
Copy Markdown
Author

c9s commented May 27, 2015

I will submit the external type support in another PR.

@c9s c9s changed the title Allow '.' in typename Allow '.' for typename in annotation comment May 29, 2015
@c9s
Copy link
Copy Markdown
Author

c9s commented May 29, 2015

Some updates

  • Unfortunately 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.
  • Also the check.rawExpr(&x, node, nil) method is not exported, that way even we copy the code, we still can't eval the external type.

@c9s c9s closed this Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant