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

Function parsingText

embedmd/parser.go:63–76  ·  view source on GitHub ↗
(out io.Writer, s textScanner, run commandRunner)

Source from the content-addressed store, hash-verified

61type state func(io.Writer, textScanner, commandRunner) (state, error)
62
63func parsingText(out io.Writer, s textScanner, run commandRunner) (state, error) {
64 if !s.Scan() {
65 return nil, nil // end of file, which is fine.
66 }
67 switch line := s.Text(); {
68 case strings.HasPrefix(line, "[embedmd]:#"):
69 return parsingCmd, nil
70 case strings.HasPrefix(line, "```"):
71 return codeParser{print: true}.parse, nil
72 default:
73 fmt.Fprintln(out, s.Text())
74 return parsingText, nil
75 }
76}
77
78func parsingCmd(out io.Writer, s textScanner, run commandRunner) (state, error) {
79 line := s.Text()

Callers

nothing calls this directly

Calls 2

TextMethod · 0.80
ScanMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…