(depth int)
| 204 | } |
| 205 | |
| 206 | func memberNode(depth int) string { |
| 207 | dot := "." |
| 208 | if maybe() { |
| 209 | dot = "?." |
| 210 | } |
| 211 | prop := oneOf(list[fn]{ |
| 212 | {func(_ int) string { return random(dict) }, 5}, |
| 213 | {node, 1}, |
| 214 | })(depth - 1) |
| 215 | if maybe() { |
| 216 | return fmt.Sprintf("%v%v%v", node(depth-1), dot, prop) |
| 217 | } |
| 218 | return fmt.Sprintf("%v%v[%v]", node(depth-1), dot, prop) |
| 219 | } |
| 220 | |
| 221 | func unaryNode(depth int) string { |
| 222 | op := random([]string{"-", "!", "not"}) |