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

Method String

ast/ast.go:1249–1268  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1247}
1248
1249func (c Clause) String() string {
1250 headStr := c.Head.String()
1251 if c.HeadTime != nil && !c.HeadTime.IsEternal() {
1252 headStr += c.HeadTime.String()
1253 }
1254 if c.Premises == nil {
1255 return fmt.Sprintf("%s.", headStr)
1256 }
1257 var premises strings.Builder
1258 for i, p := range c.Premises {
1259 if i > 0 {
1260 premises.WriteString(", ")
1261 }
1262 premises.WriteString(p.String())
1263 }
1264 if c.Transform == nil {
1265 return fmt.Sprintf("%s :- %s.", headStr, premises.String())
1266 }
1267 return fmt.Sprintf("%s :- %s |> %s.", headStr, premises.String(), c.Transform.String())
1268}
1269
1270func (t Transform) String() string {
1271 var transformStmts strings.Builder

Callers

nothing calls this directly

Calls 2

IsEternalMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected