Documentation ¶
Index ¶
- func CompareThanosToMRI(program, label string) (string, string, error)
- func Compile(p *parser.Root) (string, error)
- type GoProgram
- func (g *GoProgram) AddImports(packages ...string)
- func (g *GoProgram) BuildBlock(blk *parser.Block) *types.Block
- func (g *GoProgram) CompileArg(node parser.Node) ast.Expr
- func (g *GoProgram) CompileAssignmentNode(node *parser.AssignmentNode)
- func (g *GoProgram) CompileBlockStmt(node parser.Node) *ast.BlockStmt
- func (g *GoProgram) CompileClass(c *parser.Class) []ast.Decl
- func (g *GoProgram) CompileExpr(node parser.Node) ast.Expr
- func (g *GoProgram) CompileFunc(m *parser.Method, c *parser.Class) []ast.Decl
- func (g *GoProgram) CompileModule(mod *parser.Module) []ast.Decl
- func (g *GoProgram) CompileRangeIndexNode(rcvr ast.Expr, r *parser.RangeNode) ast.Expr
- func (g *GoProgram) CompileStmt(node parser.Node)
- func (g *GoProgram) CompileStringNode(node *parser.StringNode) ast.Expr
- func (g *GoProgram) CompileSuperNode(node *parser.SuperNode) ast.Expr
- func (g *GoProgram) GetFuncParams(rubyParams []*parser.Param) []*ast.Field
- func (g *GoProgram) GetReturnType(t types.Type) []*ast.Field
- func (g *GoProgram) TransformInfixExpressionNode(node *parser.InfixExpressionNode) ast.Expr
- func (g *GoProgram) TransformMethodCall(c *parser.MethodCall) types.Transform
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GoProgram ¶
type GoProgram struct { State *parser.Stack[State] ScopeChain parser.ScopeChain Imports map[string]bool CurrentLhs []parser.Node BlockStack *parser.Stack[*ast.BlockStmt] GlobalVars []*ast.ValueSpec Constants []*ast.ValueSpec TrackerStack []bst.IdentTracker // contains filtered or unexported fields }
func (*GoProgram) AddImports ¶
func (*GoProgram) CompileAssignmentNode ¶
func (g *GoProgram) CompileAssignmentNode(node *parser.AssignmentNode)
func (*GoProgram) CompileBlockStmt ¶
func (*GoProgram) CompileExpr ¶
Expression translation methods _do_ return AST Nodes because of the specificity of where they have to be inserted. Any additional statements can be prepended before returning.
func (*GoProgram) CompileFunc ¶
func (*GoProgram) CompileRangeIndexNode ¶
func (*GoProgram) CompileStmt ¶
Statement translation methods never return AST nodes. Instead, they always append to the current block statement.
func (*GoProgram) CompileStringNode ¶
func (g *GoProgram) CompileStringNode(node *parser.StringNode) ast.Expr
func (*GoProgram) CompileSuperNode ¶
func (*GoProgram) GetFuncParams ¶
func (*GoProgram) TransformInfixExpressionNode ¶
func (g *GoProgram) TransformInfixExpressionNode(node *parser.InfixExpressionNode) ast.Expr
func (*GoProgram) TransformMethodCall ¶
func (g *GoProgram) TransformMethodCall(c *parser.MethodCall) types.Transform
Click to show internal directories.
Click to hide internal directories.