-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
token.go
46 lines (33 loc) · 937 Bytes
/
token.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package vdf
// Token is our own type that represents a single token
// to work with during parsing
type Token int
const (
_ Token = iota
// Illegal represents a token that we
// don`t know in contect of the VDF format
Illegal
// EOF represents the End of File token.
// This is used if the file is end
EOF
// WS represents a whitespace.
// This can be a space or a tab.
WS
// EOL represents a line ending.
// This can be a \n or a \r.
EOL
// Ident represents a key or a value.
// Typically this is a simple string
Ident
// CurlyBraceOpen represents a open curly brace "{"
CurlyBraceOpen
// CurlyBraceClose represents a close curly brace "}"
CurlyBraceClose
// QuotationMark represents a quote mark '"'
QuotationMark
// EscapeSequence represents an escape character "\"
EscapeSequence
// CommentDoubleSlash represents a comment prefix with a double slash "//"
CommentDoubleSlash
)
var eof = rune(0)