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 {
6161
6262 what := taxa .Int
6363 result , ok := parseInt (digits , base )
64- if ! ok {
64+ switch {
65+ case ! ok :
6566 if ! taxa .IsFloatText (digits ) {
6667 l .Error (errInvalidNumber {Token : tok })
6768 // Need to set a value to avoid parse errors in Token.AsInt.
@@ -99,12 +100,16 @@ func lexNumber(l *lexer) token.Token {
99100 } else {
100101 token .SetValue (tok , value )
101102 }
102- } else if result .big != nil {
103+
104+ case result .big != nil :
103105 token .SetValue (tok , result .big )
104- } else if base != 10 || result .hasThousands {
106+
107+ case base == 10 && ! result .hasThousands :
105108 // We explicitly do not call SetValue for the most common case of base
106109 // 10 integers, because that is handled for us on-demand in AsInt. This
107110 // is a memory consumption optimization.
111+
112+ default :
108113 token .SetValue (tok , result .small )
109114 }
110115
You can’t perform that action at this time.
0 commit comments