12345678910111213141516171819202122 |
- package generator
- import (
- "go/ast"
- "go/token"
- )
- func makeBasicLit(kind token.Token, value string) *ast.BasicLit {
- return &ast.BasicLit{Kind: kind, Value: value}
- }
- func makeVector(typ ast.Expr, elements []ast.Expr) *ast.CompositeLit {
- return makeCompositeLit(&ast.ArrayType{Elt: typ}, elements)
- }
- func makeCompositeLit(typ ast.Expr, elements []ast.Expr) *ast.CompositeLit {
- return &ast.CompositeLit{
- Type: typ,
- Elts: elements,
- }
- }
|