Documentation ¶
Index ¶
- Constants
- Variables
- func B(a ...int)
- func Z()
- type A
- type A1
- type Bad
- type Basic
- type Code
- type Decoration
- type Double
- type Expr
- type Field
- type FieldSpec
- type Iface
- type Init
- type InnerField
- type List
- type Map
- type Node
- type Object
- type Part
- type PathDecoration
- type R
- type S
- type Scope
- type SpecialDecoration
- type String
- type Struct
- type T
- type TT
- type Token
- type TypeSpec
- type U
- type V
- type Value
- type W
- type X
- type Y
Constants ¶
View Source
const DSTPATH = "github.com/JfL0unch/dst"
Variables ¶
View Source
var C = func(a int, b ...int) (c int) { return 0 } /*End*/
FuncLit
View Source
var D = A{A: 0} /*End*/
CompositeLit
View Source
var E = (1 + 1) / 2
ParenExpr
View Source
var Exprs = map[string]bool{ "BadExpr": true, "Ident": true, "Ellipsis": true, "BasicLit": true, "FuncLit": true, "CompositeLit": true, "ParenExpr": true, "SelectorExpr": true, "IndexExpr": true, "SliceExpr": true, "TypeAssertExpr": true, "CallExpr": true, "StarExpr": true, "UnaryExpr": true, "BinaryExpr": true, "KeyValueExpr": true, "ArrayType": true, "StructType": true, "FuncType": true, "InterfaceType": true, "MapType": true, "ChanType": true, }
View Source
var F = tt.F()
SelectorExpr
View Source
var G = []int{0}[0] /*End*/
IndexExpr
View Source
var H = []int{0, 1, 2}[1:2:3] /*End*/
SliceExpr(0)
View Source
var H1 = []int{0, 1, 2}[1:2] /*End*/
SliceExpr(1)
View Source
var H2 = []int{0}[:] /*End*/
SliceExpr(2)
View Source
var H3 = []int{0}[1:] /*End*/
SliceExpr(3)
View Source
var H4 = []int{0, 1, 2}[:2] /*End*/
SliceExpr(4)
View Source
var H5 = []int{0, 1, 2}[:2:3] /*End*/
SliceExpr(5)
View Source
var Info = map[string][]Part{ "Field": { Decoration{ Name: "Start", }, List{ Name: "Names", Field: Field{"Names"}, Elem: Struct{"Ident"}, Separator: token.COMMA, }, Node{ Name: "Type", Field: Field{"Type"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Type", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Tag").Op("!=").Nil() }), }, Node{ Name: "Tag", Field: Field{"Tag"}, Type: Struct{"BasicLit"}, }, Decoration{ Name: "End", }, }, "FieldList": { Decoration{ Name: "Start", }, Token{ Name: "Opening", Token: Basic{jen.Qual("go/token", "LPAREN")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Opening").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Opening") }), }, ExistsField: Field{"Opening"}, PositionField: Field{"Opening"}, }, Decoration{ Name: "Opening", }, List{ Name: "List", Field: Field{"List"}, Elem: Struct{"Field"}, Separator: token.COMMA, }, Token{ Name: "Closing", Token: Basic{jen.Qual("go/token", "RPAREN")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Closing").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Closing") }), }, ExistsField: Field{"Closing"}, PositionField: Field{"Closing"}, }, Decoration{ Name: "End", }, }, "BadExpr": { Decoration{ Name: "Start", }, Bad{ Length: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return jen.Int().Parens(jen.Add(n).Dot("To").Op("-").Add(n).Dot("From")) }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Length") }), }, LengthField: Field{"Length"}, FromField: Field{"From"}, ToField: Field{"To"}, }, Decoration{ Name: "End", }, }, "Ident": { Decoration{ Name: "Start", }, Decoration{ Name: "X", }, String{ Name: "Name", ValueField: Field{"Name"}, PositionField: Field{"NamePos"}, Literal: false, }, Decoration{ Name: "End", }, Object{ Name: "Obj", Field: Field{"Obj"}, }, PathDecoration{ Name: "Path", Field: Field{"Path"}, }, }, "Ellipsis": { Decoration{ Name: "Start", }, Token{ Name: "Ellipsis", Token: Basic{jen.Qual("go/token", "ELLIPSIS")}, PositionField: Field{"Ellipsis"}, }, Decoration{ Name: "Ellipsis", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Elt").Op("!=").Nil() }), }, Node{ Name: "Elt", Field: Field{"Elt"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "BasicLit": { Decoration{ Name: "Start", }, String{ Name: "Value", ValueField: Field{"Value"}, PositionField: Field{"ValuePos"}, Literal: true, }, Decoration{ Name: "End", }, Value{ Name: "Kind", Field: Field{"Kind"}, }, }, "FuncLit": { Decoration{ Name: "Start", }, Node{ Name: "Type", Field: Field{"Type"}, Type: Struct{"FuncType"}, }, Decoration{ Name: "Type", }, Node{ Name: "Body", Field: Field{"Body"}, Type: Struct{"BlockStmt"}, }, Decoration{ Name: "End", }, }, "CompositeLit": { Decoration{ Name: "Start", }, Node{ Name: "Type", Field: Field{"Type"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Type", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Type").Op("!=").Nil() }), }, Token{ Name: "Lbrace", Token: Basic{jen.Qual("go/token", "LBRACE")}, PositionField: Field{"Lbrace"}, }, Decoration{ Name: "Lbrace", }, List{ Name: "Elts", Field: Field{"Elts"}, Elem: Iface{"Expr"}, Separator: token.COMMA, }, Token{ Name: "Rbrace", Token: Basic{jen.Qual("go/token", "RBRACE")}, PositionField: Field{"Rbrace"}, }, Decoration{ Name: "End", }, Value{ Name: "Incomplete", Field: Field{"Incomplete"}, }, }, "ParenExpr": { Decoration{ Name: "Start", }, Token{ Name: "Lparen", Token: Basic{jen.Qual("go/token", "LPAREN")}, PositionField: Field{"Lparen"}, }, Decoration{ Name: "Lparen", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "X", }, Token{ Name: "Rparen", Token: Basic{jen.Qual("go/token", "RPAREN")}, PositionField: Field{"Rparen"}, }, Decoration{ Name: "End", }, }, "SelectorExpr": { Decoration{ Name: "Start", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Token{ Name: "Period", Token: Basic{jen.Qual("go/token", "PERIOD")}, }, Decoration{ Name: "X", }, Node{ Name: "Sel", Field: Field{"Sel"}, Type: Struct{"Ident"}, }, Decoration{ Name: "End", }, }, "IndexExpr": { Decoration{ Name: "Start", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "X", }, Token{ Name: "Lbrack", Token: Basic{jen.Qual("go/token", "LBRACK")}, PositionField: Field{"Lbrack"}, }, Decoration{ Name: "Lbrack", }, Node{ Name: "Index", Field: Field{"Index"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Index", }, Token{ Name: "Rbrack", Token: Basic{jen.Qual("go/token", "RBRACK")}, PositionField: Field{"Rbrack"}, }, Decoration{ Name: "End", }, }, "SliceExpr": { Decoration{ Name: "Start", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "X", }, Token{ Name: "Lbrack", Token: Basic{jen.Qual("go/token", "LBRACK")}, PositionField: Field{"Lbrack"}, }, Decoration{ Name: "Lbrack", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Low").Op("!=").Nil() }), }, Node{ Name: "Low", Field: Field{"Low"}, Type: Iface{"Expr"}, }, Token{ Name: "Colon1", Token: Basic{jen.Qual("go/token", "COLON")}, }, Decoration{ Name: "Low", }, Node{ Name: "High", Field: Field{"High"}, Type: Iface{"Expr"}, }, Token{ Name: "Colon2", Token: Basic{jen.Qual("go/token", "COLON")}, Exists: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Slice3") }), }, Decoration{ Name: "High", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("High").Op("!=").Nil() }), }, Node{ Name: "Max", Field: Field{"Max"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Max", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Max").Op("!=").Nil() }), }, Token{ Name: "Rbrack", Token: Basic{jen.Qual("go/token", "RBRACK")}, PositionField: Field{"Rbrack"}, }, Decoration{ Name: "End", }, Value{ Name: "Slice3", Field: Field{"Slice3"}, }, }, "TypeAssertExpr": { Decoration{ Name: "Start", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Token{ Name: "Period", Token: Basic{jen.Qual("go/token", "PERIOD")}, }, Decoration{ Name: "X", }, Token{ Name: "Lparen", Token: Basic{jen.Qual("go/token", "LPAREN")}, PositionField: Field{"Lparen"}, }, Decoration{ Name: "Lparen", }, Node{ Name: "Type", Field: Field{"Type"}, Type: Iface{"Expr"}, }, Token{ Name: "TypeToken", Token: Basic{jen.Qual("go/token", "TYPE")}, Exists: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Type").Op("==").Nil() }), }, Decoration{ Name: "Type", }, Token{ Name: "Rparen", Token: Basic{jen.Qual("go/token", "RPAREN")}, PositionField: Field{"Rparen"}, }, Decoration{ Name: "End", }, }, "CallExpr": { Decoration{ Name: "Start", }, Node{ Name: "Fun", Field: Field{"Fun"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Fun", }, Token{ Name: "Lparen", Token: Basic{jen.Qual("go/token", "LPAREN")}, PositionField: Field{"Lparen"}, }, Decoration{ Name: "Lparen", }, List{ Name: "Args", Field: Field{"Args"}, Elem: Iface{"Expr"}, Separator: token.COMMA, }, Token{ Name: "Ellipsis", Token: Basic{jen.Qual("go/token", "ELLIPSIS")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Ellipsis").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Ellipsis") }), }, ExistsField: Field{"Ellipsis"}, PositionField: Field{"Ellipsis"}, }, Decoration{ Name: "Ellipsis", Use: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Ellipsis").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Ellipsis") }), }, }, Token{ Name: "Rparen", Token: Basic{jen.Qual("go/token", "RPAREN")}, PositionField: Field{"Rparen"}, }, Decoration{ Name: "End", }, }, "StarExpr": { Decoration{ Name: "Start", }, Token{ Name: "Star", Token: Basic{jen.Qual("go/token", "MUL")}, PositionField: Field{"Star"}, }, Decoration{ Name: "Star", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "UnaryExpr": { Decoration{ Name: "Start", }, Token{ Name: "Op", TokenField: Field{"Op"}, Token: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Op") }), PositionField: Field{"OpPos"}, }, Decoration{ Name: "Op", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "BinaryExpr": { Decoration{ Name: "Start", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "X", }, Token{ Name: "Op", TokenField: Field{"Op"}, Token: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Op") }), PositionField: Field{"OpPos"}, }, Decoration{ Name: "Op", }, Node{ Name: "Y", Field: Field{"Y"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "KeyValueExpr": { Decoration{ Name: "Start", }, Node{ Name: "Key", Field: Field{"Key"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Key", }, Token{ Name: "Colon", Token: Basic{jen.Qual("go/token", "COLON")}, PositionField: Field{"Colon"}, }, Decoration{ Name: "Colon", }, Node{ Name: "Value", Field: Field{"Value"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "ArrayType": { Decoration{ Name: "Start", }, Token{ Name: "Lbrack", Token: Basic{jen.Qual("go/token", "LBRACK")}, PositionField: Field{"Lbrack"}, }, Decoration{ Name: "Lbrack", }, Node{ Name: "Len", Field: Field{"Len"}, Type: Iface{"Expr"}, }, Token{ Name: "Rbrack", Token: Basic{jen.Qual("go/token", "RBRACK")}, }, Decoration{ Name: "Len", }, Node{ Name: "Elt", Field: Field{"Elt"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "StructType": { Decoration{ Name: "Start", }, Token{ Name: "Struct", Token: Basic{jen.Qual("go/token", "STRUCT")}, PositionField: Field{"Struct"}, }, Decoration{ Name: "Struct", }, Node{ Name: "Fields", Field: Field{"Fields"}, Type: Struct{"FieldList"}, }, Decoration{ Name: "End", }, Value{ Name: "Incomplete", Field: Field{"Incomplete"}, }, }, "FuncType": { Decoration{ Name: "Start", }, Token{ Name: "Func", Token: Basic{jen.Qual("go/token", "FUNC")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Func").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Func") }), }, ExistsField: Field{"Func"}, PositionField: Field{"Func"}, }, Decoration{ Name: "Func", Use: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Func").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Func") }), }, }, Node{ Name: "Params", Field: Field{"Params"}, Type: Struct{"FieldList"}, }, Decoration{ Name: "Params", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Results").Op("!=").Nil() }), }, Node{ Name: "Results", Field: Field{"Results"}, Type: Struct{"FieldList"}, }, Decoration{ Name: "End", }, }, "InterfaceType": { Decoration{ Name: "Start", }, Token{ Name: "Interface", Token: Basic{jen.Qual("go/token", "INTERFACE")}, PositionField: Field{"Interface"}, }, Decoration{ Name: "Interface", }, Node{ Name: "Methods", Field: Field{"Methods"}, Type: Struct{"FieldList"}, }, Decoration{ Name: "End", }, Value{ Name: "Incomplete", Field: Field{"Incomplete"}, }, }, "MapType": { Decoration{ Name: "Start", }, Token{ Name: "Map", Token: Basic{jen.Qual("go/token", "MAP")}, PositionField: Field{"Map"}, }, Token{ Name: "Lbrack", Token: Basic{jen.Qual("go/token", "LBRACK")}, }, Decoration{ Name: "Map", }, Node{ Name: "Key", Field: Field{"Key"}, Type: Iface{"Expr"}, }, Token{ Name: "Rbrack", Token: Basic{jen.Qual("go/token", "RBRACK")}, }, Decoration{ Name: "Key", }, Node{ Name: "Value", Field: Field{"Value"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "ChanType": { Decoration{ Name: "Start", }, Token{ Name: "Begin", Token: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return jen.Func().Params().Qual("go/token", "Token").Block(jen.If(n.Dot("Dir").Op("==").Qual("go/ast", "RECV")).Block(jen.Return(jen.Qual("go/token", "ARROW"))), jen.Return(jen.Qual("go/token", "CHAN"))).Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return jen.Func().Params().Qual("go/token", "Token").Block(jen.If(n.Dot("Dir").Op("==").Qual(DSTPATH, "RECV")).Block(jen.Return(jen.Qual("go/token", "ARROW"))), jen.Return(jen.Qual("go/token", "CHAN"))).Call() }), }, PositionField: Field{"Begin"}, }, Token{ Name: "Chan", Token: Basic{jen.Qual("go/token", "CHAN")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Dir").Op("==").Qual("go/ast", "RECV") }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Dir").Op("==").Qual(DSTPATH, "RECV") }), }, }, Decoration{ Name: "Begin", }, Token{ Name: "Arrow", Token: Basic{jen.Qual("go/token", "ARROW")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Dir").Op("==").Qual("go/ast", "SEND") }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Dir").Op("==").Qual(DSTPATH, "SEND") }), }, PositionField: Field{"Arrow"}, }, Decoration{ Name: "Arrow", Use: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Dir").Op("==").Qual("go/ast", "SEND") }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Dir").Op("==").Qual(DSTPATH, "SEND") }), }, }, Node{ Name: "Value", Field: Field{"Value"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, Value{ Name: "Dir", Field: Field{"Dir"}, Value: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return jen.Qual(DSTPATH, "ChanDir").Parens(n.Dot("Dir")) }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return jen.Qual("go/ast", "ChanDir").Parens(n.Dot("Dir")) }), }, }, }, "BadStmt": { Decoration{ Name: "Start", }, Bad{ Length: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return jen.Int().Parens(jen.Add(n).Dot("To").Op("-").Add(n).Dot("From")) }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Length") }), }, LengthField: Field{"Length"}, FromField: Field{"From"}, ToField: Field{"To"}, }, Decoration{ Name: "End", }, }, "DeclStmt": { Decoration{ Name: "Start", }, Node{ Name: "Decl", Field: Field{"Decl"}, Type: Iface{"Decl"}, }, Decoration{ Name: "End", }, }, "EmptyStmt": { Decoration{ Name: "Start", }, Token{ Name: "Semicolon", Token: Basic{jen.Qual("go/token", "ARROW")}, Exists: Expr(func(n *jen.Statement) *jen.Statement { return jen.Op("!").Add(n).Dot("Implicit") }), PositionField: Field{"Semicolon"}, }, Decoration{ Name: "End", }, Value{ Name: "Implicit", Field: Field{"Implicit"}, }, }, "LabeledStmt": { Decoration{ Name: "Start", }, Node{ Name: "Label", Field: Field{"Label"}, Type: Struct{"Ident"}, }, Decoration{ Name: "Label", }, Token{ Name: "Colon", Token: Basic{jen.Qual("go/token", "COLON")}, PositionField: Field{"Colon"}, }, Decoration{ Name: "Colon", }, Node{ Name: "Stmt", Field: Field{"Stmt"}, Type: Iface{"Stmt"}, }, Decoration{ Name: "End", }, }, "ExprStmt": { Decoration{ Name: "Start", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "SendStmt": { Decoration{ Name: "Start", }, Node{ Name: "Chan", Field: Field{"Chan"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Chan", }, Token{ Name: "Arrow", Token: Basic{jen.Qual("go/token", "ARROW")}, PositionField: Field{"Arrow"}, }, Decoration{ Name: "Arrow", }, Node{ Name: "Value", Field: Field{"Value"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "IncDecStmt": { Decoration{ Name: "Start", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "X", }, Token{ Name: "Tok", TokenField: Field{"Tok"}, Token: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Tok") }), PositionField: Field{"TokPos"}, }, Decoration{ Name: "End", }, }, "AssignStmt": { Decoration{ Name: "Start", }, List{ Name: "Lhs", Field: Field{"Lhs"}, Elem: Iface{"Expr"}, Separator: token.COMMA, }, Token{ Name: "Tok", TokenField: Field{"Tok"}, Token: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Tok") }), PositionField: Field{"TokPos"}, }, Decoration{ Name: "Tok", }, List{ Name: "Rhs", Field: Field{"Rhs"}, Elem: Iface{"Expr"}, Separator: token.COMMA, }, Decoration{ Name: "End", }, }, "GoStmt": { Decoration{ Name: "Start", }, Token{ Name: "Go", Token: Basic{jen.Qual("go/token", "GO")}, PositionField: Field{"Go"}, }, Decoration{ Name: "Go", }, Node{ Name: "Call", Field: Field{"Call"}, Type: Struct{"CallExpr"}, }, Decoration{ Name: "End", }, }, "DeferStmt": { Decoration{ Name: "Start", }, Token{ Name: "Defer", Token: Basic{jen.Qual("go/token", "DEFER")}, PositionField: Field{"Defer"}, }, Decoration{ Name: "Defer", }, Node{ Name: "Call", Field: Field{"Call"}, Type: Struct{"CallExpr"}, }, Decoration{ Name: "End", }, }, "ReturnStmt": { Decoration{ Name: "Start", }, Token{ Name: "Return", Token: Basic{jen.Qual("go/token", "RETURN")}, PositionField: Field{"Return"}, }, Decoration{ Name: "Return", }, List{ Name: "Results", Field: Field{"Results"}, Elem: Iface{"Expr"}, Separator: token.COMMA, }, Decoration{ Name: "End", }, }, "BranchStmt": { Decoration{ Name: "Start", }, Token{ Name: "Tok", TokenField: Field{"Tok"}, Token: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Tok") }), PositionField: Field{"TokPos"}, }, Decoration{ Name: "Tok", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Label").Op("!=").Nil() }), }, Node{ Name: "Label", Field: Field{"Label"}, Type: Struct{"Ident"}, }, Decoration{ Name: "End", }, }, "BlockStmt": { Decoration{ Name: "Start", }, Token{ Name: "Lbrace", Token: Basic{jen.Qual("go/token", "LBRACE")}, PositionField: Field{"Lbrace"}, }, Decoration{ Name: "Lbrace", }, List{ Name: "List", Field: Field{"List"}, Elem: Iface{"Stmt"}, Separator: token.SEMICOLON, }, Token{ Name: "Rbrace", Token: Basic{jen.Qual("go/token", "RBRACE")}, PositionField: Field{"Rbrace"}, NoPosField: Field{"RbraceHasNoPos"}, }, Decoration{ Name: "End", }, }, "IfStmt": { Decoration{ Name: "Start", }, Token{ Name: "If", Token: Basic{jen.Qual("go/token", "IF")}, PositionField: Field{"If"}, }, Decoration{ Name: "If", }, Node{ Name: "Init", Field: Field{"Init"}, Type: Iface{"Stmt"}, }, Decoration{ Name: "Init", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Init").Op("!=").Nil() }), }, Node{ Name: "Cond", Field: Field{"Cond"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Cond", }, Node{ Name: "Body", Field: Field{"Body"}, Type: Struct{"BlockStmt"}, }, Token{ Name: "ElseTok", Token: Basic{jen.Qual("go/token", "ELSE")}, Exists: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Else").Op("!=").Nil() }), }, Decoration{ Name: "Else", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Else").Op("!=").Nil() }), }, Node{ Name: "Else", Field: Field{"Else"}, Type: Iface{"Stmt"}, }, Decoration{ Name: "End", }, }, "CaseClause": { Decoration{ Name: "Start", }, Token{ Name: "Case", Token: Expr(func(n *jen.Statement) *jen.Statement { return jen.Func().Params().Qual("go/token", "Token").Block(jen.If(n.Dot("List").Op("==").Nil()).Block(jen.Return(jen.Qual("go/token", "DEFAULT"))), jen.Return(jen.Qual("go/token", "CASE"))).Call() }), PositionField: Field{"Case"}, }, Decoration{ Name: "Case", }, List{ Name: "List", Field: Field{"List"}, Elem: Iface{"Expr"}, Separator: token.COMMA, }, Token{ Name: "Colon", Token: Basic{jen.Qual("go/token", "COLON")}, PositionField: Field{"Colon"}, }, Decoration{ Name: "Colon", }, List{ Name: "Body", Field: Field{"Body"}, Elem: Iface{"Stmt"}, Separator: token.SEMICOLON, }, Decoration{ Name: "End", }, }, "SwitchStmt": { Decoration{ Name: "Start", }, Token{ Name: "Switch", Token: Basic{jen.Qual("go/token", "SWITCH")}, PositionField: Field{"Switch"}, }, Decoration{ Name: "Switch", }, Node{ Name: "Init", Field: Field{"Init"}, Type: Iface{"Stmt"}, }, Decoration{ Name: "Init", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Init").Op("!=").Nil() }), }, Node{ Name: "Tag", Field: Field{"Tag"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Tag", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Tag").Op("!=").Nil() }), }, Node{ Name: "Body", Field: Field{"Body"}, Type: Struct{"BlockStmt"}, }, Decoration{ Name: "End", }, }, "TypeSwitchStmt": { Decoration{ Name: "Start", }, Token{ Name: "Switch", Token: Basic{jen.Qual("go/token", "SWITCH")}, PositionField: Field{"Switch"}, }, Decoration{ Name: "Switch", }, Node{ Name: "Init", Field: Field{"Init"}, Type: Iface{"Stmt"}, }, Decoration{ Name: "Init", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Init").Op("!=").Nil() }), }, Node{ Name: "Assign", Field: Field{"Assign"}, Type: Iface{"Stmt"}, }, Decoration{ Name: "Assign", }, Node{ Name: "Body", Field: Field{"Body"}, Type: Struct{"BlockStmt"}, }, Decoration{ Name: "End", }, }, "CommClause": { Decoration{ Name: "Start", }, Token{ Name: "Case", Token: Expr(func(n *jen.Statement) *jen.Statement { return jen.Func().Params().Qual("go/token", "Token").Block(jen.If(n.Dot("Comm").Op("==").Nil()).Block(jen.Return(jen.Qual("go/token", "DEFAULT"))), jen.Return(jen.Qual("go/token", "CASE"))).Call() }), PositionField: Field{"Case"}, }, Decoration{ Name: "Case", }, Node{ Name: "Comm", Field: Field{"Comm"}, Type: Iface{"Stmt"}, }, Decoration{ Name: "Comm", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Comm").Op("!=").Nil() }), }, Token{ Name: "Colon", Token: Basic{jen.Qual("go/token", "COLON")}, PositionField: Field{"Colon"}, }, Decoration{ Name: "Colon", }, List{ Name: "Body", Field: Field{"Body"}, Elem: Iface{"Stmt"}, Separator: token.SEMICOLON, }, Decoration{ Name: "End", }, }, "SelectStmt": { Decoration{ Name: "Start", }, Token{ Name: "Select", Token: Basic{jen.Qual("go/token", "SELECT")}, PositionField: Field{"Select"}, }, Decoration{ Name: "Select", }, Node{ Name: "Body", Field: Field{"Body"}, Type: Struct{"BlockStmt"}, }, Decoration{ Name: "End", }, }, "ForStmt": { Decoration{ Name: "Start", }, Token{ Name: "For", Token: Basic{jen.Qual("go/token", "FOR")}, PositionField: Field{"For"}, }, Decoration{ Name: "For", }, Node{ Name: "Init", Field: Field{"Init"}, Type: Iface{"Stmt"}, }, Token{ Name: "InitSemicolon", Token: Basic{jen.Qual("go/token", "SEMICOLON")}, Exists: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Init").Op("!=").Nil() }), }, Decoration{ Name: "Init", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Init").Op("!=").Nil() }), }, Node{ Name: "Cond", Field: Field{"Cond"}, Type: Iface{"Expr"}, }, Token{ Name: "CondSemicolon", Token: Basic{jen.Qual("go/token", "SEMICOLON")}, Exists: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Post").Op("!=").Nil() }), }, Decoration{ Name: "Cond", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Cond").Op("!=").Nil() }), }, Node{ Name: "Post", Field: Field{"Post"}, Type: Iface{"Stmt"}, }, Decoration{ Name: "Post", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Post").Op("!=").Nil() }), }, Node{ Name: "Body", Field: Field{"Body"}, Type: Struct{"BlockStmt"}, }, Decoration{ Name: "End", }, }, "RangeStmt": { Decoration{ Name: "Start", }, Token{ Name: "For", Token: Basic{jen.Qual("go/token", "FOR")}, PositionField: Field{"For"}, }, Decoration{ Name: "For", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Key").Op("!=").Nil() }), }, Node{ Name: "Key", Field: Field{"Key"}, Type: Iface{"Expr"}, }, Token{ Name: "Comma", Token: Basic{jen.Qual("go/token", "COMMA")}, Exists: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Value").Op("!=").Nil() }), }, Decoration{ Name: "Key", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Key").Op("!=").Nil() }), }, Node{ Name: "Value", Field: Field{"Value"}, Type: Iface{"Expr"}, }, Decoration{ Name: "Value", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Value").Op("!=").Nil() }), }, Token{ Name: "Tok", TokenField: Field{"Tok"}, Token: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Tok") }), Exists: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Tok").Op("!=").Qual("go/token", "ILLEGAL") }), PositionField: Field{"TokPos"}, }, Token{ Name: "Range", Token: Basic{jen.Qual("go/token", "RANGE")}, }, Decoration{ Name: "Range", }, Node{ Name: "X", Field: Field{"X"}, Type: Iface{"Expr"}, }, Decoration{ Name: "X", }, Node{ Name: "Body", Field: Field{"Body"}, Type: Struct{"BlockStmt"}, }, Decoration{ Name: "End", }, }, "ImportSpec": { Decoration{ Name: "Start", }, Node{ Name: "Name", Field: Field{"Name"}, Type: Struct{"Ident"}, }, Decoration{ Name: "Name", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Name").Op("!=").Nil() }), }, Node{ Name: "Path", Field: Field{"Path"}, Type: Struct{"BasicLit"}, }, Decoration{ Name: "End", }, }, "ValueSpec": { Decoration{ Name: "Start", }, List{ Name: "Names", Field: Field{"Names"}, Elem: Struct{"Ident"}, Separator: token.COMMA, }, Node{ Name: "Type", Field: Field{"Type"}, Type: Iface{"Expr"}, }, Token{ Name: "Assign", Token: Basic{jen.Qual("go/token", "ASSIGN")}, Exists: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Values").Op("!=").Nil() }), }, Decoration{ Name: "Assign", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Values").Op("!=").Nil() }), }, List{ Name: "Values", Field: Field{"Values"}, Elem: Iface{"Expr"}, Separator: token.COMMA, }, Decoration{ Name: "End", }, }, "TypeSpec": { Decoration{ Name: "Start", }, Node{ Name: "Name", Field: Field{"Name"}, Type: Struct{"Ident"}, }, Token{ Name: "Assign", Token: Basic{jen.Qual("go/token", "ASSIGN")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Assign").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Assign") }), }, ExistsField: Field{"Assign"}, PositionField: Field{"Assign"}, }, Decoration{ Name: "Name", }, Node{ Name: "Type", Field: Field{"Type"}, Type: Iface{"Expr"}, }, Decoration{ Name: "End", }, }, "BadDecl": { Decoration{ Name: "Start", }, Bad{ Length: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return jen.Int().Parens(jen.Add(n).Dot("To").Op("-").Add(n).Dot("From")) }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Length") }), }, LengthField: Field{"Length"}, FromField: Field{"From"}, ToField: Field{"To"}, }, Decoration{ Name: "End", }, }, "GenDecl": { Decoration{ Name: "Start", }, Token{ Name: "Tok", TokenField: Field{"Tok"}, Token: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Tok") }), PositionField: Field{"TokPos"}, }, Decoration{ Name: "Tok", }, Token{ Name: "Lparen", Token: Basic{jen.Qual("go/token", "LPAREN")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Lparen").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Lparen") }), }, ExistsField: Field{"Lparen"}, PositionField: Field{"Lparen"}, }, Decoration{ Name: "Lparen", Use: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Lparen").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Lparen") }), }, }, List{ Name: "Specs", Field: Field{"Specs"}, Elem: Iface{"Spec"}, Separator: token.SEMICOLON, }, Token{ Name: "Rparen", Token: Basic{jen.Qual("go/token", "RPAREN")}, Exists: Double{ Ast: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Rparen").Dot("IsValid").Call() }), Dst: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Rparen") }), }, ExistsField: Field{"Rparen"}, PositionField: Field{"Rparen"}, }, Decoration{ Name: "End", }, }, "FuncDecl": { Init{ Name: "Type", Field: Field{"Type"}, Type: Struct{"FuncType"}, }, Decoration{ Name: "Start", }, SpecialDecoration{ Name: "Start", Decs: InnerField{"Type", "Decs"}, }, Token{ Name: "Func", Token: Basic{jen.Qual("go/token", "FUNC")}, Exists: Basic{jen.Lit(true)}, ExistsField: InnerField{"Type", "Func"}, PositionField: InnerField{"Type", "Func"}, }, Decoration{ Name: "Func", }, SpecialDecoration{ Name: "Func", Decs: InnerField{"Type", "Decs"}, }, Node{ Name: "Recv", Field: Field{"Recv"}, Type: Struct{"FieldList"}, }, Decoration{ Name: "Recv", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Recv").Op("!=").Nil() }), }, Node{ Name: "Name", Field: Field{"Name"}, Type: Struct{"Ident"}, }, Decoration{ Name: "Name", }, Node{ Name: "Params", Field: InnerField{"Type", "Params"}, Type: Struct{"FieldList"}, }, Decoration{ Name: "Params", }, SpecialDecoration{ Name: "Params", Decs: InnerField{"Type", "Decs"}, }, Node{ Name: "Results", Field: InnerField{"Type", "Results"}, Type: Struct{"FieldList"}, }, Decoration{ Name: "Results", Use: Expr(func(n *jen.Statement) *jen.Statement { return n.Dot("Type").Dot("Results").Op("!=").Nil() }), }, SpecialDecoration{ Name: "End", Decs: InnerField{"Type", "Decs"}, End: false, }, Node{ Name: "Body", Field: Field{"Body"}, Type: Struct{"BlockStmt"}, }, Decoration{ Name: "End", }, }, "File": { Decoration{ Name: "Start", }, Token{ Name: "Package", Token: Basic{jen.Qual("go/token", "PACKAGE")}, PositionField: Field{"Package"}, }, Decoration{ Name: "Package", }, Node{ Name: "Name", Field: Field{"Name"}, Type: Struct{"Ident"}, }, Decoration{ Name: "Name", }, List{ Name: "Decls", Field: Field{"Decls"}, Elem: Iface{"Decl"}, Separator: token.SEMICOLON, }, Decoration{ Name: "End", Disable: true, }, Scope{ Name: "Scope", Field: Field{"Scope"}, }, List{ Name: "Imports", Field: Field{"Imports"}, Elem: Struct{"ImportSpec"}, NoRestore: true, }, }, "Package": { Value{ Name: "Name", Field: Field{"Name"}, }, Scope{ Name: "Scope", Field: Field{"Scope"}, }, Map{ Name: "Imports", Field: Field{"Imports"}, Elem: Struct{"Object"}, }, Map{ Name: "Files", Field: Field{"Files"}, Elem: Struct{"File"}, }, }, }
View Source
var J = f.(int) /*End*/
TypeAssertExpr
View Source
var L = C(0, []int{}...) /*End*/
CallExpr
View Source
var N = *p /*End*/
StarExpr
View Source
var O = ^1 /*End*/
UnaryExpr
View Source
var P = 1 & 2 /*End*/
BinaryExpr
View Source
var Q = map[string]string{
"a": "a",
}
KeyValueExpr
View Source
var Stmts = map[string]bool{ "BadStmt": true, "DeclStmt": true, "EmptyStmt": true, "LabeledStmt": true, "ExprStmt": true, "SendStmt": true, "IncDecStmt": true, "AssignStmt": true, "GoStmt": true, "DeferStmt": true, "ReturnStmt": true, "BranchStmt": true, "BlockStmt": true, "IfStmt": true, "CaseClause": true, "SwitchStmt": true, "TypeSwitchStmt": true, "CommClause": true, "SelectStmt": true, "ForStmt": true, "RangeStmt": true, }
Functions ¶
Types ¶
type Decoration ¶
type InnerField ¶
type InnerField struct {
Inner, Name string
}
func (InnerField) FieldName ¶ added in v0.15.0
func (f InnerField) FieldName() string
type PathDecoration ¶ added in v0.11.0
type SpecialDecoration ¶ added in v0.7.1
Click to show internal directories.
Click to hide internal directories.