MCPcopy
hub / github.com/google/mangle / BaseTerm

Function BaseTerm

parse/parse.go:735–745  ·  view source on GitHub ↗

BaseTerm parses a BaseTerm from given string.

(s string)

Source from the content-addressed store, hash-verified

733
734// BaseTerm parses a BaseTerm from given string.
735func BaseTerm(s string) (ast.BaseTerm, error) {
736 term, err := Term(s)
737 if err != nil {
738 return nil, err
739 }
740 baseTerm, ok := term.(ast.BaseTerm)
741 if ok {
742 return baseTerm, nil
743 }
744 return nil, fmt.Errorf("not a base term: %v %T", term, term)
745}
746
747// Atom parses an Atom from given string.
748func Atom(s string) (ast.Atom, error) {

Callers 3

readPredMethod · 0.92
termFunction · 0.92
TestRoundtripFunction · 0.70

Calls 1

TermFunction · 0.70

Tested by 2

termFunction · 0.74
TestRoundtripFunction · 0.56