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 {
| 31 | // - Inferred result type for IIFE return type |
| 32 | // - Source mappings for LSP support |
| 33 | type 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 | // |
nothing calls this directly
no outgoing calls
no test coverage detected