MCPcopy Create free account
hub / github.com/Vespa314/cflow / Parse

Method Parse

plugin/gomark/parser/code.go:41–51  ·  view source on GitHub ↗
(tokens []*tokenizer.Token)

Source from the content-addressed store, hash-verified

39}
40
41func (p *CodeParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) {
42 size, ok := p.Match(tokens)
43 if size == 0 || !ok {
44 return nil, errors.New("not matched")
45 }
46
47 contentTokens := tokens[1 : size-1]
48 return &ast.Code{
49 Content: tokenizer.Stringify(contentTokens),
50 }, nil
51}

Callers

nothing calls this directly

Calls 2

MatchMethod · 0.95
StringifyFunction · 0.92

Tested by

no test coverage detected