summaryrefslogtreecommitdiff
path: root/conf/parser.go
blob: 21bc6049e991bab3d35d7b868ae1b071b23f17fb (plain)
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
package conf

import (
	"fmt"
	"io"
	"os"
)

// Having a Config to Manager function could be nice?
// Or we could just return a Manager from here.
type Config struct {
}

type parser struct {
	scanner
}

func NewConfig(r io.Reader) *Config {
	s := newScanner(r)
	tt, tok, err := s.Next()
	for err == nil {
		fmt.Fprintf(os.Stderr, "tokentype: %d, token: %q, err: %v\n", tt, tok, err)
		tt, tok, err = s.Next()
	}
	fmt.Fprintf(os.Stderr, "Error: tokentype: %d, token: %q, err: %v\n", tt, tok, err)

	return &Config{}
}