Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233package parser
import ( "fmt" "strings")
var traceLevel int = 0
const traceIdentPlaceholder string = "\t"
func identLevel() string { return strings.Repeat(traceIdentPlaceholder, traceLevel-1)}
func tracePrint(fs string) { fmt.Printf("%s%s\n", identLevel(), fs)}
func incIdent() { traceLevel = traceLevel + 1 }func decIdent() { traceLevel = traceLevel - 1 }
func trace(msg string) string { incIdent() tracePrint("BEGIN " + msg) return msg}
func untrace(msg string) { tracePrint("END " + msg) decIdent()}