config.go 582 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2023 The Knuth Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package kpath
  5. import (
  6. "bufio"
  7. "bytes"
  8. "fmt"
  9. "io"
  10. )
  11. func parseConfig(r io.Reader) (Context, error) {
  12. sc := bufio.NewScanner(r)
  13. for sc.Scan() {
  14. raw := bytes.TrimSpace(sc.Bytes())
  15. if len(raw) == 0 {
  16. continue
  17. }
  18. if raw[0] == '%' {
  19. continue
  20. }
  21. }
  22. err := sc.Err()
  23. if err != nil && err != io.EOF {
  24. return Context{}, fmt.Errorf("could not scan config file: %w", err)
  25. }
  26. panic("not implemented")
  27. }