Commit 72793f26 authored by Eric Myhre's avatar Eric Myhre

Type the TokenKind consts correctly.

You can write a surprising amount of code where the compiler will shrug
and silently coerce things for you.  Right up until you can't.
(Some test cases that'll be coming down the commit queue shortly
happened to end up checking the type of the constants, and, well.
Suddenly this was noticable.)
parent 2143068c
......@@ -56,17 +56,17 @@ func (tk Token) String() string {
type TokenKind uint8
const (
TokenKind_MapOpen = '{'
TokenKind_MapClose = '}'
TokenKind_ListOpen = '['
TokenKind_ListClose = ']'
TokenKind_Null = '0'
TokenKind_Bool = 'b'
TokenKind_Int = 'i'
TokenKind_Float = 'f'
TokenKind_String = 's'
TokenKind_Bytes = 'x'
TokenKind_Link = '/'
TokenKind_MapOpen TokenKind = '{'
TokenKind_MapClose TokenKind = '}'
TokenKind_ListOpen TokenKind = '['
TokenKind_ListClose TokenKind = ']'
TokenKind_Null TokenKind = '0'
TokenKind_Bool TokenKind = 'b'
TokenKind_Int TokenKind = 'i'
TokenKind_Float TokenKind = 'f'
TokenKind_String TokenKind = 's'
TokenKind_Bytes TokenKind = 'x'
TokenKind_Link TokenKind = '/'
)
type ErrMalformedTokenSequence struct {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment