summaryrefslogtreecommitdiff
path: root/conf/scanner.go
diff options
context:
space:
mode:
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) {