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)
tok, err := s.Scan()
for err == nil {
fmt.Fprintf(os.Stderr, "tokentype: %d, token: %q offset: %d, line: %d\n", tok.Type, tok.Lit, tok.Offset, tok.LineNr)
tok, err = s.Scan()
}
fmt.Fprintf(os.Stderr, "Error: tokentype: %d, token: %q, err: %v\n", tok.Type, tok.Lit, err)
return &Config{}
}
|