MCPcopy Index your code
hub / github.com/google/mangle / LiteralOrFormula

Function LiteralOrFormula

parse/parse.go:697–713  ·  view source on GitHub ↗

LiteralOrFormula parses a single Term, an equality or inequality from a given string.

(s string)

Source from the content-addressed store, hash-verified

695
696// LiteralOrFormula parses a single Term, an equality or inequality from a given string.
697func LiteralOrFormula(s string) (ast.Term, error) {
698 p, err := newParser(s)
699 if err != nil {
700 return nil, err
701 }
702 defer p.reset()
703
704 tree := p.parser.LiteralOrFml()
705 if err := p.error(); err != nil {
706 return nil, err
707 }
708 term := p.Visit(tree)
709 if err := p.error(); err != nil {
710 return nil, err
711 }
712 return term.(ast.Term), nil
713}
714
715// Term parses a Term from given string.
716func Term(s string) (ast.Term, error) {

Callers 3

fmlFunction · 0.92

Calls 5

newParserFunction · 0.85
resetMethod · 0.80
errorMethod · 0.80
VisitMethod · 0.80
LiteralOrFmlMethod · 0.65

Tested by 3

fmlFunction · 0.74