File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ func lexNumber(l *lexer) token.Token {
61
61
62
62
what := taxa .Int
63
63
result , ok := parseInt (digits , base )
64
- if ! ok {
64
+ switch {
65
+ case ! ok :
65
66
if ! taxa .IsFloatText (digits ) {
66
67
l .Error (errInvalidNumber {Token : tok })
67
68
// Need to set a value to avoid parse errors in Token.AsInt.
@@ -99,12 +100,16 @@ func lexNumber(l *lexer) token.Token {
99
100
} else {
100
101
token .SetValue (tok , value )
101
102
}
102
- } else if result .big != nil {
103
+
104
+ case result .big != nil :
103
105
token .SetValue (tok , result .big )
104
- } else if base != 10 || result .hasThousands {
106
+
107
+ case base == 10 && ! result .hasThousands :
105
108
// We explicitly do not call SetValue for the most common case of base
106
109
// 10 integers, because that is handled for us on-demand in AsInt. This
107
110
// is a memory consumption optimization.
111
+
112
+ default :
108
113
token .SetValue (tok , result .small )
109
114
}
110
115
You can’t perform that action at this time.
0 commit comments