We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6c6e6b commit cac87d4Copy full SHA for cac87d4
dsl/dsl.go
@@ -154,6 +154,16 @@ type Var struct {
154
// For example, `VarFilterContext.Type` is mapped to `Var.Type`.
155
func (Var) Filter(pred func(*VarFilterContext) bool) bool { return boolResult }
156
157
+// Contains runs a sub-search from a given pattern using the captured
158
+// vars from the original pattern match.
159
+//
160
+// For example, given the Match(`$lhs = append($lhs, $x)`) pattern,
161
+// we can do m["lhs"].Contains(`$x`) and learn whether $lhs contains
162
+// $x as its sub-expression.
163
164
+// Experimental: this function is not part of the stable API.
165
+func (Var) Contains(pattern string) bool { return boolResult }
166
+
167
// MatchedNode represents an AST node associated with a named submatch.
168
type MatchedNode struct{}
169
0 commit comments