MCPcopy
hub / github.com/MadAppGang/dingo / TernaryCodeGen

Struct TernaryCodeGen

pkg/codegen/ternary.go:33–37  ·  view source on GitHub ↗

TernaryCodeGen generates Go code from Dingo ternary expressions. Transforms: cond ? trueVal : falseVal With context (return): if cond { return trueVal } return falseVal With context (assignment): if cond { x = trueVal } else { x = falseVal } Without context (IIFE): func() T { if cond {

Source from the content-addressed store, hash-verified

31// - Inferred result type for IIFE return type
32// - Source mappings for LSP support
33type TernaryCodeGen struct {
34 *BaseGenerator
35 expr *ast.TernaryExpr
36 Context *GenContext // Optional context for human-like code generation
37}
38
39// Generate produces Go code for the ternary expression.
40//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected