30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
package compiler
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.akyoto.dev/go/color/ansi"
|
|
)
|
|
|
|
// PrintStatistics shows the statistics.
|
|
func (r *Result) PrintStatistics() {
|
|
ansi.Dim.Println("╭──────────────────────────────────────────────────────────────────────────────╮")
|
|
|
|
ansi.Dim.Print("│ ")
|
|
ansi.Dim.Printf("%-44s", "Code:")
|
|
fmt.Printf("%-32s", fmt.Sprintf("%d bytes", len(r.Code)))
|
|
ansi.Dim.Print(" │\n")
|
|
|
|
ansi.Dim.Print("│ ")
|
|
ansi.Dim.Printf("%-44s", "Data:")
|
|
fmt.Printf("%-32s", fmt.Sprintf("%d bytes", len(r.Data)))
|
|
ansi.Dim.Print(" │\n")
|
|
|
|
ansi.Dim.Print("│ ")
|
|
ansi.Dim.Printf("%-44s", "Functions:")
|
|
fmt.Printf("%-32s", fmt.Sprintf("%d / %d", len(r.Traversed), len(r.Functions)))
|
|
ansi.Dim.Print(" │\n")
|
|
|
|
ansi.Dim.Println("╰──────────────────────────────────────────────────────────────────────────────╯")
|
|
}
|