Documentation
¶
Index ¶
- Constants
- func GenAssignCall(lhs []string, token string, rhs string) string
- func GenAssigneStmt(lhs []string, token string, rhs []string) string
- func GenBlock(stmts []string) string
- func GenCompareExpr(left string, op string, right string) string
- func GenErrAsHandler(errorsPkg, errVar string, errTypes []string, stmts []string) string
- func GenErrHandler(errVar string, stmts []string) string
- func GenErrIsHandler(errorsPkg, errVar string, errVals []string, stmts []string) string
- func GenGotoStmt(label string) string
- func GenIfStmt(cond string, stmt []string) string
- func GenLabelDecl(name string) string
- func GenOrExpr(predicates ...string) string
- func GenReturns(exprs []string) string
- func GenVarDecl(name string, typ string) string
- type CallStmt
- type Catch
- type ExceptionSyntax
- type ExceptionSyntaxInspector
- type Finally
- type Func
- type Return
- type SyntaxBlock
- type Throw
- type Translator
- func (*Translator) Generate(info *lib.FileInfo[*ExceptionSyntax], writer io.Writer) error
- func (*Translator) InpectTypes(p *packages.Package) []*lib.Extent
- func (*Translator) InspectSyntax(p *packages.Package, _ []*lib.Extent) lib.SyntaxInspector[*ExceptionSyntax]
- func (t *Translator) Run(ctx context.Context, rootDir string, firstRun bool) error
- type Try
Constants ¶
View Source
const ( CatchError = 0 CatchType = 1 )
Variables ¶
This section is empty.
Functions ¶
func GenErrAsHandler ¶
func GenErrHandler ¶
func GenErrIsHandler ¶
func GenGotoStmt ¶
func GenLabelDecl ¶
func GenReturns ¶
func GenVarDecl ¶
Types ¶
type Catch ¶
type ExceptionSyntax ¶
type ExceptionSyntax struct { lib.Extent RetTypes []*lib.Extent Blocks []SyntaxBlock HasCatch bool HasFinally bool }
func (*ExceptionSyntax) String ¶
func (m *ExceptionSyntax) String() string
type ExceptionSyntaxInspector ¶
type ExceptionSyntaxInspector struct {
// contains filtered or unexported fields
}
func NewExceptionSyntaxInspector ¶
func NewExceptionSyntaxInspector(pkg *packages.Package) *ExceptionSyntaxInspector
func (*ExceptionSyntaxInspector) Inspect ¶
func (i *ExceptionSyntaxInspector) Inspect(node ast.Node, stack []ast.Node) (syntax *ExceptionSyntax)
func (*ExceptionSyntaxInspector) Nodes ¶
func (i *ExceptionSyntaxInspector) Nodes() []ast.Node
type Func ¶
type SyntaxBlock ¶
type Translator ¶
type Translator struct{}
func (*Translator) Generate ¶
func (*Translator) Generate(info *lib.FileInfo[*ExceptionSyntax], writer io.Writer) error
func (*Translator) InpectTypes ¶
func (*Translator) InpectTypes(p *packages.Package) []*lib.Extent
func (*Translator) InspectSyntax ¶
func (*Translator) InspectSyntax(p *packages.Package, _ []*lib.Extent) lib.SyntaxInspector[*ExceptionSyntax]
Click to show internal directories.
Click to hide internal directories.