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

Method DisplayString

ast/ast.go:980–997  ·  view source on GitHub ↗

DisplayString returns a string representation for this atom using unescaped constants.

()

Source from the content-addressed store, hash-verified

978
979// DisplayString returns a string representation for this atom using unescaped constants.
980func (a Atom) DisplayString() string {
981 var sb strings.Builder
982 sb.WriteString(a.Predicate.Symbol)
983 sb.WriteString("(")
984 for i, arg := range a.Args {
985 if i > 0 {
986 sb.WriteString(",")
987 }
988 // Use DisplayString for Constant, fallback to String otherwise
989 if c, ok := arg.(Constant); ok {
990 sb.WriteString(c.DisplayString())
991 } else {
992 sb.WriteString(arg.String())
993 }
994 }
995 sb.WriteString(")")
996 return sb.String()
997}
998
999// Equals provides syntactic equality for atoms.
1000func (a Atom) Equals(u Term) bool {

Callers 4

showPredicateMethod · 0.45
QueryInteractiveMethod · 0.45
TestDisplayStringFunction · 0.45
DisplayStringMethod · 0.45

Calls 1

StringMethod · 0.65

Tested by 1

TestDisplayStringFunction · 0.36