diff --git a/pkg/gen.go b/pkg/gen.go index 44738f79088..4b80373fb6a 100644 --- a/pkg/gen.go +++ b/pkg/gen.go @@ -433,8 +433,6 @@ func (g *generator) adtKind(typ types.Type) string { return "adt.IntKind" case "Float64", "BigFloat", "Decimal": return "adt.NumberKind" - case "Complex128": - return "adt.TopKind" // TODO(mvdan): what should we return here? case "DecimalList", "StringList", "CueList": return "adt.ListKind" case "Bytes", "Reader": diff --git a/pkg/strconv/pkg.go b/pkg/strconv/pkg.go index 03ea28f86e5..b698ead629a 100644 --- a/pkg/strconv/pkg.go +++ b/pkg/strconv/pkg.go @@ -50,19 +50,6 @@ var p = &pkg.Package{ c.Ret = FormatBool(b) } }, - }, { - Name: "ParseComplex", - Params: []pkg.Param{ - {Kind: adt.StringKind}, - {Kind: adt.IntKind}, - }, - Result: adt.TopKind, - Func: func(c *pkg.CallCtxt) { - s, bitSize := c.String(0), c.Int(1) - if c.Do() { - c.Ret, c.Err = ParseComplex(s, bitSize) - } - }, }, { Name: "ParseFloat", Params: []pkg.Param{ diff --git a/pkg/strconv/strconv.go b/pkg/strconv/strconv.go index be2fe5bd3f5..3ebb68e4921 100644 --- a/pkg/strconv/strconv.go +++ b/pkg/strconv/strconv.go @@ -37,30 +37,6 @@ func FormatBool(b bool) string { return strconv.FormatBool(b) } -// ParseComplex converts the string s to a complex number -// with the precision specified by bitSize: 64 for complex64, or 128 for complex128. -// When bitSize=64, the result still has type complex128, but it will be -// convertible to complex64 without changing its value. -// -// The number represented by s must be of the form N, Ni, or N±Ni, where N stands -// for a floating-point number as recognized by ParseFloat, and i is the imaginary -// component. If the second N is unsigned, a + sign is required between the two components -// as indicated by the ±. If the second N is NaN, only a + sign is accepted. -// The form may be parenthesized and cannot contain any spaces. -// The resulting complex number consists of the two components converted by ParseFloat. -// -// The errors that ParseComplex returns have concrete type *NumError -// and include err.Num = s. -// -// If s is not syntactically well-formed, ParseComplex returns err.Err = ErrSyntax. -// -// If s is syntactically well-formed but either component is more than 1/2 ULP -// away from the largest floating point number of the given component's size, -// ParseComplex returns err.Err = ErrRange and c = ±Inf for the respective component. -func ParseComplex(s string, bitSize int) (complex128, error) { - return strconv.ParseComplex(s, bitSize) -} - // ParseFloat converts the string s to a floating-point number // with the precision specified by bitSize: 32 for float32, or 64 for float64. // When bitSize=32, the result still has type float64, but it will be