File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737
3838const fnParseCmplx = "ParseCmplx"
3939
40- // convErr splits an error returned by parseFloatPrefix
41- // into a syntax or range error for ParseCmplx.
42- fn convErr(mut err: any, s: str): any {
40+ // Handles error returned by parseFloatPrefix for ParseCmplx.
41+ fn handleErr(mut err: any, s: str): any {
4342 mut x, ok := err.(&NumError)
4443 if ok {
4544 x.Func = fnParseCmplx
4645 x.Num = s
4746 }
48- ret x
47+ ret err
4948}
5049
5150// Converts the string s to a complex number
@@ -84,7 +83,7 @@ fn ParseCmplx(mut s: str, bitSize: int)!: cmplx128 {
8483 // Read real part (possibly imaginary part if followed by 'i').
8584 mut re, mut n, mut err := parseFloatPrefix(s, size)
8685 if err != nil {
87- throw convErr (err, orig)
86+ throw handleErr (err, orig)
8887 }
8988
9089 s = s[n:]
@@ -117,7 +116,7 @@ fn ParseCmplx(mut s: str, bitSize: int)!: cmplx128 {
117116 // Read imaginary part.
118117 im, n, err := parseFloatPrefix(s, size)
119118 if err != nil {
120- throw convErr (err, orig)
119+ throw handleErr (err, orig)
121120 }
122121 s = s[n:]
123122 if s != "i" {
You can’t perform that action at this time.
0 commit comments