summaryrefslogtreecommitdiff
path: root/conf/scanner.go
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2016-12-27 14:38:28 +0100
committerSilvan Jegen <s.jegen@gmail.com>2016-12-27 14:38:28 +0100
commitd700b7019e8fc380ee5ca454f3aa3edd36f30faf (patch)
treea92be6e027f2397094c146c9abf747ffa28bb86e /conf/scanner.go
parent25013841d2c28eca33a8a1f94a33babad36d80aa (diff)
Parse more of our current config format
Diffstat (limited to 'conf/scanner.go')
-rw-r--r--conf/scanner.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/conf/scanner.go b/conf/scanner.go
index fd9868a..44301fe 100644
--- a/conf/scanner.go
+++ b/conf/scanner.go
@@ -14,8 +14,10 @@ type tokentype int
const (
Name tokentype = iota
Literal
- DeliOpen
- DeliClose
+ ListDelimiter
+ ObjectDelimiter
+ EmptyList
+ EmptyObject
Nothing
IfStatement
)
@@ -50,7 +52,16 @@ func newScanner(r io.Reader) *scanner {
}
func getTokenType(s []byte) tokentype {
- return Nothing
+ switch s[0] {
+ case '"', '\'':
+ return Literal
+ case '[':
+ return ListDelimiter
+ case '{':
+ return ObjectDelimiter
+ }
+
+ return Name
}
func (s *scanner) Scan() (token, error) {