Beispiel #1
0
// PrintExpr prints an expression
func PrintExpr(expr Expr) string {
	buf := new(bytes.Buffer)
	p := fmt8.NewPrinter(buf)
	printExpr(p, expr)
	return buf.String()
}
Beispiel #2
0
// PrintPkg prints a the content of a IR package
func PrintPkg(out io.Writer, pkg *Pkg) error {
	p := fmt8.NewPrinter(out)
	printPkg(p, pkg)
	return p.Err()
}
Beispiel #3
0
// FprintStmts prints the statements out to a writer
func FprintStmts(out io.Writer, stmts []Stmt) {
	p := fmt8.NewPrinter(out)
	printStmt(p, stmts)
}