/
baselineshifts_string.go
41 lines (33 loc) · 1.12 KB
/
baselineshifts_string.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Code generated by "stringer -type=BaselineShifts"; DO NOT EDIT.
package gist
import (
"errors"
"strconv"
)
var _ = errors.New("dummy error")
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[ShiftBaseline-0]
_ = x[ShiftSuper-1]
_ = x[ShiftSub-2]
_ = x[BaselineShiftsN-3]
}
const _BaselineShifts_name = "ShiftBaselineShiftSuperShiftSubBaselineShiftsN"
var _BaselineShifts_index = [...]uint8{0, 13, 23, 31, 46}
func (i BaselineShifts) String() string {
if i < 0 || i >= BaselineShifts(len(_BaselineShifts_index)-1) {
return "BaselineShifts(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _BaselineShifts_name[_BaselineShifts_index[i]:_BaselineShifts_index[i+1]]
}
func (i *BaselineShifts) FromString(s string) error {
for j := 0; j < len(_BaselineShifts_index)-1; j++ {
if s == _BaselineShifts_name[_BaselineShifts_index[j]:_BaselineShifts_index[j+1]] {
*i = BaselineShifts(j)
return nil
}
}
return errors.New("String: " + s + " is not a valid option for type: BaselineShifts")
}