// compile uses an error string because the error trace is built up
// during recursion.
// TODO: migrate to recursive errors
compile uses an error string because the error trace is built up
during recursion.
TODO: migrate to recursive errors
// compile uses an error string because the error trace is built up // during recursion . // TODO : migrate to recursive errors
func compile(yml interface{}) (Expr, string) {
	switch yml := yml.(type) {
	case bool:
		return boolExpr(yml), ""
	case int:
		return intExpr(yml), ""
	case float64:
		return floatExpr(yml), ""
	case string:
		return stringExpr(yml), ""
	case []interface{}:
		return compileSlice(yml)
	case map[interface{}]interface{}:
		return compileMap(yml)
	}
	return nil, ymlErrorString(yml)
}
func compile ( yml interface { } ) ( Expr , string ) { switch yml := yml . ( type ) { case bool : return boolExpr ( yml ) , " " case int : return intExpr ( yml ) , " " case float64 : return floatExpr ( yml ) , " " case string : return stringExpr ( yml ) , " " case [ ] interface { } : return compileSlice ( yml ) case map [ interface { } ] interface { } : return compileMap ( yml ) } return nil , ymlErrorString ( yml ) }
compile uses an error string because the error trace is built up
during recursion.
compile uses an error string because the error trace is built up during recursion .