MCPcopy Create free account
hub / github.com/campoy/embedmd / process

Function process

embedmd/parser.go:25–41  ·  view source on GitHub ↗
(out io.Writer, in io.Reader, run commandRunner)

Source from the content-addressed store, hash-verified

23type commandRunner func(io.Writer, *command) error
24
25func process(out io.Writer, in io.Reader, run commandRunner) error {
26 s := &countingScanner{bufio.NewScanner(in), 0}
27
28 state := parsingText
29 var err error
30 for state != nil {
31 state, err = state(out, s, run)
32 if err != nil {
33 return fmt.Errorf("%d: %v", s.line, err)
34 }
35 }
36
37 if err := s.Err(); err != nil {
38 return fmt.Errorf("%d: %v", s.line, err)
39 }
40 return nil
41}
42
43type countingScanner struct {
44 *bufio.Scanner

Callers 2

TestParserFunction · 0.85
ProcessFunction · 0.85

Calls 1

stateFuncType · 0.85

Tested by 1

TestParserFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…