On Fri, Jul 17, 2020 at 11:23 AM Heisenberg <lziqia...@gmail.com> wrote:
>
> Constant definition in token.go:
>
> literalType = 0 << 30
>
> The only use I see is:
>
> func (t token) literal() uint32 { return uint32(t - literalType) }
> func literalToken(literal uint32) token { return token(literalType + literal) 
> }
>
>
> I don't know what the purpose of this writing is. Is it okay to remove 
> literalType?

No, it's a particular value of  bitfield. That the value happens to be
zero does not matter. Written this way it's future-proof - would the
value need change to some other value.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-Wg7%3DYBo6pkVWxEmfCq4VNzeydDUUZA%2BQN2cHEU6ohJuw%40mail.gmail.com.

Reply via email to