n...@mit.edu writes:

> Thanks Todd.  That fixed my problem.
>
> Concerning the dummy nodes to want to add to an AST, you could try adding 
> dummy methods to make them to conform to ast.Stmt or whatever?
>

You can, and you can add them as Expr's or Decl's but then you lose the
ability to use ast.Walk or format.Node.  They both panic upon seeing a
type they don't expect.

I've also run into problems with trying to add comments to generated
code.  In some places it's easy as some of the nodes have a comment
member, but in others you need to add them to ast.File, and then have
the positions set correctly which gets you back to token.FileSet and
token.Pos.

- Todd

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to