The definition of make_ functions are similar, so consolidate
these functions to a single make_token() and use define to keep
origin make_ function exist for readability.
To achieve this goal, we have to merge the union inside struct Token.
Each of the elements in the union is relative to one or more Token enum types,
but actully they can be merged to a single private data.
After that, add helper function to avoid exposing private data.
The definition of make_ functions are similar, so consolidate these functions to a single
make_token()
and use define to keep origin make_ function exist for readability.To achieve this goal, we have to merge the union inside
struct Token
. Each of the elements in the union is relative to one or more Token enum types, but actully they can be merged to a single private data.After that, add helper function to avoid exposing private data.