andygeiss/esp32-transpiler

View on GitHub
transpile/handlers/handleSwitchStmt.go

Summary

Maintainability
A
0 mins
Test Coverage
package handlers

import "go/ast"

func handleSwitchStmt(stmt *ast.SwitchStmt) string {
    code := "switch ("
    code += HandleExpr(stmt.Tag)
    code += "){"
    code += handleBlockStmt(stmt.Body)
    code += "}"
    return code
}