common-errors.go: exported all error functions.

builtin-string.go: renamed all functions from somthingStr() to strSomething()
This commit is contained in:
2024-06-10 20:37:58 +02:00
parent 0f54e01ef3
commit d9f7e5b1ad
10 changed files with 72 additions and 72 deletions
+4 -4
View File
@@ -70,7 +70,7 @@ func makeGeneratingFraction(s string) (f *FractionType, err error) {
}
for _, c := range dec[0:lsd] {
if c < '0' || c > '9' {
return nil, errExpectedGot("fract", "digit", c)
return nil, ErrExpectedGot("fract", "digit", c)
}
num = num*10 + int64(c-'0')
den = den * 10
@@ -81,7 +81,7 @@ func makeGeneratingFraction(s string) (f *FractionType, err error) {
mul := int64(1)
for _, c := range subParts[0] {
if c < '0' || c > '9' {
return nil, errExpectedGot("fract", "digit", c)
return nil, ErrExpectedGot("fract", "digit", c)
}
num = num*10 + int64(c-'0')
sub = sub*10 + int64(c-'0')
@@ -94,7 +94,7 @@ func makeGeneratingFraction(s string) (f *FractionType, err error) {
p := subParts[1][0 : len(subParts[1])-1]
for _, c := range p {
if c < '0' || c > '9' {
return nil, errExpectedGot("fract", "digit", c)
return nil, ErrExpectedGot("fract", "digit", c)
}
num = num*10 + int64(c-'0')
den = den*10 + 9
@@ -212,7 +212,7 @@ func anyToFract(v any) (f *FractionType, err error) {
}
}
if f == nil {
err = errExpectedGot("fract", TypeFraction, v)
err = ErrExpectedGot("fract", TypeFraction, v)
}
return
}